Re: [PATCH] perf/core: Add macros for possible sysctl_perf_event_paranoid values

From: Ian Rogers
Date: Mon Jul 11 2022 - 12:16:49 EST

On Mon, Jul 11, 2022 at 5:19 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Mon, Jul 11, 2022 at 02:55:12PM +0530, Anshuman Khandual wrote:
> > Enumerating [-1, 0, 1, 2] paranoid range values in kernel too, does not add
> > much value as well ?
> That's what the user-interface requires as well. How is obscuring the
> values the user has to explicitly poke in help things?

Perhaps a helper function like ParanoidAndNotRoot that takes the
failing paranoia level such as here:
would help clean this up. Perhaps something that explicitly calls out
this is a permissions check. Cleaning up permission checking seems
like useful value add. We've been trying to do something similar in
tests to make them skip rather than fail due to permission issues -
this should increase the signal perf test gives.