diff mbox series

[v8,1/5] perf: Add a counter for number of user access events in context

Message ID 20210517195405.3079458-2-robh@kernel.org (mailing list archive)
State New, archived
Headers show
Series arm64 userspace counter support | expand

Commit Message

Rob Herring (Arm) May 17, 2021, 7:54 p.m. UTC
When scheduling a task's context, we need to know if the task has any
user accessible events in order to enable or disable user access.
Walking the context's list of events would be slow, so add a counter
to track this.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 include/linux/perf_event.h | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index f5a6a2f069ed..4cf081e22b76 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -822,6 +822,7 @@  struct perf_event_context {
 	int				nr_stat;
 	int				nr_freq;
 	int				rotate_disable;
+	atomic_t			nr_user;
 	/*
 	 * Set when nr_events != nr_active, except tolerant to events not
 	 * necessary to be active due to scheduling constraints, such as cgroups.