From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 03/12] code_cov_parse_info: use numberic sort for line numbers
Date: Tue, 17 Jan 2023 15:05:58 +0100 [thread overview]
Message-ID: <20230117140607.2759816-4-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20230117140607.2759816-1-mauro.chehab@linux.intel.com>
From: Mauro Carvalho Chehab <mchehab@kernel.org>
The DA and BRDA information is originally numerically sorted.
Sort it the same way at the output data.
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/code_cov_parse_info | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/scripts/code_cov_parse_info b/scripts/code_cov_parse_info
index d3739211b68a..ef44229983b6 100755
--- a/scripts/code_cov_parse_info
+++ b/scripts/code_cov_parse_info
@@ -284,6 +284,21 @@ sub parse_info_data($)
close IN or die;
}
+sub sort_where($$)
+{
+ my @a = split ",", shift;
+ my @b = split ",", shift;
+ my $ret;
+
+ $ret = $a[0] <=> $b[0];
+ return $ret if ($ret);
+
+ $ret = $a[1] <=> $b[1];
+ return $ret if ($ret);
+
+ return $a[2] <=> $b[2];
+}
+
sub write_filtered_file($)
{
my $filter = shift;
@@ -325,10 +340,10 @@ sub write_filtered_file($)
}
}
- foreach my $ln(sort keys %{ $record{$source}{$func}{da} }) {
+ foreach my $ln(sort { $a <=> $b } keys %{ $record{$source}{$func}{da} }) {
$filtered .= "DA:$ln," . $record{$source}{$func}{da}{$ln} . "\n";
}
- foreach my $where(sort keys %{ $record{$source}{$func}{brda} }) {
+ foreach my $where(sort sort_where keys %{ $record{$source}{$func}{brda} }) {
my $taken = $record{$source}{$func}{brda}{$where};
$taken = "-" if (!$taken);
$filtered .= "BRDA:$where,$taken\n";
--
2.39.0
next prev parent reply other threads:[~2023-01-17 14:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 14:05 [igt-dev] [PATCH i-g-t 00/12] Improve code coverage tool Mauro Carvalho Chehab
2023-01-17 14:05 ` [igt-dev] [PATCH i-g-t 01/12] code_cov_parse_info: silent some messages by default Mauro Carvalho Chehab
2023-01-17 14:05 ` [igt-dev] [PATCH i-g-t 02/12] code_cov_parse_info: do some renames to make it more coherent Mauro Carvalho Chehab
2023-01-17 14:05 ` Mauro Carvalho Chehab [this message]
2023-01-17 14:05 ` [igt-dev] [PATCH i-g-t 04/12] code_cov_parse_info: better handle include regexes Mauro Carvalho Chehab
2023-01-17 14:06 ` [igt-dev] [PATCH i-g-t 05/12] code_cov_parse_info: add a tool to analyze branch coverage Mauro Carvalho Chehab
2023-01-17 14:06 ` [igt-dev] [PATCH i-g-t 06/12] code_cov_parse_info: add support for parsing JSON files Mauro Carvalho Chehab
2023-01-25 14:18 ` Kamil Konieczny
2023-01-17 14:06 ` [igt-dev] [PATCH i-g-t 07/12] code_cov_parse_info: add support for compressed files Mauro Carvalho Chehab
2023-01-17 14:06 ` [igt-dev] [PATCH i-g-t 08/12] code_cov_parse_info: allow specifying the source directory Mauro Carvalho Chehab
2023-01-17 14:06 ` [igt-dev] [PATCH i-g-t 09/12] code_cov_parse_info: better handle branch filtering Mauro Carvalho Chehab
2023-01-17 14:06 ` [igt-dev] [PATCH i-g-t 10/12] code_cov_parse_info: filter out branches from headers by default Mauro Carvalho Chehab
2023-01-17 14:06 ` [igt-dev] [PATCH i-g-t 11/12] code_cov_parse_info: add support for filtering branches Mauro Carvalho Chehab
2023-01-17 14:06 ` [igt-dev] [PATCH i-g-t 12/12] code_cov_parse_info: add support for filtering Xe driver data Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230117140607.2759816-4-mauro.chehab@linux.intel.com \
--to=mauro.chehab@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox