Skip to contentSkip to conversation

perf sleep time profiling: no sched_stat_sleep events?

DISCUSSION Milian Wolff 1 participant 1 message Aug 12, 2016

lore
Share & tools
lore
#0 lore raw

Hey all,

sending this here in the hope that it may guide people in avoiding this issue in the future:

I have encountered an issue with a recent Arch Linux Kernel (4.7), where the the perf script to profile sleep times did not produce any output.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
perf top -e "sched:sched_stat_*"

# wait for some time
0 sched:sched_stat_wait
0 sched:sched_stat_sleep
0 sched:sched_stat_iowait
0 sched:sched_stat_blocked
4K sched:sched_stat_runtime  

~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The culprit is

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cat /proc/sys/kernel/sched_schedstats
0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Setting that to 1 enables the sched_stat trace points and makes the script work again as needed.

I wonder: Could perf print a warning when the user tries to trace these events but they are not enabled?

Thanks

Signature · 4 lines
Milian Wolff | [email protected] | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts