linux/kernel/events
John Hubbard d32bf877c0 perf/core: out-of-line and export perf_allow_cpu/tracepoint()
These helpers are static inline in <linux/perf_event.h> and reach
into sysctl_perf_event_paranoid and security_perf_event_open(),
neither of which is itself exported. The perf_allow_* trio is
therefore asymmetric: built-in callers can use any of the three, but
modular code can only call perf_allow_kernel().

Move both bodies into kernel/events/core.c next to perf_allow_kernel()
and export them with EXPORT_SYMBOL_GPL, following the shape of
commit 5e9629d0ae ("drivers/perf: arm_spe: Use perf_allow_kernel()
for permissions"). Existing in-tree callers live in built-in arch and
tracing code, so the change is invisible to them.

Provide !CONFIG_PERF_EVENTS stubs that fall back to perfmon_capable(),
so the helpers stay callable when perf is compiled out.

Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patch.msgid.link/20260527225507.2044027-2-ashutosh.dixit@intel.com
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2026-05-28 08:19:36 -07:00
..
callchain.c perf: sched: Fix perf crash with new is_user_task() helper 2026-01-30 23:06:07 +01:00
core.c perf/core: out-of-line and export perf_allow_cpu/tracepoint() 2026-05-28 08:19:36 -07:00
hw_breakpoint_test.c perf/hw_breakpoint: remove MODULE_LICENSE in non-modules 2023-04-13 13:13:52 -07:00
hw_breakpoint.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
internal.h perf: Convert mmap() refcounts to refcount_t 2025-08-15 13:13:02 +02:00
Makefile perf/hw_breakpoint: Add KUnit test for constraints accounting 2022-08-30 10:56:20 +02:00
ring_buffer.c treewide: Update email address 2026-01-11 06:09:11 -10:00
uprobes.c treewide: change inode->i_ino from unsigned long to u64 2026-03-06 14:31:28 +01:00