[llvm] [llvm-profgen] Generate profiles from basic perf events (PR #222624)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 10 07:53:29 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- llvm/tools/llvm-profgen/PerfReader.cpp llvm/tools/llvm-profgen/PerfReader.h llvm/tools/llvm-profgen/ProfileGenerator.cpp llvm/tools/llvm-profgen/ProfileGenerator.h llvm/tools/llvm-profgen/ProfiledBinary.cpp llvm/tools/llvm-profgen/ProfiledBinary.h llvm/tools/llvm-profgen/llvm-profgen.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/tools/llvm-profgen/PerfReader.cpp b/llvm/tools/llvm-profgen/PerfReader.cpp
index 2b346832f..18953b7e5 100644
--- a/llvm/tools/llvm-profgen/PerfReader.cpp
+++ b/llvm/tools/llvm-profgen/PerfReader.cpp
@@ -585,8 +585,7 @@ PerfScriptReader::convertPerfDataToTrace(ProfiledBinary *Binary, bool SkipPID,
"--show-mmap-events"};
if (TrackTasks)
Args.push_back("--show-task-events");
- Args.append(
- {"-F", TrackTasks ? "pid,time" : "comm,pid", "-i", PerfData});
+ Args.append({"-F", TrackTasks ? "pid,time" : "comm,pid", "-i", PerfData});
RunPerfScript(Args);
// Collect the PIDs
diff --git a/llvm/tools/llvm-profgen/ProfileGenerator.cpp b/llvm/tools/llvm-profgen/ProfileGenerator.cpp
index 92867a73e..4a54101ca 100644
--- a/llvm/tools/llvm-profgen/ProfileGenerator.cpp
+++ b/llvm/tools/llvm-profgen/ProfileGenerator.cpp
@@ -723,7 +723,8 @@ void ProfileGenerator::populateBodySamplesForAllFunctions(
// necessary in the future.
FunctionSamples &FunctionProfile = getLeafProfileAndAddTotalSamples(
FrameVec, Count * Binary->getInstSize(Address));
- updateBodySamplesforFunctionProfile(FunctionProfile, FrameVec.back(), Count);
+ updateBodySamplesforFunctionProfile(FunctionProfile, FrameVec.back(),
+ Count);
};
if (SC.BasicSampleCounter)
``````````
</details>
https://github.com/llvm/llvm-project/pull/222624
More information about the llvm-commits
mailing list