Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / tools / perf / arch / arm64 / util / mem-events.c
blob2a24973726712c0697a6a8319ac615b32fd1cd59
1 // SPDX-License-Identifier: GPL-2.0
2 #include "map_symbol.h"
3 #include "mem-events.h"
5 #define E(t, n, s) { .tag = t, .name = n, .sysfs_name = s }
7 static struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX] = {
8 E("spe-load", "arm_spe_0/ts_enable=1,load_filter=1,store_filter=0,min_latency=%u/", "arm_spe_0"),
9 E("spe-store", "arm_spe_0/ts_enable=1,load_filter=0,store_filter=1/", "arm_spe_0"),
10 E("spe-ldst", "arm_spe_0/ts_enable=1,load_filter=1,store_filter=1,min_latency=%u/", "arm_spe_0"),
13 static char mem_ev_name[100];
15 struct perf_mem_event *perf_mem_events__ptr(int i)
17 if (i >= PERF_MEM_EVENTS__MAX)
18 return NULL;
20 return &perf_mem_events[i];
23 char *perf_mem_events__name(int i)
25 struct perf_mem_event *e = perf_mem_events__ptr(i);
27 if (i >= PERF_MEM_EVENTS__MAX)
28 return NULL;
30 if (i == PERF_MEM_EVENTS__LOAD || i == PERF_MEM_EVENTS__LOAD_STORE)
31 scnprintf(mem_ev_name, sizeof(mem_ev_name),
32 e->name, perf_mem_events__loads_ldlat);
33 else /* PERF_MEM_EVENTS__STORE */
34 scnprintf(mem_ev_name, sizeof(mem_ev_name), e->name);
36 return mem_ev_name;