[PATCH] D151283: [llvm-cov] Support a Hierarchical Structure for Coverage Report Generating

Gulfem Savrun Yeniceri via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 08:18:35 PDT 2023


gulfem added a comment.

In D151283#4505153 <https://reviews.llvm.org/D151283#4505153>, @AtomicGu wrote:

> In D151283#4503401 <https://reviews.llvm.org/D151283#4503401>, @gulfem wrote:
>
>> Can we simplify the commit message? We do not need all the details in the commit message as we have them in the Discourse discussion. I would suggest something like: "llvm-cov currently generates a single top-level index HTML file, which causes rendering scalability issues in large projects. This patch adds support for hierarchical directory structure into the HTML reports to solve scalability issues."
>
> Do you mean I should squash the commits into one single commit? I thought Phabricator would do this for me as I always use `arc diff` with `origin/main`. I'm not sure what should I do.

Current commit message looks like this:

  [llvm-cov] Support a Hierarchical Structure for HTML Coverage Report Generating
     
  > This is a GSoC23 project ([discourse link](https://discourse.llvm.org/t/coverage-support-a-hierarchical-directory-structure-in-generated-coverage-html-reports/68239/7)).
  
  Clang supports [source-based coverage](https://clang.llvm.org/docs/SourceBasedCodeCoverage.html) that shows which lines of code are covered by the executed tests. It uses [llvm-profdata](https://llvm.org/docs/CommandGuide/llvm-profdata.html) and [llvm-cov](https://llvm.org/docs/CommandGuide/llvm-cov.html) tools to generate coverage reports. llvm-cov currently generates a single top-level index HTML file. For example, a single top-level directory [code coverage report](https://lab.llvm.org/coverage/coverage-reports/index.html) for LLVM repo is published on a coverage bot. Top-level indexing causes rendering scalability issues in large projects, such as [Fuchsia](https://fuchsia.dev). The goal of this project is to generate a hierarchical directory structure in generated coverage html reports to match the directory structure and solve scalability issues. Chromium uses its own [post-processing tools](https://source.chromium.org/chromium/chromium/tools/build/+/main:recipes/recipe_modules/code_coverage/resources/generate_coverage_metadata.py) to show a per-directory hierarchical structure for [coverage results](https://analysis.chromium.org/coverage/p/chromium). Similarly, [Lcov](https://llvm.org/reports/coverage/index.html), which is a graphical front-end [Gcov](https://gcc.gnu.org/onlinedocs/gcc/Gcov.html), provides a one-level directory structure to display coverage results.
  
  Changes to the code:
  
  - Added a new CoveragePrinterHTMLDirectory by inheriting the original CoveragePrinterHTML.
  - Added a new command line option `--show-directory-coverage` to select the new CoveragePrinterHTMLDirectory.
  - Updated the coverage report generating script of LLVM itself to use the new option.
  - Updated the document.
  - Added a new regression test for `--show-directory-coverage`.
  
  Currently the new option only works with `--format=html`. There is a plan to support `--format=text` too in the future.

I'm suggesting to remove the first paragraph:

  [llvm-cov] Support directory layout in coverage reports 
      
  This is a GSoC 2023 project ([discourse link](https://discourse.llvm.org/t/coverage-support-a-hierarchical-directory-structure-in-generated-coverage-html-reports/68239)).
   
  llvm-cov currently generates a single top-level index HTML file, which causes rendering scalability issues in large projects. This patch adds support for hierarchical directory structure into the HTML reports to solve scalability issues by introducing the following changes:
   - Added a new CoveragePrinterHTMLDirectory by inheriting the original CoveragePrinterHTML.
   - Added a new command line option `--show-directory-coverage` to select the new CoveragePrinterHTMLDirectory.
   - Updated the coverage report generating script of LLVM itself to use the new option.
   - Updated the document.
   - Added a new regression test for `--show-directory-coverage`.
   
   Currently the new option only works with `--format=html`. There is a plan to support `--format=text` too in the future.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151283/new/

https://reviews.llvm.org/D151283



More information about the llvm-commits mailing list