[PATCH v3 11/23] perf: Add itrace_config to the event attribute

From: Alexander Shishkin
Date: Mon Aug 11 2014 - 01:31:49 EST


To configure itrace events, we use a separate config field in the attribute,
which can be used by normal and sampling counters. The latter will use config
to specify the actual event and itrace_config for itrace configuration that
will be used for sampling.

Signed-off-by: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
---
include/linux/perf_event.h | 1 +
include/uapi/linux/perf_event.h | 6 ++++++
2 files changed, 7 insertions(+)

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 94961c73e0..cb8c92e041 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -173,6 +173,7 @@ struct perf_event;
#define PERF_PMU_CAP_AUX_NO_SG 0x02
#define PERF_PMU_CAP_AUX_SW_DOUBLEBUF 0x04
#define PERF_PMU_CAP_EXCLUSIVE 0x08
+#define PERF_PMU_CAP_ITRACE 0x10

/**
* struct pmu - generic performance monitoring unit
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index 507b5e1f5b..b14b1f57c1 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -239,6 +239,7 @@ enum perf_event_read_format {
#define PERF_ATTR_SIZE_VER3 96 /* add: sample_regs_user */
/* add: sample_stack_user */
/* add: aux_watermark */
+#define PERF_ATTR_SIZE_VER4 104 /* add: itrace_config */

/*
* Hardware event_id to monitor via a performance monitoring event:
@@ -337,6 +338,11 @@ struct perf_event_attr {
* Wakeup watermark for AUX area
*/
__u32 aux_watermark;
+
+ /*
+ * Itrace pmus' event config
+ */
+ __u64 itrace_config;
};

#define perf_flags(attr) (*(&(attr)->read_format + 1))
--
2.1.0.rc1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/