On Wed, Jun 17, 2026 at 11:03:07AM +0100, James Clark wrote:
[...]
- # It is safe to use 'i3i' with a three-instruction interval, since the
- # workload is compiled with -O0.
- perf script --itrace=g16i3il64 -i "$data" > "$script"
Is there a reason we don't generate callstacks on branch samples and use --itrace=g16bl64? That removes the magic number 3 and reduces the output file size and test runtime a bit.
I checked Intel-PT which does not generate callchain and branch stack for branch samples. I just keep cs-etm aligned.
I can add callstack / branch stack for branch samples.
All I had to do was copy the same "if (etm->synth_opts.callchain) { ..." block to cs_etm__synth_branch_sample(). It seems like the grepping doesn't exactly match the branch sample format so the test fails, but I'm sure that could be fixed.
This is likely caused by the regular expr.
I suppose there is value in testing instruction output, but maybe we can add the option for users to add callstacks to branch samples, even if it's not tested.
I will try to update the test for branch samples.
Thanks, Leo