Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf test: Add pmu-event test for "Compat" and new event_field.

Add new event test for uncore system event which is used to verify the
functionality of "Compat" matching multiple identifiers and the new event
fields "EventidCode" and "NodeType".

Signed-off-by: Jing Zhang <renyu.zj@linux.alibaba.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Tested-by: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Shuai Xue <xueshuai@linux.alibaba.com>
Cc: Zhuo Song <zhuo.song@linux.alibaba.com>
Cc: John Garry <john.g.garry@oracle.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-doc@vger.kernel.org
Link: https://lore.kernel.org/r/1695794391-34817-6-git-send-email-renyu.zj@linux.alibaba.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Jing Zhang and committed by
Namhyung Kim
7fded33c 3bb59e75

+71
+8
tools/perf/pmu-events/arch/test/test_soc/sys/uncore.json
··· 12 12 "EventName": "sys_ccn_pmu.read_cycles", 13 13 "Unit": "sys_ccn_pmu", 14 14 "Compat": "0x01" 15 + }, 16 + { 17 + "BriefDescription": "Counts total cache misses in first lookup result (high priority)", 18 + "EventidCode": "0x1", 19 + "NodeType": "0x5", 20 + "EventName": "sys_cmn_pmu.hnf_cache_miss", 21 + "Unit": "sys_cmn_pmu", 22 + "Compat": "(434|436|43c|43a).*" 15 23 } 16 24 ]
+8
tools/perf/pmu-events/empty-pmu-events.c
··· 245 245 .pmu = "uncore_sys_ccn_pmu", 246 246 }, 247 247 { 248 + .name = "sys_cmn_pmu.hnf_cache_miss", 249 + .event = "eventid=0x1,type=0x5", 250 + .desc = "Counts total cache misses in first lookup result (high priority). Unit: uncore_sys_cmn_pmu ", 251 + .compat = "(434|436|43c|43a).*", 252 + .topic = "uncore", 253 + .pmu = "uncore_sys_cmn_pmu", 254 + }, 255 + { 248 256 .name = 0, 249 257 .event = 0, 250 258 .desc = 0,
+55
tools/perf/tests/pmu-events.c
··· 262 262 .matching_pmu = "uncore_sys_ccn_pmu4", 263 263 }; 264 264 265 + static const struct perf_pmu_test_event sys_cmn_pmu_hnf_cache_miss = { 266 + .event = { 267 + .name = "sys_cmn_pmu.hnf_cache_miss", 268 + .event = "eventid=0x1,type=0x5", 269 + .desc = "Counts total cache misses in first lookup result (high priority)", 270 + .topic = "uncore", 271 + .pmu = "uncore_sys_cmn_pmu", 272 + .compat = "(434|436|43c|43a).*", 273 + }, 274 + .alias_str = "eventid=0x1,type=0x5", 275 + .alias_long_desc = "Counts total cache misses in first lookup result (high priority)", 276 + .matching_pmu = "uncore_sys_cmn_pmu0", 277 + }; 278 + 265 279 static const struct perf_pmu_test_event *sys_events[] = { 266 280 &sys_ddr_pmu_write_cycles, 267 281 &sys_ccn_pmu_read_cycles, 282 + &sys_cmn_pmu_hnf_cache_miss, 268 283 NULL 269 284 }; 270 285 ··· 722 707 &sys_ccn_pmu_read_cycles, 723 708 }, 724 709 }, 710 + { 711 + .pmu = { 712 + .name = (char *)"uncore_sys_cmn_pmu0", 713 + .is_uncore = 1, 714 + .id = (char *)"43401", 715 + }, 716 + .aliases = { 717 + &sys_cmn_pmu_hnf_cache_miss, 718 + }, 719 + }, 720 + { 721 + .pmu = { 722 + .name = (char *)"uncore_sys_cmn_pmu0", 723 + .is_uncore = 1, 724 + .id = (char *)"43602", 725 + }, 726 + .aliases = { 727 + &sys_cmn_pmu_hnf_cache_miss, 728 + }, 729 + }, 730 + { 731 + .pmu = { 732 + .name = (char *)"uncore_sys_cmn_pmu0", 733 + .is_uncore = 1, 734 + .id = (char *)"43c03", 735 + }, 736 + .aliases = { 737 + &sys_cmn_pmu_hnf_cache_miss, 738 + }, 739 + }, 740 + { 741 + .pmu = { 742 + .name = (char *)"uncore_sys_cmn_pmu0", 743 + .is_uncore = 1, 744 + .id = (char *)"43a01", 745 + }, 746 + .aliases = { 747 + &sys_cmn_pmu_hnf_cache_miss, 748 + }, 749 + } 725 750 }; 726 751 727 752 /* Test that aliases generated are as expected */