Skip to content

Commit e057336

Browse files
Andi KleenIngo Molnar
authored andcommitted
perf/x86/intel/lbr: Use correct index to save/restore LBR_INFO with call stack
Use the correct index to save/restore the LBR_INFO_x MSR in callstack mode. This is more a cleanup, as even with the wrong index the register was correctly saved/restored, and also LBR callgraph mode in perf tools do not really need anything in LBR_INFO. But still better to use the right index. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: acme@kernel.org Cc: eranian@google.com Cc: jolsa@redhat.com Link: http://lkml.kernel.org/r/1432786398-23861-5-git-send-email-andi@firstfloor.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 9a92e16 commit e057336

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kernel/cpu/perf_event_intel_lbr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static void __intel_pmu_lbr_restore(struct x86_perf_task_context *task_ctx)
245245
wrmsrl(x86_pmu.lbr_from + lbr_idx, task_ctx->lbr_from[i]);
246246
wrmsrl(x86_pmu.lbr_to + lbr_idx, task_ctx->lbr_to[i]);
247247
if (x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO)
248-
wrmsrl(MSR_LBR_INFO_0 + i, task_ctx->lbr_info[i]);
248+
wrmsrl(MSR_LBR_INFO_0 + lbr_idx, task_ctx->lbr_info[i]);
249249
}
250250
task_ctx->lbr_stack_state = LBR_NONE;
251251
}
@@ -268,7 +268,7 @@ static void __intel_pmu_lbr_save(struct x86_perf_task_context *task_ctx)
268268
rdmsrl(x86_pmu.lbr_from + lbr_idx, task_ctx->lbr_from[i]);
269269
rdmsrl(x86_pmu.lbr_to + lbr_idx, task_ctx->lbr_to[i]);
270270
if (x86_pmu.intel_cap.lbr_format == LBR_FORMAT_INFO)
271-
rdmsrl(MSR_LBR_INFO_0 + i, task_ctx->lbr_info[i]);
271+
rdmsrl(MSR_LBR_INFO_0 + lbr_idx, task_ctx->lbr_info[i]);
272272
}
273273
task_ctx->lbr_stack_state = LBR_VALID;
274274
}

0 commit comments

Comments
 (0)