You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[analyzer] Add time-trace scopes for high-level analyzer steps (llvm#125508)
Specifically, add a scope for
- each work-list step,
- each entry point,
- each checker run within a step, and
- bug-suppression phase at the end of the analysis of an entry-point.
These scopes add no perceptible run-time overhead when time-tracing is
disabled. You can enable it and generate a time trace using the
`-ftime-trace=file.json` option.
See also the RFC:
https://discourse.llvm.org/t/analyzer-rfc-ftime-trace-time-scopes-for-steps-and-entry-points/84343
--
CPP-6065
On the speedscope screenshot above, under the first time ruler is the bird's-eye view of the entire trace that spans a little over 60 milliseconds.
30
+
Under the second ruler (focused on the 18.09-18.13ms time point) you can see a narrowed-down portion.
31
+
The second box ("HandleCode memset...") that spans entire screen (and actually extends beyond it) corresponds to the analysis of ``memset16_region_cast()`` entry point that is defined in the "string.c" test file on line 1627.
32
+
Below it, you can find multiple sub-scopes each corresponding to processing of a single exploded node.
33
+
34
+
- First: a ``PostStmt`` for some statement on line 1634. This scope has a selected subscope "CheckerManager::runCheckersForCallEvent (Pre)" that takes 5 microseconds.
35
+
- Four other nodes, too small to be discernible at this zoom level
36
+
- Last on this screenshot: another ``PostStmt`` for a statement on line 1635.
37
+
38
+
In addition to the ``-ftime-trace`` option, you can use ``-ftime-trace-granularity`` to fine-tune the time trace.
39
+
40
+
- ``-ftime-trace-granularity=NN`` dumps only time scopes that are longer than NN microseconds.
41
+
- ``-ftime-trace-verbose`` enables some additional dumps in the frontend related to template instantiations.
42
+
At the moment, it has no effect on the traces from the static analyzer.
43
+
44
+
Note: Both Chrome-tracing and speedscope tools might struggle with time traces above 100 MB in size.
45
+
Luckily, in most cases the default max-steps boundary of 225 000 produces the traces of approximately that size
46
+
for a single entry point.
47
+
You can use ``-analyze-function=get_global_options`` together with ``-ftime-trace`` to narrow down analysis to a specific entry point.
0 commit comments