[clang] [Clang][UserManual] Specify usage of -b flag (PR #139763)

Madhur Amilkanthwar via cfe-commits cfe-commits at lists.llvm.org
Tue May 13 09:50:41 PDT 2025


https://github.com/madhur13490 created https://github.com/llvm/llvm-project/pull/139763

llvm-profgen cannot accept the perf profiles collected without `-b` and errors out with a message `"Invalid perf script input!"`.

This can also be validated from the code in function `checkPerfScriptType()` in `tools/llvm-profgen/PerfReader.cpp.`

>From f2181882a115b2c424b9494840f9219ef35c727e Mon Sep 17 00:00:00 2001
From: Madhur Amilkanthwar <madhura at nvidia.com>
Date: Tue, 13 May 2025 01:10:56 -0700
Subject: [PATCH] [Clang][UserManual] Specify usage of -b flag

llvm-profgen cannot accept the perf profiles
collected without `-b` and errors out with a message
"Invalid perf script input!".

This can also be found from code in function checkPerfScriptType()
in tools/llvm-profgen/PerfReader.cpp.
---
 clang/docs/UsersManual.rst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/docs/UsersManual.rst b/clang/docs/UsersManual.rst
index 6f804a10748d8..00899dcb8d8c2 100644
--- a/clang/docs/UsersManual.rst
+++ b/clang/docs/UsersManual.rst
@@ -2792,6 +2792,9 @@ usual build cycle when using sample profilers for optimization:
 
      $ llvm-profgen --binary=./code --output=code.prof --perfdata=perf.data
 
+   Please note, ``perf.data`` must be collected with ``-b`` flag to Linux ``perf``
+   for the above step to work.
+
    When using SEP the output is in the textual format corresponding to
    ``llvm-profgen --perfscript``. For example:
 



More information about the cfe-commits mailing list