[clang] [llvm] [clang][docs] Update doc and release note for probe instrumentation (PR #162606)

Haohai Wen via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 9 00:15:08 PDT 2025


https://github.com/HaohaiWen created https://github.com/llvm/llvm-project/pull/162606

-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.

>From 0e1f4fa351eb065f62450f4eec9ef4eb6bf911a0 Mon Sep 17 00:00:00 2001
From: Haohai Wen <haohai.wen at intel.com>
Date: Thu, 9 Oct 2025 10:14:40 +0800
Subject: [PATCH] [clang][docs] Update doc and release note for probe
 instrumentation

-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.
---
 clang/docs/UsersManual.rst | 38 ++++++++++++++++++++++++++++++++++++++
 llvm/docs/ReleaseNotes.md  |  4 ++++
 2 files changed, 42 insertions(+)

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.



More information about the llvm-commits mailing list