Linaro / benchmark_harness

Harness to run benchmarks with options for different machines and different compilers
Apache License 2.0
2 stars 3 forks source link

Perf behaviour without proper CAP_SYS_ADMIN #24

Open BaptisteGerondeau opened 6 years ago

BaptisteGerondeau commented 6 years ago

Following the hacking session at Linaro's YVR18 Connect, some issues have come up with perf behaviour, especially when the perf_event_paranoid counter in /proc/sys/kernel/ is not correctly set to x < 2.

First of all, error message on CAP_SYS_ADMIN should mention the path to the file.

Second, it might be a good idea to disable perf in the event that the file is not set correctly : root privileges are necessary to touch that file. A warning would be displayed, and the .err file would be empty.

rengolin commented 6 years ago

The required CAP_SYS_ADMIN is { x <= 2 }, but yeah, I agree with the described behaviour.

There should not be an error message, just a warning, easily mentioning how to fix it and root permissions, and just running the benchmark with Execute instead of Perf. This should be simple and restricted to the controller.

We could also think about a flag that would, in case we're running as root or have passwrodless sudo, set the flag to 2 then back (like we do in the Ansible dispatcher from Jenkins). This second part is more complex and I'm happy for that to be a separate, much less important, issue.

rengolin commented 5 years ago

Commit ad0c2b8 handles the first part: nicer messages.

Making that into a warning will need us to accept text as benchmark results, or plug the benchmark parser and only use output not perf results, as well.