summaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
authorVince Weaver2014-05-16 23:12:12 +0200
committerIngo Molnar2014-06-05 12:29:55 +0200
commit53b25335dd60981ad608da7890420898a34469a6 (patch)
tree284d8fbb69e661ea4966d96b85b44b9ef94e7e25 /include/linux/perf_event.h
parentperf: Fix use after free in perf_remove_from_context() (diff)
downloadkernel-qcow2-linux-53b25335dd60981ad608da7890420898a34469a6.tar.gz
kernel-qcow2-linux-53b25335dd60981ad608da7890420898a34469a6.tar.xz
kernel-qcow2-linux-53b25335dd60981ad608da7890420898a34469a6.zip
perf: Disable sampled events if no PMU interrupt
Add common code to generate -ENOTSUPP at event creation time if an architecture attempts to create a sampled event and PERF_PMU_NO_INTERRUPT is set. This adds a new pmu->capabilities flag. Initially we only support PERF_PMU_NO_INTERRUPT (to indicate a PMU has no support for generating hardware interrupts) but there are other capabilities that can be added later. Signed-off-by: Vince Weaver <vincent.weaver@maine.edu> Acked-by: Will Deacon <will.deacon@arm.com> [peterz: rename to PERF_PMU_CAP_* and moved the pmu::capabilities word into a hole] Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1405161708060.11099@vincent-weaver-1.umelst.maine.edu Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r--include/linux/perf_event.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index af6dcf1d9e47..267c8f37012c 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -167,6 +167,11 @@ struct perf_event;
#define PERF_EVENT_TXN 0x1
/**
+ * pmu::capabilities flags
+ */
+#define PERF_PMU_CAP_NO_INTERRUPT 0x01
+
+/**
* struct pmu - generic performance monitoring unit
*/
struct pmu {
@@ -178,6 +183,11 @@ struct pmu {
const char *name;
int type;
+ /*
+ * various common per-pmu feature flags
+ */
+ int capabilities;
+
int * __percpu pmu_disable_count;
struct perf_cpu_context * __percpu pmu_cpu_context;
int task_ctx_nr;