aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2019-08-06 04:46:00 -0400
committerPeter Zijlstra <peterz@infradead.org>2019-08-28 05:29:38 -0400
commitab43762ef010967e4ccd53627f70a2eecbeafefb (patch)
tree2e04b6310c579f14555a97a779ff39d8087215ec /include/linux/perf_event.h
parent794b8bedca9341569e1081bc880e7ea209dbca5c (diff)
perf: Allow normal events to output AUX data
In some cases, ordinary (non-AUX) events can generate data for AUX events. For example, PEBS events can come out as records in the Intel PT stream instead of their usual DS records, if configured to do so. One requirement for such events is to consistently schedule together, to ensure that the data from the "AUX output" events isn't lost while their corresponding AUX event is not scheduled. We use grouping to provide this guarantee: an "AUX output" event can be added to a group where an AUX event is a group leader, and provided that the former supports writing to the latter. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: kan.liang@linux.intel.com Link: https://lkml.kernel.org/r/20190806084606.4021-2-alexander.shishkin@linux.intel.com
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r--include/linux/perf_event.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index e8ad3c590a23..61448c19a132 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -246,6 +246,7 @@ struct perf_event;
246#define PERF_PMU_CAP_ITRACE 0x20 246#define PERF_PMU_CAP_ITRACE 0x20
247#define PERF_PMU_CAP_HETEROGENEOUS_CPUS 0x40 247#define PERF_PMU_CAP_HETEROGENEOUS_CPUS 0x40
248#define PERF_PMU_CAP_NO_EXCLUDE 0x80 248#define PERF_PMU_CAP_NO_EXCLUDE 0x80
249#define PERF_PMU_CAP_AUX_OUTPUT 0x100
249 250
250/** 251/**
251 * struct pmu - generic performance monitoring unit 252 * struct pmu - generic performance monitoring unit
@@ -447,6 +448,16 @@ struct pmu {
447 /* optional */ 448 /* optional */
448 449
449 /* 450 /*
451 * Check if event can be used for aux_output purposes for
452 * events of this PMU.
453 *
454 * Runs from perf_event_open(). Should return 0 for "no match"
455 * or non-zero for "match".
456 */
457 int (*aux_output_match) (struct perf_event *event);
458 /* optional */
459
460 /*
450 * Filter events for PMU-specific reasons. 461 * Filter events for PMU-specific reasons.
451 */ 462 */
452 int (*filter_match) (struct perf_event *event); /* optional */ 463 int (*filter_match) (struct perf_event *event); /* optional */
@@ -681,6 +692,9 @@ struct perf_event {
681 struct perf_addr_filter_range *addr_filter_ranges; 692 struct perf_addr_filter_range *addr_filter_ranges;
682 unsigned long addr_filters_gen; 693 unsigned long addr_filters_gen;
683 694
695 /* for aux_output events */
696 struct perf_event *aux_event;
697
684 void (*destroy)(struct perf_event *); 698 void (*destroy)(struct perf_event *);
685 struct rcu_head rcu_head; 699 struct rcu_head rcu_head;
686 700