You are not logged in.

#1 2019-09-05 18:24:22

martinus
Member
Registered: 2019-09-05
Posts: 3

[SOLVED] cannot change kernel.perf_event_max_sample_rate

It seems that for some reasons my kernel.perf_event_max_sample_rate is locked to 1. I cannot change this value at all.

As root, I just get "Invalid argument". whenever I want to change it.

# echo 100 > /proc/sys/kernel/perf_event_max_sample_rate 
bash: echo: write error: Invalid argument

When I try to record anything with "perf record", I get this warning:

Lowering default frequency rate to 1.
Please consider tweaking /proc/sys/kernel/perf_event_max_sample_rate.

I'm running kernel 5.2.11-1. Any ideas how I can increase this?

Last edited by martinus (2019-09-05 19:14:35)

Offline

#2 2019-09-05 18:56:02

seth
Member
Registered: 2012-09-03
Posts: 12,292

Re: [SOLVED] cannot change kernel.perf_event_max_sample_rate

Actual value and value of perf_cpu_time_max_percent?
https://stackoverflow.com/questions/484 … ample-rate

Offline

#3 2019-09-05 19:00:21

martinus
Member
Registered: 2019-09-05
Posts: 3

Re: [SOLVED] cannot change kernel.perf_event_max_sample_rate

kernel.perf_cpu_time_max_percent already is at 0:

sudo sysctl -a |grep perf
kernel.perf_cpu_time_max_percent = 0
kernel.perf_event_max_contexts_per_stack = 8
kernel.perf_event_max_sample_rate = 1
kernel.perf_event_max_stack = 127
kernel.perf_event_mlock_kb = 516
kernel.perf_event_paranoid = -1

Offline

#4 2019-09-05 19:05:29

seth
Member
Registered: 2012-09-03
Posts: 12,292

Re: [SOLVED] cannot change kernel.perf_event_max_sample_rate

Can you manipulate the value if you re-enable the monitoring?

Offline

#5 2019-09-05 19:13:54

martinus
Member
Registered: 2019-09-05
Posts: 3

Re: [SOLVED] cannot change kernel.perf_event_max_sample_rate

Ahhh, when I set kernel.perf_cpu_time_max_percent to any other value than 0 I can change kernel.perf_event_max_sample_rate. So this works:

sysctl -w kernel.perf_cpu_time_max_percent=1
sysctl -w kernel.perf_event_max_sample_rate=10000

Thanks!

Offline

Board footer

Powered by FluxBB