History

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.

Alexander Shishkin committed 7 years ago

Commit ab437621 parent 794b8be3 files · +109 −1Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/perf_event.h+14−0
@@ -246,6 +246,7 @@ struct perf_event; · 245 unmodified lines
246246 #define PERF_PMU_CAP_ITRACE 0x20
247247 #define PERF_PMU_CAP_HETEROGENEOUS_CPUS 0x40
248248 #define PERF_PMU_CAP_NO_EXCLUDE 0x80
249+#define PERF_PMU_CAP_AUX_OUTPUT 0x100
249250
250251 /**
251252 * struct pmu - generic performance monitoring unit
@@ -446,6 +447,16 @@ struct pmu { · 194 unmodified lines
446447 void (*addr_filters_sync) (struct perf_event *event);
447448 /* optional */
448449
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+
449460 /*
450461 * Filter events for PMU-specific reasons.
451462 */
@@ -681,6 +692,9 @@ struct perf_event { · 229 unmodified lines
681692 struct perf_addr_filter_range *addr_filter_ranges;
682693 unsigned long addr_filters_gen;
683694
695+ /* for aux_output events */
696+ struct perf_event *aux_event;
697+
684698 void (*destroy)(struct perf_event *);
685699 struct rcu_head rcu_head;
686700

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t