diff -drupN a/include/linux/perf_event.h b/include/linux/perf_event.h
--- a/include/linux/perf_event.h	2018-08-06 17:23:04.000000000 +0300
+++ b/include/linux/perf_event.h	2022-06-12 05:28:14.000000000 +0300
@@ -1168,6 +1168,11 @@ extern int perf_cpu_time_max_percent_han
 int perf_event_max_stack_handler(struct ctl_table *table, int write,
 				 void __user *buffer, size_t *lenp, loff_t *ppos);
 
+static inline bool perf_paranoid_any(void)
+{
+	return sysctl_perf_event_paranoid > 2;
+}
+
 static inline bool perf_paranoid_tracepoint_raw(void)
 {
 	return sysctl_perf_event_paranoid > -1;