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
Copy file name to clipboardExpand all lines: clang/docs/ReleaseNotes.rst
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,10 @@ Non-comprehensive list of changes in this release
104
104
New Compiler Flags
105
105
------------------
106
106
107
+
- New option ``-fprofile-continuous`` added to enable continuous profile syncing to file (#GH124353, `docs <https://clang.llvm.org/docs/UsersManual.html#cmdoption-fprofile-continuous>`_).
108
+
The feature has `existed <https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#running-the-instrumented-program>`_)
109
+
for a while and this is just a user facing option.
110
+
107
111
Deprecated Compiler Flags
108
112
-------------------------
109
113
@@ -129,6 +133,8 @@ Improvements to Clang's diagnostics
129
133
which are supposed to only exist once per program, but may get duplicated when
130
134
built into a shared library.
131
135
- Fixed a bug where Clang's Analysis did not correctly model the destructor behavior of ``union`` members (#GH119415).
136
+
- A statement attribute applied to a ``case`` label no longer suppresses
`uftrace <https://github.com/namhyung/uftrace/wiki/Tutorial#getting-started>`_ is a great tool to generate rich profile data
96
+
that you can use to focus and drill down into the timeline of your application.
97
+
We will use it to generate Chromium trace JSON.
98
+
In contrast to ``perf``, this approach statically instruments every function, so it should be more precise and thorough than the sampling-based approaches like ``perf``.
99
+
In contrast to using ``-ftime-trace``, functions don't need to opt-in to be profiled using ``llvm::TimeTraceScope``.
100
+
All functions are profiled due to automatic static instrumentation.
101
+
102
+
There is only one prerequisite to use this tool.
103
+
You need to build the binary you are about to instrument using ``-pg`` or ``-finstrument-functions``.
104
+
This will make it run substantially slower but allows rich instrumentation.
105
+
It will also consume many gigabites of storage for a single trace unless filter flags are used during recording.
106
+
107
+
.. code-block:: bash
108
+
:caption: Recording with ``uftrace``, then dumping the result as a Chrome trace JSON.
109
+
110
+
uftrace record clang -cc1 -analyze -verify clang/test/Analysis/string.c \
In this picture, you can see the functions below the Static Analyzer's entry point, which takes at least 300 nanoseconds to run, visualized by Chrome's ``about:tracing`` page
117
+
You can also see how deep function calls we may have due to AST visitors.
118
+
119
+
Using different filters can reduce the number of functions to record.
120
+
For the common options, refer to the ``uftrace`` `documentation <https://github.com/namhyung/uftrace/blob/master/doc/uftrace-record.md#common-options>`_.
121
+
122
+
Similar filters can be applied for dumping too. That way you can reuse the same (detailed)
123
+
recording to selectively focus on some special part using a refinement of the filter flags.
124
+
Remember, the trace JSON needs to fit into Chrome's ``about:tracing`` or `speedscope <https://speedscope.app>`_,
125
+
thus it needs to be of a limited size.
126
+
If you do not apply filters on recording, you will collect a large trace and every dump operation
127
+
would need to sieve through the much larger recording which may be annoying if done repeatedly.
128
+
129
+
If the trace JSON is still too large to load, have a look at the dump as plain text and look for frequent entries that refer to non-interesting parts.
130
+
Once you have some of those, add them as ``--hide`` flags to the ``uftrace dump`` call.
131
+
To see what functions appear frequently in the trace, use this command:
0 commit comments