Skip to content

Commit 9529835

Browse files
Andi Kleeningomolnar
authored andcommitted
perf/x86: Move Nehalem PEBS code to flag
Minor cleanup: use an explicit x86_pmu flag to handle the missing Lock / TLB information on Nehalem, instead of always checking the model number for each PEBS sample. 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: jolsa@kernel.org Link: http://lkml.kernel.org/r/20170816222156.19953-2-andi@firstfloor.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent d9a50b0 commit 9529835

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎arch/x86/events/intel/core.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3905,6 +3905,7 @@ __init int intel_pmu_init(void)
39053905

39063906
intel_pmu_pebs_data_source_nhm();
39073907
x86_add_quirk(intel_nehalem_quirk);
3908+
x86_pmu.pebs_no_tlb = 1;
39083909

39093910
pr_cont("Nehalem events, ");
39103911
break;

‎arch/x86/events/intel/ds.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ static u64 load_latency_data(u64 status)
149149
{
150150
union intel_x86_pebs_dse dse;
151151
u64 val;
152-
int model = boot_cpu_data.x86_model;
153-
int fam = boot_cpu_data.x86;
154152

155153
dse.val = status;
156154

@@ -162,8 +160,7 @@ static u64 load_latency_data(u64 status)
162160
/*
163161
* Nehalem models do not support TLB, Lock infos
164162
*/
165-
if (fam == 0x6 && (model == 26 || model == 30
166-
|| model == 31 || model == 46)) {
163+
if (x86_pmu.pebs_no_tlb) {
167164
val |= P(TLB, NA) | P(LOCK, NA);
168165
return val;
169166
}

‎arch/x86/events/perf_event.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,8 @@ struct x86_pmu {
591591
pebs :1,
592592
pebs_active :1,
593593
pebs_broken :1,
594-
pebs_prec_dist :1;
594+
pebs_prec_dist :1,
595+
pebs_no_tlb :1;
595596
int pebs_record_size;
596597
int pebs_buffer_size;
597598
void (*drain_pebs)(struct pt_regs *regs);

0 commit comments

Comments
 (0)