OSDN Git Service

perf test: Add pmu-event test for event described as "config="
authorJohn Garry <john.garry@huawei.com>
Thu, 16 Sep 2021 12:34:24 +0000 (20:34 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 28 Sep 2021 19:15:15 +0000 (16:15 -0300)
Add a new test event for a system event whose event member is in form
"config=".

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: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Cc: liuqi115@huawei.com
Link: https://lore.kernel.org/r/1631795665-240946-5-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/sys/uncore.json
tools/perf/tests/pmu-events.c

index 0f681a6..c7e7528 100644 (file)
@@ -6,4 +6,11 @@
            "Unit": "sys_ddr_pmu",
            "Compat": "v8"
    },
+   {
+           "BriefDescription": "ccn read-cycles event",
+           "ConfigCode": "0x2c",
+           "EventName": "sys_ccn_pmu.read_cycles",
+           "Unit": "sys_ccn_pmu",
+           "Compat": "0x01"
+   }
 ]
index adfc17f..f14266a 100644 (file)
@@ -208,8 +208,23 @@ 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_ccn_pmu_read_cycles = {
+       .event = {
+               .name = "sys_ccn_pmu.read_cycles",
+               .event = "config=0x2c",
+               .desc = "ccn read-cycles event. Unit: uncore_sys_ccn_pmu ",
+               .topic = "uncore",
+               .pmu = "uncore_sys_ccn_pmu",
+               .compat = "0x01",
+       },
+       .alias_str = "config=0x2c",
+       .alias_long_desc = "ccn read-cycles event. Unit: uncore_sys_ccn_pmu ",
+       .matching_pmu = "uncore_sys_ccn_pmu",
+};
+
 static const struct perf_pmu_test_event *sys_events[] = {
        &sys_ddr_pmu_write_cycles,
+       &sys_ccn_pmu_read_cycles,
        NULL
 };
 
@@ -677,6 +692,16 @@ static struct perf_pmu_test_pmu test_pmus[] = {
                        &sys_ddr_pmu_write_cycles,
                },
        },
+       {
+               .pmu = {
+                       .name = (char *)"uncore_sys_ccn_pmu4",
+                       .is_uncore = 1,
+                       .id = (char *)"0x01",
+               },
+               .aliases = {
+                       &sys_ccn_pmu_read_cycles,
+               },
+       },
 };
 
 /* Test that aliases generated are as expected */