• Leo Yan's avatar
    perf mem: Support new memory event PERF_MEM_EVENTS__LOAD_STORE · 4ba2452c
    Leo Yan authored
    On the architectures with perf memory profiling, two types of hardware
    events have been supported: load and store; if want to profile memory
    for both load and store operations, the tool will use these two events
    at the same time, the usage is:
    
      # perf mem record -t load,store -- uname
    
    But this cannot be applied for AUX tracing event, the same PMU event can
    be used to only trace memory load, or only memory store, or trace for
    both memory load and store.
    
    This patch introduces a new event PERF_MEM_EVENTS__LOAD_STORE, which is
    used to support the event which can record both memory load and store
    operations.
    
    When user specifies memory operation type as 'load,store', or doesn't
    set type so use 'load,store' as default, if the arch supports the event
    PERF_MEM_EVENTS__LOAD_STORE, the tool will convert the required
    operations to this single event; otherwise, if the arch doesn't support
    PERF_MEM_EVENTS__LOAD_STORE, the tool rolls back to enable both events
    PERF_MEM_EVENTS__LOAD and PERF_MEM_EVENTS__STORE, which keeps the same
    behaviour with before.
    Signed-off-by: default avatarLeo Yan <leo.yan@linaro.org>
    Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
    Link: https://lore.kernel.org/r/20201106094853.21082-4-leo.yan@linaro.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    4ba2452c
mem-events.h 3.05 KB