Create Flamegraph
This action merges time-trace files generated by Clang and generates a FlameGraph.
This is usually the next step in your workflow after building and testing your library with CMake Workflow.
To generate the files, build the project with Clang and the -ftime-trace flag. For every object file, there will be a corresponding json file with details about build time.
Each file in the build-dir will be combined into a single output file that contains all traces. The combined time-trace is used to generate a report and then converted to an image with FlameGraph.
The combined time-trace files are uploaded to artifacts. It contains the svg file generated with FlameGraph, which you can open directly in the browser. It also contains a json file you can open with:
-
https://www.speedscope.app/ (https://github.com/jlfwong/speedscope), or
-
chrome://tracing/
A simple analysis is performed while combining the trace files and a report in markdown format is also generated. This report is saved to 'inputs.report-path' and also included with the artifacts.
Example
steps:
- name: FlameGraph
uses: alandefreitas/cpp-actions/flamegraph@v1.6.1
with:
source-dir: tests
build-dir: tests/build
github_token: ${{ secrets.GITHUB_TOKEN }}
Input Parameters
Parameter |
Description |
Default |
|
The source directory used to generate time-traces. Relative paths in the report will be relative to this directory. |
|
|
The directory with the time-traces. This should usually be your build directory. |
|
|
The path where the combined traces will be stored. If this is a relative path, it will be made relative to the build-dir. |
|
|
The path where the report will be stored. If this is a relative path, it will be made relative to the build-dir. |
|
|
Generate SVG file with the output. |
|
|
Generate a small report with ClangBuildAnalyzer. |
|
|
Update action summary with the SVG file. |
|
|
An imgur client ID to upload the SVG flamegraph. |
|
|
Upload combined traces as artifact. |
|
|
Trace commands executed by the workflow. |
|