Re: [PATCH v12 19/19] perf scripts: Add a coverage table
From: Namhyung Kim
Date: Tue Nov 24 2026 - 19:56:40 EST
On Mon, Nov 23, 2026 at 07:00:24PM -0300, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
>
> Render the report of the last coverage run as a table of the files with
> the most uncovered lines, biggest gap first; --all lists every file and
> -f picks files explicitly, failing when a requested file has no coverage
> data. coverage.sh prints the table when a run finishes; it is also wired
> as 'make -C tools/perf coverage-table', to print just the table. It only
> reads coverage.sh's report.txt, so the measurement and the table are
> reviewed and changed separately.
>
> For example, with --top 4 on a full test suite run:
>
> $ make -C tools/perf coverage-table O=/tmp/build/coverage \
> COVERAGE_ARGS="--top 4"
> tools/perf (no tests/ or bench/), 100+ executable lines:
> the 4 biggest uncovered gaps, start here when adding coverage tests.
> --all for every file: make -C tools/perf coverage-table O=/tmp/build/coverage COVERAGE_ARGS="--all"
>
> ┌──────────────────────────────────────────┬────────┬────────┬────────┬─────────────────────────────┬─────────────┬──────────┐
> │ File │ Lines │ Hit │ Miss │ Line Coverage │ Funcs │ FuncCov │
> ├──────────────────────────────────────────┼────────┼────────┼────────┼─────────────────────────────┼─────────────┼──────────┤
> │ util/intel-pt.c │ 3237 │ 0 │ 3237 │ ░░░░░░░░░░░░░░░░░░░░ 0.0% │ 0/142 │ 0.00% │
> │ util/intel-pt-decoder/intel-pt-decoder.c │ 3208 │ 0 │ 3208 │ ░░░░░░░░░░░░░░░░░░░░ 0.0% │ 0/119 │ 0.00% │
> │ ui/browsers/hists.c │ 2742 │ 0 │ 2742 │ ░░░░░░░░░░░░░░░░░░░░ 0.0% │ 0/124 │ 0.00% │
> │ builtin-sched.c │ 3737 │ 1543 │ 2194 │ ████████░░░░░░░░░░░░ 41.3% │ 62/141 │ 43.97% │
> ├──────────────────────────────────────────┼────────┼────────┼────────┼─────────────────────────────┼─────────────┼──────────┤
> │ TOTAL (perf) │ 174097 │ 86374 │ 87723 │ █████████░░░░░░░░░░░ 49.6% │ 5650/9358 │ 60.38% │
> └──────────────────────────────────────────┴────────┴────────┴────────┴─────────────────────────────┴─────────────┴──────────┘
Maybe you can use similar format both for line and function coverage
data.
| File | Lines | Coverage | Funcs | Coverage |
| util/intel-pt.c | 0/3237 | ## 0.0% | 0/142 | ### 0.0% |
| ...
Thanks,
Namhyung
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> ---