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


Groups > linux.kernel > #1390762

[PATCH 07/32] perf/x86/intel/cqm: separate CQM PMU's attributes from x86 PMU

From David Carrillo-Cisneros <davidcc@google.com>
Newsgroups linux.kernel
Subject [PATCH 07/32] perf/x86/intel/cqm: separate CQM PMU's attributes from x86 PMU
Date 2016-04-29 07:00 +0200
Message-ID <rt8H1-8vJ-39@gated-at.bofh.it> (permalink)
References <rt8xj-8qy-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Create a CQM_EVENT_ATTR_STR to use in CQM to remove dependency
on the unrelated x86's PMU EVENT_ATTR_STR.

Reviewed-by: Stephane Eranian <eranian@google.com>
Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
---
 arch/x86/events/intel/cqm.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/arch/x86/events/intel/cqm.c b/arch/x86/events/intel/cqm.c
index 8457dd0..d5eac8f 100644
--- a/arch/x86/events/intel/cqm.c
+++ b/arch/x86/events/intel/cqm.c
@@ -38,6 +38,13 @@ static inline void __update_pqr_rmid(u32 rmid)
 static DEFINE_MUTEX(cache_mutex);
 static DEFINE_RAW_SPINLOCK(cache_lock);
 
+#define CQM_EVENT_ATTR_STR(_name, v, str)					\
+static struct perf_pmu_events_attr event_attr_##v = {				\
+	.attr		= __ATTR(_name, 0444, perf_event_sysfs_show, NULL),	\
+	.id		= 0,							\
+	.event_str	= str,							\
+}
+
 /*
  * Groups of events that have the same target(s), one RMID per group.
  */
@@ -504,11 +511,11 @@ static int intel_cqm_event_init(struct perf_event *event)
 	return 0;
 }
 
-EVENT_ATTR_STR(llc_occupancy, intel_cqm_llc, "event=0x01");
-EVENT_ATTR_STR(llc_occupancy.per-pkg, intel_cqm_llc_pkg, "1");
-EVENT_ATTR_STR(llc_occupancy.unit, intel_cqm_llc_unit, "Bytes");
-EVENT_ATTR_STR(llc_occupancy.scale, intel_cqm_llc_scale, NULL);
-EVENT_ATTR_STR(llc_occupancy.snapshot, intel_cqm_llc_snapshot, "1");
+CQM_EVENT_ATTR_STR(llc_occupancy, intel_cqm_llc, "event=0x01");
+CQM_EVENT_ATTR_STR(llc_occupancy.per-pkg, intel_cqm_llc_pkg, "1");
+CQM_EVENT_ATTR_STR(llc_occupancy.unit, intel_cqm_llc_unit, "Bytes");
+CQM_EVENT_ATTR_STR(llc_occupancy.scale, intel_cqm_llc_scale, NULL);
+CQM_EVENT_ATTR_STR(llc_occupancy.snapshot, intel_cqm_llc_snapshot, "1");
 
 static struct attribute *intel_cqm_events_attr[] = {
 	EVENT_PTR(intel_cqm_llc),
-- 
2.8.0.rc3.226.g39d4020

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


Thread

[PATCH 00/32] 2nd Iteration of Cache QoS Monitoring support. David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
  [PATCH 01/32] perf/x86/intel/cqm: temporarily remove MBM from CQM and cleanup David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
    Re: [PATCH 01/32] perf/x86/intel/cqm: temporarily remove MBM from  CQM and cleanup Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2016-04-29 22:30 +0200
  [PATCH 24/32] perf/x86/intel/cqm: use PERF_INACTIVE_*_READ_* flags in CQM David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
  [PATCH 25/32] sched: introduce the finish_arch_pre_lock_switch() scheduler hook David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
    Re: [PATCH 25/32] sched: introduce the finish_arch_pre_lock_switch()  scheduler hook Peter Zijlstra <peterz@infradead.org> - 2016-04-29 11:00 +0200
      Re: [PATCH 25/32] sched: introduce the finish_arch_pre_lock_switch()  scheduler hook David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 20:50 +0200
        Re: [PATCH 25/32] sched: introduce the finish_arch_pre_lock_switch()  scheduler hook Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2016-04-29 22:30 +0200
          Re: [PATCH 25/32] sched: introduce the finish_arch_pre_lock_switch()  scheduler hook David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 23:00 +0200
  [PATCH 14/32] perf/x86/intel/cqm: add preallocation of anodes David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
  [PATCH 32/32] perf/stat: revamp error handling for snapshot and per_pkg events David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
  [PATCH 09/32] perf/x86/intel/cqm: add per-package RMIDs, data and locks David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
    Re: [PATCH 09/32] perf/x86/intel/cqm: add per-package RMIDs, data  and locks Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2016-04-29 23:00 +0200
  [PATCH 29/32] perf,perf/x86,perf/powerpc,perf/arm,perf/*: add int error return to pmu::read David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
  [PATCH 06/32] x86/intel,cqm: add CONFIG_INTEL_RDT configuration flag and refactor PQR David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
  [PATCH 15/32] perf/core: add hooks to expose architecture specific features in perf_cgroup David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 18/32] perf/x86/intel/cqm: use pmu::event_terminate David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 16/32] perf/x86/intel/cqm: add cgroup support David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 17/32] perf/core: adding pmu::event_terminate David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 05/32] perf/core: remove unused pmu->count David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 04/32] perf/x86/intel/cqm: make read of RMIDs per package (Temporal) David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 11/32] perf/x86/intel/cqm: (I)state and limbo prmids David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 12/32] perf/x86/intel/cqm: add per-package RMID rotation David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 08/32] perf/x86/intel/cqm: prepare for next patches David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
    Re: [PATCH 08/32] perf/x86/intel/cqm: prepare for next patches Peter Zijlstra <peterz@infradead.org> - 2016-04-29 11:20 +0200
  [PATCH 07/32] perf/x86/intel/cqm: separate CQM PMU's attributes from x86 PMU David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 19/32] perf/core: introduce PMU event flag PERF_CGROUP_NO_RECURSION David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 10/32] perf/x86/intel/cqm: basic RMID hierarchy with per package rmids David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  Re: [PATCH 00/32] 2nd Iteration of Cache QoS Monitoring support. Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2016-04-29 23:10 +0200
    Re: [PATCH 00/32] 2nd Iteration of Cache QoS Monitoring support. David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 23:20 +0200

csiph-web