Pages

Showing posts with label pref. Show all posts
Showing posts with label pref. Show all posts

Sunday, January 5, 2025

Fedora 41 : the pref tool under Fedora.

Today I tested the perf tool in Fedora 41 and it is a bit difficult to use. I documented myself and found some information on the web and in the online linux community. Here is what I thought was worth remembering and what I tested.
The pref tool can't run anyway:
mythcat@fedora:~/PythonProjects$ perf record -e cache-misses,page-faults,minor-faults,major-faults,cpu-migrations,L1-dcache-load-misses,L1-dcache-store-misses,L1-icache-load-misses,LLC-load-misses,LLC-store-misses,dTLB-load-misses,dTLB-store-misses,iTLB-load-misses
Error:
Access to performance monitoring and observability operations is limited.
Enforced MAC policy settings (SELinux) can limit access to performance
monitoring and observability operations. Inspect system audit records for
more perf_event access control information and adjusting the policy.
Consider adjusting /proc/sys/kernel/perf_event_paranoid setting to open
access to performance monitoring and observability operations for processes
without CAP_PERFMON, CAP_SYS_PTRACE or CAP_SYS_ADMIN Linux capability.
More information can be found at 'Perf events and tool security' document:
https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html
perf_event_paranoid setting is 2:
  -1: Allow use of (almost) all events by all users
      Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK
>= 0: Disallow raw and ftrace function tracepoint access
>= 1: Disallow CPU event access
>= 2: Disallow kernel profiling
To make the adjusted perf_event_paranoid setting permanent preserve ...
I used with sudo , wait and Ctrl + C to stop:
mythcat@fedora:~/PythonProjects$ sudo perf record -e cache-misses,page-faults,minor-faults,major-faults,cpu-migrations,L1-dcache-load-misses,L1-dcache-store-misses,L1-icache-load-misses,LLC-load-misses,LLC-store-misses,dTLB-load-misses,dTLB-store-misses,iTLB-load-misses ...
To get the accurate number of events count then number of results:
mythcat@fedora:~/PythonProjects$ perf report -D -i perf.data | grep RECORD_SAMPLE | wc -l
22461
I get my pref data and I saw all my system data with:
mythcat@fedora:~/PythonProjects$ sudo perf report -f -i perf.data