[llvm] Add initial support for SPE brstack format (PR #129231)

Ádám Kallai via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 18 08:16:26 PDT 2025


================
@@ -181,11 +184,19 @@ void DataAggregator::start() {
 
   findPerfExecutable();
 
-  if (opts::BasicAggregation) {
-    launchPerfProcess("events without LBR",
-                      MainEventsPPI,
+  if (opts::ArmSPE) {
+    // pid    from_ip      to_ip        flags
+    // where flags could be:
+    // P/M: whether branch was Predicted or Mispredicted.
+    // N: optionally appears when the branch was Not-Taken (ie fall-through)
+    // 12345  0x123/0x456/PN/-/-/8/RET/-
+    launchPerfProcess("SPE brstack events", MainEventsPPI,
+                      "script -F pid,brstack --itrace=bl",
----------------
kaadam wrote:

Amir, thanks for your review. Are you thinking of something similar like this? 
```suggestion
                      if (opts::ArmSPE) {
                          opts::ITraceAggregation="bl";
                          opts::ParseMemProfile = true; // with itrace it's disabled
                          opts::BasicAggregation = false; // Do not use ie. --nl along with --spe
                      }
                      if (opts::BasicAggregation) {
```
Technically we can use ITraceAggregation for SPE of course. The intention seems not clear enough at least for me. Since it might be worth to set some other options along with itrace, to ensure the execution goes the right direction.

https://github.com/llvm/llvm-project/pull/129231


More information about the llvm-commits mailing list