Petter Reinholdtsen writes:

> [Lluís Vilanova]
>> The package currently fails to run its tests during build due to
>> insufficient permissions to access Linux's perf interface.

> Is there some way to figure out if such permissions are missing or not?

> On my machine, where the build work, the value of 
> /proc/sys/kernel/perf_event_paranoid is '1', so '0' is not required.

> I notice the autobuilders work, the ci.debian.org builders work, but the
> reproducable build builders do not.  No idea what the difference is.

I've rechecked, and things seem to be a bit different...

For some reason my kernel (4.7.0-1-amd64) ignores changes through the file
system. It's more reliable to use:

  /sbin/sysctl kernel.perf_event_paranoid
  sudo /sbin/sysctl kernel.perf_event_paranoid=<value>

Now, I've tried on a nother machine, and (strangely) the kernel starts with a
perf paranoid level of 3, which is not even documented as a valid value on
Linux's source code.

Getting it down to 2 is sufficient to run the check successfully.

A possible check could be:

  if [ `/sbin/sysctl kernel.perf_event_paranoid` -gt 2 ]; then
      echo "ERROR: perf is too paranoid for us"
      exit 1
  fi

This would build-depend on procps (which installs sysctl).

Cheers,
  Lluis

Reply via email to