-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[clang][docs] Update doc and release note for probe instrumentation #162606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
-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.
@llvm/pr-subscribers-clang Author: Haohai Wen (HaohaiWen) Changes-fpseudo-probe-for-profiling is supported for COFF in #123870. This PR updates release note and adds an example to use it in Full diff: https://github.com/llvm/llvm-project/pull/162606.diff 2 Files Affected:
diff --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst
index 12c2ada062625..3261514c98043 100644
--- a/clang/docs/UsersManual.rst
+++ b/clang/docs/UsersManual.rst
@@ -2780,6 +2780,25 @@ usual build cycle when using sample profilers for optimization:
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^
code.cc /Fe:code /fuse-ld=lld /link /debug:dwarf
+ [OPTIONAL] Pseudo instrumentation can be used as the anchor for accurate
+ profile mapping with the ``-fpseudo-probe-for-profiling`` option.
+
+ On Linux:
+
+ .. code-block:: console
+
+ $ clang++ -O2 -gline-tables-only \
+ -fpseudo-probe-for-profiling -funique-internal-linkage-names \
+ code.cc -o code
+
+ On Windows:
+
+ .. code-block:: winbatch
+
+ > clang-cl /O2 -gdwarf -gline-tables-only ^
+ -fpseudo-probe-for-profiling /clang:-funique-internal-linkage-names ^
+ code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf
+
.. note::
:ref:`-funique-internal-linkage-names <funique_internal_linkage_names>`
@@ -2879,6 +2898,25 @@ usual build cycle when using sample profilers for optimization:
/clang:-fdebug-info-for-profiling /clang:-funique-internal-linkage-names ^
-fprofile-sample-use=code.prof code.cc /Fe:code -fuse-ld=lld /link /debug:dwarf
+ [OPTIONAL] Pseudo instrumentation can be used as the anchor for accurate
+ profile mapping with the ``-fpseudo-probe-for-profiling`` option.
+
+ On Linux:
+
+ .. code-block:: console
+
+ $ clang++ -O2 \
+ -fpseudo-probe-for-profiling -funique-internal-linkage-names \
+ -fprofile-sample-use=code.prof code.cc -o code
+
+ On Windows:
+
+ .. code-block:: winbatch
+
+ > clang-cl /O2 ^
+ -fpseudo-probe-for-profiling /clang:-funique-internal-linkage-names ^
+ -fprofile-sample-use=code.prof code.cc /Fe:code
+
[OPTIONAL] Sampling-based profiles can have inaccuracies or missing block/
edge counters. The profile inference algorithm (profi) can be used to infer
missing blocks and edge counts, and improve the quality of profile data.
diff --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md
index 79d93d08b8398..0efc605b5a138 100644
--- a/llvm/docs/ReleaseNotes.md
+++ b/llvm/docs/ReleaseNotes.md
@@ -134,6 +134,8 @@ Changes to the WebAssembly Backend
Changes to the Windows Target
-----------------------------
+* `-fpseudo-probe-for-profiling` is now supported for COFF.
+
Changes to the X86 Backend
--------------------------
@@ -160,6 +162,8 @@ Changes to the Debug Info
Changes to the LLVM tools
---------------------------------
+* `llvm-profgen` now supports decoding pseudo probe for COFF binaries.
+
* `llvm-readelf` now dumps all hex format values in lower-case mode.
* Some code paths for supporting Python 2.7 in `llvm-lit` have been removed.
* Support for `%T` in lit has been removed.
|
code.cc /Fe:code /fuse-ld=lld /link /debug:dwarf | ||
[OPTIONAL] Pseudo instrumentation can be used as the anchor for accurate | ||
profile mapping with the ``-fpseudo-probe-for-profiling`` option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mention the relation with -fdebug-info-for-profiling. Can both be used together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-fdebug-info-for-profiling enables discriminator in debug info which is not used when using pseudo probe.
They can be used together if user want to generate probe based profile file and line/discriminator based profile file with same binary. e.g. https://github.com/llvm/llvm-project/blob/main/llvm/test/tools/llvm-profgen/coff-profile.test
-fpseudo-probe-for-profiling is supported for COFF in #123870.
llvm-profgen supports decoding pseudo probe in #158207.
This PR updates release note and adds an example to use it in
UsersManual.rst.