perf test: Add pmu-events test for aliases with hyphens
authorJohn Garry <john.garry@huawei.com>
Mon, 17 Jan 2022 15:10:14 +0000 (23:10 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 22 Jan 2022 20:21:29 +0000 (17:21 -0300)
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 <john.garry@huawei.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Qi Liu <liuqi115@huawei.com>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: linuxarm@huawei.com
Link: https://lore.kernel.org/r/1642432215-234089-3-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/pmu-events/arch/test/test_soc/cpu/uncore.json
tools/perf/tests/pmu-events.c

index 73089c682f8032ae31ede885ca2bf1c4656ed256..41bac1c6a00800955ca280cfc714a090437d2035 100644 (file)
            "Invert": "0",
            "EdgeDetect": "0"
   },
+  {
+           "Unit": "CBO",
+           "EventCode": "0xE0",
+           "UMask": "0x00",
+           "EventName": "event-hyphen",
+           "BriefDescription": "UNC_CBO_HYPHEN",
+           "PublicDescription": "UNC_CBO_HYPHEN"
+  },
+  {
+           "Unit": "CBO",
+           "EventCode": "0xC0",
+           "UMask": "0x00",
+           "EventName": "event-two-hyph",
+           "BriefDescription": "UNC_CBO_TWO_HYPH",
+           "PublicDescription": "UNC_CBO_TWO_HYPH"
+  },
   {
            "EventCode": "0x7",
            "EventName": "uncore_hisi_l3c.rd_hit_cpipe",
index df1c9a3cc05bf31cfaae253af62f0aa47e6dbc8b..1c695fb5a79c63ff33ee27f1b8dde0a932478294 100644 (file)
@@ -143,6 +143,34 @@ static const struct perf_pmu_test_event unc_cbo_xsnp_response_miss_eviction = {
        .matching_pmu = "uncore_cbox_0",
 };
 
+static const struct perf_pmu_test_event uncore_hyphen = {
+       .event = {
+               .name = "event-hyphen",
+               .event = "umask=0x00,event=0xe0",
+               .desc = "Unit: uncore_cbox UNC_CBO_HYPHEN",
+               .topic = "uncore",
+               .long_desc = "UNC_CBO_HYPHEN",
+               .pmu = "uncore_cbox",
+       },
+       .alias_str = "umask=0,event=0xe0",
+       .alias_long_desc = "UNC_CBO_HYPHEN",
+       .matching_pmu = "uncore_cbox_0",
+};
+
+static const struct perf_pmu_test_event uncore_two_hyph = {
+       .event = {
+               .name = "event-two-hyph",
+               .event = "umask=0x00,event=0xc0",
+               .desc = "Unit: uncore_cbox UNC_CBO_TWO_HYPH",
+               .topic = "uncore",
+               .long_desc = "UNC_CBO_TWO_HYPH",
+               .pmu = "uncore_cbox",
+       },
+       .alias_str = "umask=0,event=0xc0",
+       .alias_long_desc = "UNC_CBO_TWO_HYPH",
+       .matching_pmu = "uncore_cbox_0",
+};
+
 static const struct perf_pmu_test_event uncore_hisi_l3c_rd_hit_cpipe = {
        .event = {
                .name = "uncore_hisi_l3c.rd_hit_cpipe",
@@ -188,6 +216,8 @@ static const struct perf_pmu_test_event uncore_imc_cache_hits = {
 static const struct perf_pmu_test_event *uncore_events[] = {
        &uncore_hisi_ddrc_flux_wcmd,
        &unc_cbo_xsnp_response_miss_eviction,
+       &uncore_hyphen,
+       &uncore_two_hyph,
        &uncore_hisi_l3c_rd_hit_cpipe,
        &uncore_imc_free_running_cache_miss,
        &uncore_imc_cache_hits,
@@ -654,6 +684,8 @@ static struct perf_pmu_test_pmu test_pmus[] = {
                },
                .aliases = {
                        &unc_cbo_xsnp_response_miss_eviction,
+                       &uncore_hyphen,
+                       &uncore_two_hyph,
                },
        },
        {