Skip to content

Commit e8f721e

Browse files
authored
[clang][docs] Update doc and release note for probe instrumentation (llvm#162606)
-fpseudo-probe-for-profiling is supported for COFF in llvm#123870. llvm-profgen supports decoding pseudo probe in llvm#158207. This PR updates release note and adds an example to use it in UsersManual.rst.
1 parent 1c00a00 commit e8f721e

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

clang/docs/UsersManual.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2780,6 +2780,25 @@ usual build cycle when using sample profilers for optimization:
27802780
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^
27812781
code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf
27822782
2783+
[OPTIONAL] Pseudo instrumentation can be used as the anchor for accurate
2784+
profile mapping with the ``-fpseudo-probe-for-profiling`` option.
2785+
2786+
On Linux:
2787+
2788+
.. code-block:: console
2789+
2790+
$ clang++ -O2 -gline-tables-only \
2791+
-fpseudo-probe-for-profiling -funique-internal-linkage-names \
2792+
code.cc -o code
2793+
2794+
On Windows:
2795+
2796+
.. code-block:: winbatch
2797+
2798+
> clang-cl /O2 -gdwarf -gline-tables-only ^
2799+
-fpseudo-probe-for-profiling /clang:-funique-internal-linkage-names ^
2800+
code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf
2801+
27832802
.. note::
27842803

27852804
:ref:`-funique-internal-linkage-names <funique_internal_linkage_names>`
@@ -2881,6 +2900,25 @@ usual build cycle when using sample profilers for optimization:
28812900
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^
28822901
-fprofile-sample-use=code.prof code.cc /Fe:code
28832902
2903+
[OPTIONAL] Pseudo instrumentation can be used as the anchor for accurate
2904+
profile mapping with the ``-fpseudo-probe-for-profiling`` option.
2905+
2906+
On Linux:
2907+
2908+
.. code-block:: console
2909+
2910+
$ clang++ -O2 \
2911+
-fpseudo-probe-for-profiling -funique-internal-linkage-names \
2912+
-fprofile-sample-use=code.prof code.cc -o code
2913+
2914+
On Windows:
2915+
2916+
.. code-block:: winbatch
2917+
2918+
> clang-cl /O2 ^
2919+
-fpseudo-probe-for-profiling /clang:-funique-internal-linkage-names ^
2920+
-fprofile-sample-use=code.prof code.cc /Fe:code
2921+
28842922
[OPTIONAL] Sampling-based profiles can have inaccuracies or missing block/
28852923
edge counters. The profile inference algorithm (profi) can be used to infer
28862924
missing blocks and edge counts, and improve the quality of profile data.

llvm/docs/ReleaseNotes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ Changes to the WebAssembly Backend
134134
Changes to the Windows Target
135135
-----------------------------
136136

137+
* `-fpseudo-probe-for-profiling` is now supported for COFF.
138+
137139
Changes to the X86 Backend
138140
--------------------------
139141

@@ -161,6 +163,8 @@ Changes to the Debug Info
161163
Changes to the LLVM tools
162164
---------------------------------
163165

166+
* `llvm-profgen` now supports decoding pseudo probe for COFF binaries.
167+
164168
* `llvm-readelf` now dumps all hex format values in lower-case mode.
165169
* Some code paths for supporting Python 2.7 in `llvm-lit` have been removed.
166170
* Support for `%T` in lit has been removed.

0 commit comments

Comments
 (0)