+ // Most sysctls require an access check, but a few are public.
+ switch( (uintptr_t) arg1 ) {
+ case REQ_CLASSES:
+ case REQ_CONFIG_COUNT:
+ case REQ_COUNTER_COUNT:
+ // These read-only sysctls are public.
+ break;
+
+ default:
+ // Require kperf access to read or write anything else.
+ // This is either root or the blessed pid.
+ ret = kperf_access_check();
+ if (ret) {
+ return ret;
+ }
+ break;
+ }
+