Skip to content

Interactive coverage#59

Merged
zbelinsk merged 6 commits into
masterfrom
interactive-coverage
Jun 25, 2026
Merged

Interactive coverage#59
zbelinsk merged 6 commits into
masterfrom
interactive-coverage

Conversation

@zbelinsk

Copy link
Copy Markdown
Contributor

Summary

Adds an interactive single-file HTML coverage report with per-test drill-down and bidirectional call graphs.

  • Sidebar: function list sorted by coverage %, filterable by name
  • Disasm tab: annotated disassembly with executed (green) and unexecuted (red) instruction packets
  • Call Graph tab: bidirectional tree layout (callers ← function → callees) with SVG rendering
    • Right-click drag to pan; depth input to control tree depth
    • Per-test filtering: shows only functions exercised by selected test
  • Per-test view: dropdown to switch between global (all tests merged) and individual test coverage
    • Sidebar re-sorts by per-test coverage; call graph shows only exercised functions

Changes

  • scripts/cov_html_report.py (new): generates single-file HTML from cov.rpt + cov.txt
  • scripts/Makefile.coverage: reorganize coverage artifacts into cov/ subdir; cov.html stays at top level
  • scripts/merge_cov.py: read cov_fns from installpath/cov/; preserve continuation lines
  • scripts/gen_cov_fns.pl: scan both libh2kernel.a and libh2.a; filter LLVM clones
  • makefile: remove stale cov_fns target; h2_cov now builds cov.html
  • scripts/Makefile.inc.test: update clean_top for new cov/ paths
  • Deleted stale checked-in scripts/vXX{ref,opt}_cov_fns files

Verification

Build and open the report:

make cov TARGET=ref_cov ARCHV=81
# Open artifacts/v81/ref_cov/install/cov.html in browser

Test per-test view by selecting a test from the dropdown; sidebar and call graph update to show only that test's coverage.

zbelinsk added 2 commits June 22, 2026 00:49
Signed-off-by: Zeev Belinsky <zbelinsk@qti.qualcomm.com>
…raphs

- New cov_html_report.py: generates single-file HTML from cov.rpt + cov.txt
  - Sidebar: function list sorted by coverage %, filterable by name
  - Disasm tab: annotated disassembly with exec (green) / noexec (red) packets
  - Call Graph tab: tree (callers, func, callees) with SVG layout
    - Right-click drag to pan; depth input to control tree depth
    - Per-test filtering: shows only functions exercised by selected test
  - Per-test view: dropdown to switch between global (all tests) and individual test
    - Sidebar re-sorts by per-test coverage; call graph shows only exercised functions

- Makefile.coverage: reorganize coverage artifacts into cov/ subdir
  - $(INSTALLPATH)/cov/cov_fns: generated from libh2kernel.a + libh2.a
  - $(INSTALLPATH)/cov/cov.txt: merged per-test coverage
  - $(INSTALLPATH)/cov/cov.rpt: coverage report
  - $(INSTALLPATH)/cov.html: interactive report (stays at top level)

- merge_cov.py: read cov_fns from installpath/cov/; preserve continuation lines

- gen_cov_fns.pl: scan both libh2kernel.a and libh2.a; filter LLVM clones

- makefile: remove stale cov_fns target; h2_cov now builds cov.html

- Makefile.inc.test: update clean_top for new cov/ paths

Signed-off-by: Zeev Belinsky <zbelinsk@qti.qualcomm.com>
@github-actions github-actions Bot added the untested Mark untested PRs label Jun 23, 2026

@stzahi1 stzahi1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK but let's merge after you present on weekly.

@zbelinsk

Copy link
Copy Markdown
Contributor Author

Looks OK but let's merge after you present on weekly.

Ok, thank you

zbelinsk added 4 commits June 24, 2026 09:18
Add a Coverage build and verify step to the CI workflow that runs
make cov TARGET=ref_cov to exercise the entire coveragepipeline (gen_cov_fns.pl, gen_cov_files.py, merge_cov.py, cov_rpt_tool,
cov_html_report.py). This ensures the pipeline doesn't silently break
during development.

Signed-off-by: Zeev Belinsky <zbelinsk@qti.qualcomm.com>
Signed-off-by: zbelinsk <zbelinsk@qti.qualcomm.com>
Add scripts/cov_omit_functions, a source-controlled list of functions we
deliberately do not cover.  gen_cov_fns.pl drops these names from cov_fns so
they never reach cov.txt / cov.rpt / cov.html.

cov_html_report.py:
- Filter trivial functions (<= 1 packet, always 0% or 100%) from the report.
- Treat committed omits (cov_omit_functions) as "just not in the coverage":
  drop them from funcs so they never appear as a sidebar entry, call-graph
  node/edge, per-test data, or a restorable item -- keeping the report
  self-consistent even when run against a cov.rpt that still lists them.
- Per-function Omit button: session omits accumulate in localStorage, stay
  flagged/restorable in both global and per-test views, and feed a downloadable
  updated cov_omit_functions to commit.

Makefile.coverage: pass the omit file to gen_cov_fns.pl and cov_html_report.py,
and add the dependencies so editing the list regenerates the report.

Signed-off-by: Zeev Belinsky <zbelinsk@qti.qualcomm.com>
Signed-off-by: zbelinsk <zbelinsk@qti.qualcomm.com>
@zbelinsk zbelinsk merged commit 8a62ba7 into master Jun 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

untested Mark untested PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants