I am trying to profile an application inside an Azure VM (Ubuntu 18.04) using the perf. But the perf stats doesn't provide all the statistics.
Performance counter stats for 'ls':
0.78 msec task-clock # 0.760 CPUs utilized
1 context-switches # 0.001 M/sec
0 cpu-migrations # 0.000 K/sec
106 page-faults # 0.135 M/sec
<not supported> cycles
<not supported> instructions
<not supported> branches
<not supported> branch-misses
0.001031061 seconds time elapsed
0.001016000 seconds user
0.000000000 seconds sys
And, also the perf list
doesn't list any hardware events.
List of pre-defined events (to be used in -e):
alignment-faults [Software event]
bpf-output [Software event]
context-switches OR cs [Software event]
cpu-clock [Software event]
cpu-migrations OR migrations [Software event]
dummy [Software event]
emulation-faults [Software event]
major-faults [Software event]
minor-faults [Software event]
page-faults OR faults [Software event]
task-clock [Software event]
duration_time [Tool event]
msr/pperf/ [Kernel PMU event]
msr/smi/ [Kernel PMU event]
msr/tsc/ [Kernel PMU event]
rNNN [Raw hardware event descriptor]
cpu/t1=v1[,t2=v2,t3 ...]/modifier [Raw hardware event descriptor]
I read that the CPU performance counters are not enabled for the VMs source.
Is it possible to enable the hardware events in Azure VM? or is there any other way to find the instructions used while executing an application?