[igt-dev] [PATCH v2 11/12] code_cov_parse_info: add support for exclude filters

Andrzej Hajda andrzej.hajda at intel.com
Wed Apr 13 13:53:01 UTC 2022



On 12.04.2022 10:59, Mauro Carvalho Chehab wrote:
> From: Mauro Carvalho Chehab <mchehab at kernel.org>
>
> It is interesting to have support not only for including, but
> also for excluding functions and files. Also, it is trivial to
> have support for it.
>
> When either one or both source/function filters are enabled, it
> will print at the console the regular expressions that are applied
> to functions and sources (if any), e. g.:
>
> $ cat << END >f1
> +i915
> gem
>
> -  display
> -selftest
> END
> $ cat << END >f2
> 	-/selftests
> END

I am not sure if we really needs so tolerant parser, up to you.

> $ code_cov_parse_info dg1.info dg2.info --func-filter f1 --source-filters f2 --stat

s/func-filter/func-filters/

Btw, maybe would be good to have inline fliters:

$ code_cov_parse_info dg1.info dg2.info --func-filter '+i915,+gem,-display,-selftest' --source-filters '-/selftest' --stat

For this I would make '+/-' at the beginning required, just an idea, 
could be implemented later.

>    lines......: 72.1% (176 of 244 lines)
>    functions..: 77.3% (17 of 22 functions)
>    branches...: 50.0% (68 of 136 branches)
> Filters......: function regex (not match: m`display` m`selftest` and match: m`i915` m`gem`), source regex (match: m`/selftest`) and ignored source files where none of its code ran.

I would use then here "+i915,+gem,-display,-selftest" format, just 
shorter lines.

> Source files.: 0.99% (7 of 710 total), 77.78% (7 of 9 filtered)
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab at kernel.org>
> ---


With fixed typo, and optionally implemented suggestions:
Reviewed-by: Andrzej Hajda <andrzej.hajda at intel.com>

Regards
Andrzej



More information about the igt-dev mailing list