Skip to content

Commit

Permalink
perf/x86: Fix variable types for LBR registers
Browse files Browse the repository at this point in the history
The MSR variable type can be 'unsigned int', which uses less memory than
the longer 'unsigned long'. Fix 'struct x86_pmu' for that. The lbr_nr won't
be a negative number, so make it 'unsigned int' as well.

Suggested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Wei Wang <wei.w.wang@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200613080958.132489-2-like.xu@linux.intel.com
  • Loading branch information
Wei Wang authored and Peter Zijlstra committed Jul 2, 2020
1 parent 9ebcfad commit 3cb9d54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/events/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,8 @@ struct x86_pmu {
/*
* Intel LBR
*/
unsigned long lbr_tos, lbr_from, lbr_to; /* MSR base regs */
int lbr_nr; /* hardware stack size */
unsigned int lbr_tos, lbr_from, lbr_to,
lbr_nr; /* LBR base regs and size */
u64 lbr_sel_mask; /* LBR_SELECT valid bits */
const int *lbr_sel_map; /* lbr_select mappings */
bool lbr_double_abort; /* duplicated lbr aborts */
Expand Down

0 comments on commit 3cb9d54

Please sign in to comment.