Skip to content

Commit 4c95ad2

Browse files
ahunter6acmel
authored andcommitted
perf intel-pt: Fix PEBS sample for XMM registers
The condition to add XMM registers was missing, the regs array needed to be in the outer scope, and the size of the regs array was too small. Fixes: 143d34a ("perf intel-pt: Add XMM registers to synthesized PEBS sample") Signed-off-by: Adrian Hunter <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Luwei Kang <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent add07cc commit 4c95ad2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/perf/util/intel-pt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,6 +1735,7 @@ static int intel_pt_synth_pebs_sample(struct intel_pt_queue *ptq)
17351735
u64 sample_type = evsel->core.attr.sample_type;
17361736
u64 id = evsel->core.id[0];
17371737
u8 cpumode;
1738+
u64 regs[8 * sizeof(sample.intr_regs.mask)];
17381739

17391740
if (intel_pt_skip_event(pt))
17401741
return 0;
@@ -1784,8 +1785,8 @@ static int intel_pt_synth_pebs_sample(struct intel_pt_queue *ptq)
17841785
}
17851786

17861787
if (sample_type & PERF_SAMPLE_REGS_INTR &&
1787-
items->mask[INTEL_PT_GP_REGS_POS]) {
1788-
u64 regs[sizeof(sample.intr_regs.mask)];
1788+
(items->mask[INTEL_PT_GP_REGS_POS] ||
1789+
items->mask[INTEL_PT_XMM_POS])) {
17891790
u64 regs_mask = evsel->core.attr.sample_regs_intr;
17901791
u64 *pos;
17911792

0 commit comments

Comments
 (0)