Score:1

perf-stat does not work for 1ms time interval

de flag

I am using Ubuntu 18.04 and running the perf stat command to get some information on various hardware events for an application. I notice on doing sudo perf stat --interval-print 1, I get an error saying print interval must be >= 10ms. However, in the Ubuntu and Linux manual pages (https://man7.org/linux/man-pages/man1/perf-stat.1.html), it mentions that the minimum for interval-print is 1ms. By doing uname -r I get my kernel version as: 4.15.0-158-generic and I have installed the tool following the instructions here: https://askubuntu.com/a/578618/1000263.

Any help on how I can run the perf stat command for an interval time of 1 ms on my machine will be really helpful and appreciated. Please let me know if further information is required.

Score:1
ng flag

Welcome to Ask Ubuntu, actually it is 10ms in 18.04 and changed afterward (In or before 20.04).

I checked on on source package of Linux kernel 5.4, man page of perf-stat mention 1ms. So you will able to set interval to 1ms if kernel is upgraded to version 5 (like: linux-generic-hwe-18.04).

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.