Skip to content

perf: memory load/store events generalization

Lin Ming lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 32 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4perf: Add memory load/store events generic codeinclude/linux/perf_event.h kernel/events/core.c+55 -119 replies
2/4perf, x86: Add Intel Nhm/Wsm/Snb load latency supportarch/x86/include/asm/msr-index.h arch/x86/kernel/cpu/perf_event.c arch/x86/kernel/cpu/perf_event_intel.c +1 more+76 -53 replies
3/4perf, x86: Add Intel SandyBridge pricise store supportarch/x86/kernel/cpu/perf_event_intel.c arch/x86/kernel/cpu/perf_event_intel_ds.c+32 -13 replies
4/4perf, tool: Add new command "perf mem"tools/perf/Makefile tools/perf/builtin-record.c tools/perf/builtin-script.c +6 more+61 -102 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] perf: memory load/store events generalization

Hi, all

Intel PMU provides 2 facilities to monitor memory operation: load latency and precise store. This patchset tries to generalize memory load/store events.
So other arches may also add such features.

A new sub-command "mem" is added,

$ perf mem

usage: perf mem [<options>] {record <command> |report}

    -t, --type <type>     memory operations(load/store)
    -L, --latency <n>     latency to sample(only for load op)
$ perf mem -t load record make -j8

<building kernel ..., monitoring memory load opeartion>

$ perf mem -t load report

Memory load operation statistics
================================

                      L1-local: total latency=   28027, count=    3355(avg=8)
                      L2-snoop: total latency=    1430, count=      29(avg=49)
                      L2-local: total latency=     124, count=       8(avg=15)
             L3-snoop, found M: total latency=     452, count=       4(avg=113)
          L3-snoop, found no M: total latency=       0, count=       0(avg=0)
L3-snoop, no coherency actions: total latency=     875, count=      18(avg=48)
        L3-miss, snoop, shared: total latency=       0, count=       0(avg=0)
     L3-miss, local, exclusive: total latency=       0, count=       0(avg=0)
        L3-miss, local, shared: total latency=       0, count=       0(avg=0)
    L3-miss, remote, exclusive: total latency=       0, count=       0(avg=0)
       L3-miss, remote, shared: total latency=       0, count=       0(avg=0)
                    Unknown L3: total latency=       0, count=       0(avg=0)
                            IO: total latency=       0, count=       0(avg=0)

Uncached: total latency= 464, count= 30(avg=15)

$ perf mem -t store record make -j8

<building kernel ..., monitoring memory store opeartion>

$ perf mem -t store report

Memory store operation statistics
=================================
data-cache hit: 8138
data-cache miss: 0
STLB hit: 8138
STLB miss: 0
Locked access: 0
Unlocked access: 8138

Any comment is appreciated.

Thanks,
Lin Ming