From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org,
Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: Re: [PATCH 09/17] scripts/code_cov_parse_info: stop recording/writing too old fields
Date: Thu, 15 Feb 2024 20:55:00 +0100 [thread overview]
Message-ID: <20240215205500.4de8dbce@maurocar-mobl2> (raw)
In-Reply-To: <20240215170946.isatjeyc7kuv2iig@kamilkon-desk.igk.intel.com>
On Thu, 15 Feb 2024 18:09:46 +0100
Kamil Konieczny <kamil.konieczny@linux.intel.com> wrote:
> Hi Mauro,
> On 2024-02-15 at 11:27:18 +0100, Mauro Carvalho Chehab wrote:
> > From: Mauro Carvalho Chehab <mchehab@kernel.org>
> >
> > As we'll be using json as basis, drop support for the fields that:
> >
> > - aren't used at the reports;
> > - aren't even present when lcov parses gcc json format.
> >
> > Such fields are only handled on lcov for very old gcc versions.
> >
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
> > ---
> > scripts/code_cov_parse_info | 33 ---------------------------------
> > 1 file changed, 33 deletions(-)
> >
> > diff --git a/scripts/code_cov_parse_info b/scripts/code_cov_parse_info
> > index 92091215d224..038440a9c3e3 100644
> > --- a/scripts/code_cov_parse_info
> > +++ b/scripts/code_cov_parse_info
> > @@ -201,15 +201,10 @@ sub parse_info_data($)
> >
> > # FNF:<number of functions found>
> > if (m/^FNF:(-?\d+)/) {
> > - $record{$source}{func}{$func}{fnf} = $1;
> > next;
> > }
> > # FNH:<number of function hit>
> > if (m/^FNH:(-?\d+)/) {
> > - my $hits = $1;
> > - if (!defined($record{$source}{func}{$func}{fnh}) || $record{$source}{func}{$func}{fnh} < $hits) {
> > - $record{$source}{func}{$func}{fnh} = $hits;
> > - }
> > next;
> > }
> >
> > @@ -240,15 +235,10 @@ sub parse_info_data($)
> >
> > # BRF:<number of branches found>
> > if (m/^BRF:(-?\d+)/) {
> > - $record{$source}{func}{$func}{brf} = $1;
> > next;
> > }
> > # BRH:<number of branches hit>
> > if (m/^BRH:(-?\d+)/) {
> > - my $hits = $1;
> > - if (!defined($record{$source}{func}{$func}{brh}) || $record{$source}{func}{$func}{brh} < $hits) {
> > - $record{$source}{func}{$func}{brh} = $hits;
> > - }
>
> Above is self-explanatory.
>
> > next;
> > }
> >
> > @@ -340,34 +330,11 @@ sub write_filtered_file($)
> > if (defined($record{$source}{func}{$func}{fnda})) {
> > $filtered .= "FNDA:" . $record{$source}{func}{$func}{fnda} . ",$func\n";
> > }
> > - if ($record{$source}{fnf}) {
> > - $filtered .= "FNF:". $record{$source}{func}{$func}{fnf} ."\n";
> > - }
> > - if ($record{$source}{fnh}) {
> > - $filtered .= "FNH:". $record{$source}{func}{$func}{fnh} ."\n";
> > - }
> > - }
> >
> > - foreach my $ln(sort { $a <=> $b } keys %{ $record{$source}{func}{$func}{da} }) {
> > - $filtered .= "DA:$ln," . $record{$source}{func}{$func}{da}{$ln} . "\n";
>
> Why are you removing DA here? It is used elswhere.
>
> > }
> > - foreach my $where(sort sort_where keys %{ $record{$source}{func}{$func}{brda} }) {
> > - my $taken = $record{$source}{func}{$func}{brda}{$where};
>
> Same here, BRDA.
>
> > $taken = "-" if (!$taken);
> > $filtered .= "BRDA:$where,$taken\n";
> > }
> > - if ($record{$source}{func}{$func}{brf}) {
> > - $filtered .= "BRF:". $record{$source}{func}{$func}{brf} ."\n";
> > - }
> > - if ($record{$source}{func}{$func}{brh}) {
> > - $filtered .= "BRH:". $record{$source}{func}{$func}{brh} ."\n";
> > - }
> > - if ($record{$source}{func}{$func}{lf}) {
> > - $filtered .= "LF:". $record{$source}{func}{$func}{lf} ."\n";
> > - }
> > - if ($record{$source}{func}{$func}{lh}) {
> > - $filtered .= "LH:". $record{$source}{func}{$func}{lh} ."\n";
>
> LF and LH?
>
> If above is correct you can add my a-b
>
> Acked-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Basically, lcov has support for different versions of gcov and has
some sort of backward compatibility with older versions of lcov
tool. In practice, those fields aren't either be filled anymore for
a long time or just provide duplicated (incomplete) information.
The rationale behind this patch is to remove those duplicated info
from old versions that are either duplicated or not filled anymore
by gcov/lcov versions on Ubuntu 18.04 and above[1].
[1] btw, this script was never tested with versions older than
what's there on Ubuntu 18.04, so what has been removed is something
that it was not really used in practice.
>
> > - }
> > }
> >
> > $filtered .= "end_of_record\n";
> > --
> > 2.43.0
> >
next prev parent reply other threads:[~2024-02-15 19:55 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-15 10:27 [PATCH 00/17] Improve code_cov_parse_info tool Mauro Carvalho Chehab
2024-02-15 10:27 ` [PATCH 01/17] scripts/code_cov_parse_info: Silent some messages by default Mauro Carvalho Chehab
2024-02-15 16:24 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 02/17] scripts/code_cov_parse_info: do some renames to make it more coherent Mauro Carvalho Chehab
2024-02-15 16:27 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 03/17] scripts/code_cov_parse_info: better handle include regexes Mauro Carvalho Chehab
2024-02-15 16:35 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 04/17] scripts/code_cov_parse_info: add support for filtering Xe driver data Mauro Carvalho Chehab
2024-02-15 16:36 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 05/17] scripts/code_cov_parse_info: add a tool to analyze branch coverage Mauro Carvalho Chehab
2024-02-15 16:40 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 06/17] scripts/code_cov_parse_info: prepare $all_branch to get function data Mauro Carvalho Chehab
2024-02-15 16:41 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 07/17] scripts/code_cov_parse_info: use numberic sort for line numbers Mauro Carvalho Chehab
2024-02-15 16:55 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 08/17] scripts/code_cov_parse_info: make parse_info_data more generic Mauro Carvalho Chehab
2024-02-15 17:01 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 09/17] scripts/code_cov_parse_info: stop recording/writing too old fields Mauro Carvalho Chehab
2024-02-15 17:09 ` Kamil Konieczny
2024-02-15 19:55 ` Mauro Carvalho Chehab [this message]
2024-02-15 10:27 ` [PATCH 10/17] scripts/code_cov_parse_info: add support for parsing JSON files Mauro Carvalho Chehab
2024-02-15 17:12 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 11/17] scripts/code_cov_parse_info: add an internal JSON format Mauro Carvalho Chehab
2024-02-15 17:15 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 12/17] scripts/code_cov_parse_info: add support for compressed files Mauro Carvalho Chehab
2024-02-15 17:18 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 13/17] scripts/code_cov_parse_info: warn if branch block is not zero Mauro Carvalho Chehab
2024-02-15 17:19 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 14/17] scripts/code_cov_parse_info: better handle branch filtering Mauro Carvalho Chehab
2024-02-15 17:21 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 15/17] scripts/code_cov_parse_info: add support for filtering branches Mauro Carvalho Chehab
2024-02-15 18:41 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 16/17] scripts/code_cov_parse_info: fix files statistics Mauro Carvalho Chehab
2024-02-15 17:26 ` Kamil Konieczny
2024-02-15 10:27 ` [PATCH 17/17] scripts/code_cov_parse_info: better check if source file exists Mauro Carvalho Chehab
2024-02-15 17:24 ` Kamil Konieczny
2024-02-15 10:59 ` ✓ CI.xeBAT: success for Improve code_cov_parse_info tool Patchwork
2024-02-15 11:23 ` ✓ Fi.CI.BAT: " Patchwork
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=20240215205500.4de8dbce@maurocar-mobl2 \
--to=mauro.chehab@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kamil.konieczny@linux.intel.com \
--cc=mchehab@kernel.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