Linux – Understanding Perf tool output

linuxperfperf-eventprofiling

I recently installed Perf tool On my platform and wanted to use it for profiling my platform.
I started profiling a standalone application. Below is the command I used:

   perf start ./helloworld

  Performance counter stats for './helloworld':

      4.555957 task-clock                #    0.000 CPUs utilized
             1 context-switches          #    0.219 K/sec
             0 cpu-migrations            #    0.000 K/sec
           124 page-faults               #    0.027 M/sec
           <not supported> cycles
           <not supported> stalled-cycles-frontend
           <not supported> stalled-cycles-backend
           <not supported> instructions
           <not supported> branches
           <not supported> branch-misses

           60.005519331 seconds time elapsed

Now I am not sure how should I interpretate this output.is it as expected?

Also, what should I make of <not supported> field here, is there anything I need to enable to support this field before running the command?

Best Answer

The "<not supported>" messages mean that your platform doesn't support some of the processor's performance monitoring unit (PMU) hardware counters, also called performance instrumentation counters (PICs), which perf uses. This typically happens in virtualized environments. On bare-metal, you should see these counters (unless you are on some exotic CPU type).

It may be fixable, if your virtualization software can enable hardware counters for its guests. For example, recent versions of VMware have such an option.

As for interpretation, if you can get the counters enabled, one of the most useful metrics this will print is the instructions per cycle (IPC), which is an indication of memory I/O, lower for more. This isn't present in your example, however, as your platform is missing the counters.

Related Question