[llvm-branch-commits] [llvm] [llvm-profgen] Add ITM data trace support (PR #230310)

Kunal Pathak via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Nov 4 12:01:37 PST 2026


================
@@ -563,7 +566,8 @@ void ProfileGenerator::generateLineNumBasedProfile() {
   populateBodySamplesForAllFunctions(SC.RangeCounter);
   // Fill in boundary sample counts as well as call site samples for calls
   populateBoundarySamplesForAllFunctions(SC.BranchCounter);
-  populateTypeSamplesForAllFunctions(SC.DataAccessCounter);
+  populateTypeSamplesForAllFunctions(SC.VTableAccessCounter);
+  populateDataAccessSamples(SC.DataAccessCounter);
----------------
kunalspathak wrote:

`populateDataAccessSamples()` is only called from `generateLineNumBasedProfile()` (line 570), so with a pseudo-probe binary the data profile just disappears -- no warning, empty output. The data counts are keyed by global symbol, not by code location, so I don't see a reason for them to depend on probe vs. line-number encoding.

Repro: take Inputs/etm-opencsd.yaml, add two empty sections `.pseudo_probe_desc` and `.pseudo_probe` (enough to flip `usePseudoProbes()`), and run the same trace as itm-data.test:

```
no probe sections:   [DataAccessProfiles] global_var:2 global_arr:1
with probe sections: (empty profile)
```

Since probe-based is how CSSPGO is normally used, I'd move the call up into `generateProfile()` so both paths get it (and probably CSProfileGenerator too), plus a probe variant of itm-data.test.

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


More information about the llvm-branch-commits mailing list