driver inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I63VF5
--------------------------------------------------------------------------
Add a test for aliases of hip09 ddrc pmu to ensure that the pmu-events tables are as expects.
Signed-off-by: Qi Liu liuqi115@huawei.com Signed-off-by: Junhao He hejunhao3@huawei.com --- .../arch/test/test_soc/sys/uncore.json | 8 ++++++ tools/perf/tests/pmu-events.c | 26 +++++++++++++++++++ 2 files changed, 34 insertions(+)
diff --git a/tools/perf/pmu-events/arch/test/test_soc/sys/uncore.json b/tools/perf/pmu-events/arch/test/test_soc/sys/uncore.json index 0f681a6e10ea..bfe4ea8b46fc 100644 --- a/tools/perf/pmu-events/arch/test/test_soc/sys/uncore.json +++ b/tools/perf/pmu-events/arch/test/test_soc/sys/uncore.json @@ -6,4 +6,12 @@ "Unit": "sys_ddr_pmu", "Compat": "v8" }, + { + "EventCode": "0x84", + "EventName": "sys_hisi_ddrc.flux_rd", + "BriefDescription": "DDRC read commands", + "PublicDescription": "DDRC read commands", + "Unit": "sys_hisi_ddrc", + "Compat": "hip09" + } ] diff --git a/tools/perf/tests/pmu-events.c b/tools/perf/tests/pmu-events.c index b53e3ed68e0a..a2b5879201ad 100644 --- a/tools/perf/tests/pmu-events.c +++ b/tools/perf/tests/pmu-events.c @@ -206,8 +206,24 @@ static const struct perf_pmu_test_event sys_ddr_pmu_write_cycles = { .matching_pmu = "uncore_sys_ddr_pmu", };
+static const struct perf_pmu_test_event sys_hisi_ddrc_flux_rd = { + .event = { + .name = "sys_hisi_ddrc.flux_rd", + .event = "event=0x84", + .desc = "DDRC read commands. Unit: uncore_sys_hisi_ddrc ", + .topic = "uncore", + .long_desc = "DDRC read commands", + .pmu = "uncore_sys_hisi_ddrc", + .compat = "hip09", + }, + .alias_str = "event=0x84", + .alias_long_desc = "DDRC read commands", + .matching_pmu = "uncore_sys_hisi_ddrc_0", +}; + static const struct perf_pmu_test_event *sys_events[] = { &sys_ddr_pmu_write_cycles, + &sys_hisi_ddrc_flux_rd, NULL };
@@ -675,6 +691,16 @@ static struct perf_pmu_test_pmu test_pmus[] = { &sys_ddr_pmu_write_cycles, }, }, + { + .pmu = { + .name = (char *)"uncore_sys_hisi_ddrc_0", + .is_uncore = 1, + .id = (char *)"hip09", + }, + .aliases = { + &sys_hisi_ddrc_flux_rd, + }, + }, };
/* Test that aliases generated are as expected */