Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1720015

[tip:perf/core] perf/x86: Move Nehalem PEBS code to flag

From tip-bot for Andi Kleen <tipbot@zytor.com>
Newsgroups linux.kernel
Subject [tip:perf/core] perf/x86: Move Nehalem PEBS code to flag
Date 2017-08-25 14:00 +0200
Message-ID <uilrl-3A3-33@gated-at.bofh.it> (permalink)
References <ufeZ4-4rP-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Commit-ID:  95298355143f9765f0d40ed57dce7fa6571cc623
Gitweb:     http://git.kernel.org/tip/95298355143f9765f0d40ed57dce7fa6571cc623
Author:     Andi Kleen <ak@linux.intel.com>
AuthorDate: Wed, 16 Aug 2017 15:21:53 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 25 Aug 2017 11:04:16 +0200

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>
---
 arch/x86/events/intel/core.c | 1 +
 arch/x86/events/intel/ds.c   | 5 +----
 arch/x86/events/perf_event.h | 3 ++-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 98b0f07..c3439a3 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -3905,6 +3905,7 @@ __init int intel_pmu_init(void)
 
 		intel_pmu_pebs_data_source_nhm();
 		x86_add_quirk(intel_nehalem_quirk);
+		x86_pmu.pebs_no_tlb = 1;
 
 		pr_cont("Nehalem events, ");
 		break;
diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
index a322fed..3ccdf8c 100644
--- a/arch/x86/events/intel/ds.c
+++ b/arch/x86/events/intel/ds.c
@@ -149,8 +149,6 @@ static u64 load_latency_data(u64 status)
 {
 	union intel_x86_pebs_dse dse;
 	u64 val;
-	int model = boot_cpu_data.x86_model;
-	int fam = boot_cpu_data.x86;
 
 	dse.val = status;
 
@@ -162,8 +160,7 @@ static u64 load_latency_data(u64 status)
 	/*
 	 * Nehalem models do not support TLB, Lock infos
 	 */
-	if (fam == 0x6 && (model == 26 || model == 30
-	    || model == 31 || model == 46)) {
+	if (x86_pmu.pebs_no_tlb) {
 		val |= P(TLB, NA) | P(LOCK, NA);
 		return val;
 	}
diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
index 476aec3..2e9636e 100644
--- a/arch/x86/events/perf_event.h
+++ b/arch/x86/events/perf_event.h
@@ -591,7 +591,8 @@ struct x86_pmu {
 			pebs		:1,
 			pebs_active	:1,
 			pebs_broken	:1,
-			pebs_prec_dist	:1;
+			pebs_prec_dist	:1,
+			pebs_no_tlb	:1;
 	int		pebs_record_size;
 	int		pebs_buffer_size;
 	void		(*drain_pebs)(struct pt_regs *regs);

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Fix Skylake PEBS data source for perf v5 Andi Kleen <andi@firstfloor.org> - 2017-08-17 00:30 +0200
  [PATCH v5 1/4] perf/x86: Move Nehalem PEBS code to flag Andi Kleen <andi@firstfloor.org> - 2017-08-17 00:30 +0200
    [tip:perf/core] perf/x86: Move Nehalem PEBS code to flag tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-08-25 14:00 +0200
  [PATCH v5 3/4] perf, tools: Add support for printing new mem_info encodings Andi Kleen <andi@firstfloor.org> - 2017-08-17 00:30 +0200
    Re: [PATCH v5 3/4] perf, tools: Add support for printing new  mem_info encodings Jiri Olsa <jolsa@redhat.com> - 2017-08-23 15:10 +0200
      Re: [PATCH v5 3/4] perf, tools: Add support for printing new  mem_info encodings Andi Kleen <ak@linux.intel.com> - 2017-08-23 16:10 +0200
        Re: [PATCH v5 3/4] perf, tools: Add support for printing new  mem_info encodings Jiri Olsa <jolsa@redhat.com> - 2017-08-23 16:20 +0200
          Re: [PATCH v5 3/4] perf, tools: Add support for printing new  mem_info encodings Andi Kleen <andi@firstfloor.org> - 2017-08-23 18:00 +0200
            Re: [PATCH v5 3/4] perf, tools: Add support for printing new  mem_info encodings Jiri Olsa <jolsa@redhat.com> - 2017-08-24 10:30 +0200
    [tip:perf/core] perf tools: Add support for printing new mem_info  encodings tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-08-24 10:30 +0200
  [PATCH v5 2/4] perf/x86: Fix data source decoding for Skylake Andi Kleen <andi@firstfloor.org> - 2017-08-17 00:30 +0200
    [tip:perf/core] perf/x86: Fix data source decoding for Skylake tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-08-25 14:00 +0200
  [PATCH v5 4/4] perf, tools: Add test cases for new data source encoding Andi Kleen <andi@firstfloor.org> - 2017-08-17 00:30 +0200
    [tip:perf/core] perf test: Add test cases for new data source  encoding tip-bot for Andi Kleen <tipbot@zytor.com> - 2017-08-24 10:30 +0200
  Re: Fix Skylake PEBS data source for perf v5 Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-08-22 17:40 +0200

csiph-web