[clang] [analyzer] Add time-trace scopes for high-level analyzer steps (PR #125508)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 3 09:05:00 PST 2025
================
@@ -0,0 +1,38 @@
+=========================
+Performance Investigation
+=========================
+
+Multiple factors contribute to the time it takes to analyze a file with Clang Static Analyzer.
+A translation unit contains multiple entry points, each of which take multiple steps to analyze.
+
+You can add the ``-ftime-trace=file.json`` option to break down the analysis time into individual entry points and steps within each entry point.
+You can explore the generated JSON file in a Chromium browser using the ``chrome://tracing`` URL,
+or using `speedscope <https://speedscope.app>`_.
+Once you narrow down to specific analysis steps you are interested in, you can more effectively employ heavier profilers,
+such as `Perf <https://perfwiki.github.io/main/>`_ and `Callgrind <https://valgrind.org/docs/manual/cl-manual.html>`_.
+
+Each analysis step has a time scope in the trace, corresponds to processing of an exploded node, and is designated with a ``ProgramPoint``.
+If the ``ProgramPoint`` is associated with a location, you can see it on the scope metadata label.
+
+.. image:: ../images/speedscope.png
+
+On the screenshot above, under the first time ruler is the birds-eye view of the entire trace that spans a little over 8 seconds.
----------------
Xazax-hun wrote:
Do I miss something or it is not clear from the text that this screenshot is coming from speedcope?
https://github.com/llvm/llvm-project/pull/125508
More information about the cfe-commits
mailing list