rustyrazorblade / easy-cass-lab

Create Apache Cassandra lab environments in AWS
https://rustyrazorblade.com/
Other
11 stars 7 forks source link

ensure java has cap_perfmon capability #90

Closed rustyrazorblade closed 8 months ago

rustyrazorblade commented 8 months ago

In order to do off-cpu profiles we need to give all the java versions cap_perfmon:

CAP_PERFMON (since Linux 5.8)
              Employ various performance-monitoring mechanisms,
              including:

              •  call [perf_event_open(2)](https://man7.org/linux/man-pages/man2/perf_event_open.2.html);
              •  employ various BPF operations that have performance
                 implications.

              This capability was added in Linux 5.8 to separate out
              performance monitoring functionality from the overloaded
              CAP_SYS_ADMIN capability.  See also the kernel source file
              Documentation/admin-guide/perf-security.rst.

This should run on all java executables when setup_instance.sh is run:

setcap "cap_perfmon,cap_sys_ptrace,cap_syslog=ep" /usr/lib/jvm/java-11-openjdk-amd64/bin/java

More here: https://github.com/async-profiler/async-profiler/issues/907