diff options
author | Jin Yao <yao.jin@linux.intel.com> | 2021-05-27 02:16:05 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2021-06-01 16:04:05 +0200 |
commit | a91ffcf30e0002e6f52d4c2cd9639443e514e88a (patch) | |
tree | 1490045c89df6167c0d7225e73468e86b2a1ed0f | |
parent | perf tools: Support pmu prefix for mem-load event (diff) | |
download | linux-a91ffcf30e0002e6f52d4c2cd9639443e514e88a.tar.xz linux-a91ffcf30e0002e6f52d4c2cd9639443e514e88a.zip |
perf tools: Support pmu prefix for mem-store event
For enabling mem-store event, it doesn't need an auxiliary event.
So just build an event name string with the pmu prefix.
Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210527001610.10553-4-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/arch/x86/util/mem-events.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/perf/arch/x86/util/mem-events.c b/tools/perf/arch/x86/util/mem-events.c index f9e444a4fe70..5214370ca4e4 100644 --- a/tools/perf/arch/x86/util/mem-events.c +++ b/tools/perf/arch/x86/util/mem-events.c @@ -5,6 +5,7 @@ static char mem_loads_name[100]; static bool mem_loads_name__init; +static char mem_stores_name[100]; #define MEM_LOADS_AUX 0x8203 #define MEM_LOADS_AUX_NAME "{%s/mem-loads-aux/,%s/mem-loads,ldlat=%u/}:P" @@ -13,7 +14,7 @@ static bool mem_loads_name__init; static struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX] = { E("ldlat-loads", "%s/mem-loads,ldlat=%u/P", "%s/events/mem-loads"), - E("ldlat-stores", "cpu/mem-stores/P", "cpu/events/mem-stores"), + E("ldlat-stores", "%s/mem-stores/P", "%s/events/mem-stores"), E(NULL, NULL, NULL), }; @@ -66,5 +67,14 @@ char *perf_mem_events__name(int i, char *pmu_name) return mem_loads_name; } + if (i == PERF_MEM_EVENTS__STORE) { + if (!pmu_name) + pmu_name = (char *)"cpu"; + + scnprintf(mem_stores_name, sizeof(mem_stores_name), + e->name, pmu_name); + return mem_stores_name; + } + return (char *)e->name; } |