I am trying to use perf for profiling in a Linux virtual machine. However, I am receiving the following output:
[vagrant@localhost ~]$ perf stat -d ls / bin boot dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv sys tmp usr vagrant var Performance counter stats for 'ls /': 1.063002 task-clock (msec) # 0.408 CPUs utilized 13 context-switches # 0.012 M/sec 0 cpu-migrations # 0.000 K/sec 101 page-faults # 0.095 M/sec <not supported> cycles <not supported> instructions <not supported> branches <not supported> branch-misses <not supported> L1-dcache-loads <not supported> L1-dcache-load-misses <not supported> LLC-loads <not supported> LLC-load-misses 0.002608020 seconds time elapsed
Many of the interesting values seem not to be supported. I have tried this on both kvm and virtualbox guests with the virtualbox guests tried on both Linux and Mac OS. My online readings suggest that perf is supported inside kvm guests. So this is really puzzling me. What could be going wrong?