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
)
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
)
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
);