Skip to content

Commit 34fa67e

Browse files
John Garryacmel
authored andcommitted
perf test: Add pmu-events test for aliases with hyphens
Add a test for aliases with hyphens in the name to ensure that the pmu-events tables are as expects. There should be no reason why these sort of aliases would be treated differently, but no harm in checking. Signed-off-by: John Garry <[email protected]> Acked-by: Ian Rogers <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kajol Jain <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Qi Liu <[email protected]> Cc: Shaokun Zhang <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 864bc8c commit 34fa67e

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

tools/perf/pmu-events/arch/test/test_soc/cpu/uncore.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@
1818
"Invert": "0",
1919
"EdgeDetect": "0"
2020
},
21+
{
22+
"Unit": "CBO",
23+
"EventCode": "0xE0",
24+
"UMask": "0x00",
25+
"EventName": "event-hyphen",
26+
"BriefDescription": "UNC_CBO_HYPHEN",
27+
"PublicDescription": "UNC_CBO_HYPHEN"
28+
},
29+
{
30+
"Unit": "CBO",
31+
"EventCode": "0xC0",
32+
"UMask": "0x00",
33+
"EventName": "event-two-hyph",
34+
"BriefDescription": "UNC_CBO_TWO_HYPH",
35+
"PublicDescription": "UNC_CBO_TWO_HYPH"
36+
},
2137
{
2238
"EventCode": "0x7",
2339
"EventName": "uncore_hisi_l3c.rd_hit_cpipe",

tools/perf/tests/pmu-events.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,34 @@ static const struct perf_pmu_test_event unc_cbo_xsnp_response_miss_eviction = {
143143
.matching_pmu = "uncore_cbox_0",
144144
};
145145

146+
static const struct perf_pmu_test_event uncore_hyphen = {
147+
.event = {
148+
.name = "event-hyphen",
149+
.event = "umask=0x00,event=0xe0",
150+
.desc = "Unit: uncore_cbox UNC_CBO_HYPHEN",
151+
.topic = "uncore",
152+
.long_desc = "UNC_CBO_HYPHEN",
153+
.pmu = "uncore_cbox",
154+
},
155+
.alias_str = "umask=0,event=0xe0",
156+
.alias_long_desc = "UNC_CBO_HYPHEN",
157+
.matching_pmu = "uncore_cbox_0",
158+
};
159+
160+
static const struct perf_pmu_test_event uncore_two_hyph = {
161+
.event = {
162+
.name = "event-two-hyph",
163+
.event = "umask=0x00,event=0xc0",
164+
.desc = "Unit: uncore_cbox UNC_CBO_TWO_HYPH",
165+
.topic = "uncore",
166+
.long_desc = "UNC_CBO_TWO_HYPH",
167+
.pmu = "uncore_cbox",
168+
},
169+
.alias_str = "umask=0,event=0xc0",
170+
.alias_long_desc = "UNC_CBO_TWO_HYPH",
171+
.matching_pmu = "uncore_cbox_0",
172+
};
173+
146174
static const struct perf_pmu_test_event uncore_hisi_l3c_rd_hit_cpipe = {
147175
.event = {
148176
.name = "uncore_hisi_l3c.rd_hit_cpipe",
@@ -188,6 +216,8 @@ static const struct perf_pmu_test_event uncore_imc_cache_hits = {
188216
static const struct perf_pmu_test_event *uncore_events[] = {
189217
&uncore_hisi_ddrc_flux_wcmd,
190218
&unc_cbo_xsnp_response_miss_eviction,
219+
&uncore_hyphen,
220+
&uncore_two_hyph,
191221
&uncore_hisi_l3c_rd_hit_cpipe,
192222
&uncore_imc_free_running_cache_miss,
193223
&uncore_imc_cache_hits,
@@ -654,6 +684,8 @@ static struct perf_pmu_test_pmu test_pmus[] = {
654684
},
655685
.aliases = {
656686
&unc_cbo_xsnp_response_miss_eviction,
687+
&uncore_hyphen,
688+
&uncore_two_hyph,
657689
},
658690
},
659691
{

0 commit comments

Comments
 (0)