Notes on Perf and Pmutools

This are some experiences working on Perf. The post will be continuously updated.

 

Useful perf (pmu tools) options

  1. Perf stat
    1. report counters of certain events.
  2. Perf stat -e  event  -I 1000  ./app
    1. (print stat interactively)
    2. -I 1000 (interactive with interval of 1s) is extremely helpful in cases where you just want to do sampling on a part of a program
  3. Perf record -e cycles:pp ./app
    1. sampling on everyline
  4. Perf top
    1. useful if current program is stuck somewhere

Useful perf (pmutools)  events

  1. Cycles spend on each line
    1. cycles:pp
    2. the fastest way to pinpoint a bottleneck to a specific line
  2. Cycles stalled on memory
    1. cycle_activity_stalls.l2_pending
    2. cycle_activity_stalls.1d_pending
    3. cycle_activity_stalls.ldm_pending
    4. measuring weather the application is bottlenecked at memory access
  3. Cycles stalled (no execution)
    1. cycle_activity_cycles_no_execute
    2. a ballpark on how much you are not utilizing the processor, often combined with “cycles” measurement
  4. Cycles per instruction (CPI)
  5. MLP (memory level parallelism)
    1. Combine with stat
    2. l1d_pend_miss.pending/l1d_pend_miss.pending_cycles

      1. first one measures how many misses are pending within a certain period of time
      2. second one measures within that period of sampling time, how many cycles have at least one pending misses
      3. the division gives a rough estimate on how MLP at every cycle
      4. a good indicator on how well you are using the memory system. A low MLP indicates really bad memory utilization
  6. Memory bandwidth
    1. see the post here https://yunmingzhang.wordpress.com/2015/10/02/use-pmu-tools-to-interactively-monitor-memory-bandwidth/
  7. Cache miss rates
Advertisements
This entry was posted in Tools, Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s