Description of `timeout` option for `perf stat` says "Stop the perf stat session and print count deltas after N milliseconds". Unfortunately the session does not stop after the time expires. # Steps to reproduce 1. Run: perf stat --timeout 1000 sleep 1h 2. Wait a second. ## Expected As timeout option is set to 1000ms aka 1 second, a second later the command should return and print statistics. ## Actual Nothing happens.
So I reproduced the problem, in my testing only system wide mode is working: [root@five ~]# perf stat -e cycles --timeout 1000 -a Performance counter stats for 'system wide': 7,762,164,845 cycles 1.000529516 seconds time elapsed [root@five ~]# perf stat -e cycles --timeout 150 -a Performance counter stats for 'system wide': 1,291,118,172 cycles 0.150428442 seconds time elapsed [root@five ~]# I'll try to investigate and fix it, thanks for the report.
Created attachment 288499 [details] Fix for 'perf stat --timeout N workload-to-start'
Wow that was quick! Thank you!
:-) Can I take that as a: Tested-by: hi-angel@yandex.ru And add that to the patch, in addition to: Reported-by: hi-angel@yandex.ru And also your name to add there as well if possible? - Arnaldo
(In reply to Arnaldo Carvalho de Melo from comment #4) > :-) > > Can I take that as a: > > Tested-by: hi-angel@yandex.ru > > And add that to the patch, in addition to: > > Reported-by: hi-angel@yandex.ru > > And also your name to add there as well if possible? > > - Arnaldo Sounds great, though I gotta need some time. I will test it in a few hours!
(In reply to Arnaldo Carvalho de Melo from comment #4) > :-) > > Can I take that as a: > > Tested-by: hi-angel@yandex.ru > > And add that to the patch, in addition to: > > Reported-by: hi-angel@yandex.ru > > And also your name to add there as well if possible? > > - Arnaldo Thank you, I tested it, works for me. I replied on the ML