linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] perf jevents: Use name for special find value
@ 2024-05-25  1:30 Ian Rogers
  2024-05-25  1:30 ` [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c Ian Rogers
  2024-05-28  9:55 ` [PATCH v2 1/2] perf jevents: Use name for special find value John Garry
  0 siblings, 2 replies; 15+ messages in thread
From: Ian Rogers @ 2024-05-25  1:30 UTC (permalink / raw)
  To: Weilin Wang, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Kan Liang, Jing Zhang, John Garry, Sandipan Das, linux-perf-users,
	linux-kernel

-1000 was used as a special value added in Commit 3d5045492ab2 ("perf
pmu-events: Add pmu_events_table__find_event()") to show that 1 table
lacked a PMU/event but that didn't terminate the search in other
tables. Add a new constant PMU_EVENTS__NOT_FOUND for this value and
use it.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/pmu-events/jevents.py   | 6 +++---
 tools/perf/pmu-events/pmu-events.h | 9 +++++++++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py
index e42efc16723e..7cc16ff96dc8 100755
--- a/tools/perf/pmu-events/jevents.py
+++ b/tools/perf/pmu-events/jevents.py
@@ -905,7 +905,7 @@ static int pmu_events_table__find_event_pmu(const struct pmu_events_table *table
   do_call:
                 return fn ? fn(&pe, table, data) : 0;
         }
-        return -1000;
+        return PMU_EVENTS__NOT_FOUND;
 }
 
 int pmu_events_table__for_each_event(const struct pmu_events_table *table,
@@ -943,10 +943,10 @@ int pmu_events_table__find_event(const struct pmu_events_table *table,
                         continue;
 
                 ret = pmu_events_table__find_event_pmu(table, table_pmu, name, fn, data);
-                if (ret != -1000)
+                if (ret != PMU_EVENTS__NOT_FOUND)
                         return ret;
         }
-        return -1000;
+        return PMU_EVENTS__NOT_FOUND;
 }
 
 size_t pmu_events_table__num_events(const struct pmu_events_table *table,
diff --git a/tools/perf/pmu-events/pmu-events.h b/tools/perf/pmu-events/pmu-events.h
index f5aa96f1685c..5435ad92180c 100644
--- a/tools/perf/pmu-events/pmu-events.h
+++ b/tools/perf/pmu-events/pmu-events.h
@@ -70,6 +70,8 @@ struct pmu_metric {
 struct pmu_events_table;
 struct pmu_metrics_table;
 
+#define PMU_EVENTS__NOT_FOUND -1000
+
 typedef int (*pmu_event_iter_fn)(const struct pmu_event *pe,
 				 const struct pmu_events_table *table,
 				 void *data);
@@ -82,6 +84,13 @@ int pmu_events_table__for_each_event(const struct pmu_events_table *table,
 				    struct perf_pmu *pmu,
 				    pmu_event_iter_fn fn,
 				    void *data);
+/*
+ * Search for table and entry matching with pmu__name_match. Each matching event
+ * has fn called on it. 0 implies to success/continue the search while non-zero
+ * means to terminate. The special value PMU_EVENTS__NOT_FOUND is used to
+ * indicate no event was found in one of the tables which doesn't terminate the
+ * search of all tables.
+ */
 int pmu_events_table__find_event(const struct pmu_events_table *table,
                                  struct perf_pmu *pmu,
                                  const char *name,
-- 
2.45.1.288.g0e0cd299f1-goog


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c
  2024-05-25  1:30 [PATCH v2 1/2] perf jevents: Use name for special find value Ian Rogers
@ 2024-05-25  1:30 ` Ian Rogers
  2024-05-28 10:00   ` John Garry
  2024-05-31  8:16   ` kernel test robot
  2024-05-28  9:55 ` [PATCH v2 1/2] perf jevents: Use name for special find value John Garry
  1 sibling, 2 replies; 15+ messages in thread
From: Ian Rogers @ 2024-05-25  1:30 UTC (permalink / raw)
  To: Weilin Wang, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Kan Liang, Jing Zhang, John Garry, Sandipan Das, linux-perf-users,
	linux-kernel

empty-pmu-events.c exists so that builds may occur without python
being installed on a system. Manually updating empty-pmu-events.c to
be in sync with jevents.py is a pain, let's use jevents.py to generate
empty-pmu-events.c.

1) change jevents.py so that an arch and model of none cause
   generation of a pmu-events.c without any json. Add a SPDX and
   autogenerated warning to the start of the file.

2) change Build so that if a generated pmu-events.c for arch none and
   model none doesn't match empty-pmu-events.c the build fails with a
   cat of the differences. Update Makefile.perf to clean up the files
   used for this.

3) update empty-pmu-events.c to match the output of jevents.py with
   arch and mode of none.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/Makefile.perf                 |   2 +
 tools/perf/pmu-events/Build              |  12 +-
 tools/perf/pmu-events/empty-pmu-events.c | 894 ++++++++++++++---------
 tools/perf/pmu-events/jevents.py         |   6 +-
 4 files changed, 562 insertions(+), 352 deletions(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 5c35c0d89306..4369c57a1d12 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -1210,6 +1210,8 @@ clean:: $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBSYMBOL)-clean $(
 		$(OUTPUT)util/intel-pt-decoder/inat-tables.c \
 		$(OUTPUT)tests/llvm-src-{base,kbuild,prologue,relocation}.c \
 		$(OUTPUT)pmu-events/pmu-events.c \
+		$(OUTPUT)pmu-events/test-empty-pmu-events.c \
+		$(OUTPUT)pmu-events/empty-pmu-events.log \
 		$(OUTPUT)pmu-events/metric_test.log \
 		$(OUTPUT)$(fadvise_advice_array) \
 		$(OUTPUT)$(fsconfig_arrays) \
diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
index 1d18bb89402e..c3fa43c49706 100644
--- a/tools/perf/pmu-events/Build
+++ b/tools/perf/pmu-events/Build
@@ -11,6 +11,8 @@ METRIC_TEST_PY	=  pmu-events/metric_test.py
 EMPTY_PMU_EVENTS_C = pmu-events/empty-pmu-events.c
 PMU_EVENTS_C	=  $(OUTPUT)pmu-events/pmu-events.c
 METRIC_TEST_LOG	=  $(OUTPUT)pmu-events/metric_test.log
+TEST_EMPTY_PMU_EVENTS_C = $(OUTPUT)pmu-events/test-empty-pmu-events.c
+EMPTY_PMU_EVENTS_TEST_LOG = $(OUTPUT)pmu-events/empty-pmu-events.log
 
 ifeq ($(JEVENTS_ARCH),)
 JEVENTS_ARCH=$(SRCARCH)
@@ -31,7 +33,15 @@ $(METRIC_TEST_LOG): $(METRIC_TEST_PY) $(METRIC_PY)
 	$(call rule_mkdir)
 	$(Q)$(call echo-cmd,test)$(PYTHON) $< 2> $@ || (cat $@ && false)
 
-$(PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(METRIC_TEST_LOG)
+$(TEST_EMPTY_PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(METRIC_TEST_LOG)
+	$(call rule_mkdir)
+	$(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) none none pmu-events/arch $@
+
+$(EMPTY_PMU_EVENTS_TEST_LOG): $(EMPTY_PMU_EVENTS_C) $(TEST_EMPTY_PMU_EVENTS_C)
+	$(call rule_mkdir)
+	$(Q)$(call echo-cmd,test)diff -u $? 2> $@ || (cat $@ && false)
+
+$(PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(METRIC_TEST_LOG) $(EMPTY_PMU_EVENTS_TEST_LOG)
 	$(call rule_mkdir)
 	$(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(JEVENTS_ARCH) $(JEVENTS_MODEL) pmu-events/arch $@
 endif
diff --git a/tools/perf/pmu-events/empty-pmu-events.c b/tools/perf/pmu-events/empty-pmu-events.c
index 13727421d424..c592079982fb 100644
--- a/tools/perf/pmu-events/empty-pmu-events.c
+++ b/tools/perf/pmu-events/empty-pmu-events.c
@@ -1,196 +1,193 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * An empty pmu-events.c file used when there is no architecture json files in
- * arch or when the jevents.py script cannot be run.
- *
- * The test cpu/soc is provided for testing.
- */
-#include "pmu-events/pmu-events.h"
+
+/* SPDX-License-Identifier: GPL-2.0 */
+/* THIS FILE WAS AUTOGENERATED BY jevents.py arch=none model=none ! */
+
+#include <pmu-events/pmu-events.h>
 #include "util/header.h"
 #include "util/pmu.h"
 #include <string.h>
 #include <stddef.h>
 
-static const struct pmu_event pmu_events__test_soc_cpu[] = {
-	{
-		.name = "l3_cache_rd",
-		.event = "event=0x40",
-		.desc = "L3 cache access, read",
-		.topic = "cache",
-		.long_desc = "Attributable Level 3 cache access, read",
-	},
-	{
-		.name = "segment_reg_loads.any",
-		.event = "event=0x6,period=200000,umask=0x80",
-		.desc = "Number of segment register loads",
-		.topic = "other",
-	},
-	{
-		.name = "dispatch_blocked.any",
-		.event = "event=0x9,period=200000,umask=0x20",
-		.desc = "Memory cluster signals to block micro-op dispatch for any reason",
-		.topic = "other",
-	},
-	{
-		.name = "eist_trans",
-		.event = "event=0x3a,period=200000,umask=0x0",
-		.desc = "Number of Enhanced Intel SpeedStep(R) Technology (EIST) transitions",
-		.topic = "other",
-	},
-	{
-		.name = "uncore_hisi_ddrc.flux_wcmd",
-		.event = "event=0x2",
-		.desc = "DDRC write commands. Unit: hisi_sccl,ddrc ",
-		.topic = "uncore",
-		.long_desc = "DDRC write commands",
-		.pmu = "hisi_sccl,ddrc",
-	},
-	{
-		.name = "unc_cbo_xsnp_response.miss_eviction",
-		.event = "event=0x22,umask=0x81",
-		.desc = "A cross-core snoop resulted from L3 Eviction which misses in some processor core. Unit: uncore_cbox ",
-		.topic = "uncore",
-		.long_desc = "A cross-core snoop resulted from L3 Eviction which misses in some processor core",
-		.pmu = "uncore_cbox",
-	},
-	{
-		.name = "event-hyphen",
-		.event = "event=0xe0,umask=0x00",
-		.desc = "UNC_CBO_HYPHEN. Unit: uncore_cbox ",
-		.topic = "uncore",
-		.long_desc = "UNC_CBO_HYPHEN",
-		.pmu = "uncore_cbox",
-	},
-	{
-		.name = "event-two-hyph",
-		.event = "event=0xc0,umask=0x00",
-		.desc = "UNC_CBO_TWO_HYPH. Unit: uncore_cbox ",
-		.topic = "uncore",
-		.long_desc = "UNC_CBO_TWO_HYPH",
-		.pmu = "uncore_cbox",
-	},
-	{
-		.name = "uncore_hisi_l3c.rd_hit_cpipe",
-		.event = "event=0x7",
-		.desc = "Total read hits. Unit: hisi_sccl,l3c ",
-		.topic = "uncore",
-		.long_desc = "Total read hits",
-		.pmu = "hisi_sccl,l3c",
-	},
-	{
-		.name = "uncore_imc_free_running.cache_miss",
-		.event = "event=0x12",
-		.desc = "Total cache misses. Unit: uncore_imc_free_running ",
-		.topic = "uncore",
-		.long_desc = "Total cache misses",
-		.pmu = "uncore_imc_free_running",
-	},
-	{
-		.name = "uncore_imc.cache_hits",
-		.event = "event=0x34",
-		.desc = "Total cache hits. Unit: uncore_imc ",
-		.topic = "uncore",
-		.long_desc = "Total cache hits",
-		.pmu = "uncore_imc",
-	},
-	{
-		.name = "bp_l1_btb_correct",
-		.event = "event=0x8a",
-		.desc = "L1 BTB Correction",
-		.topic = "branch",
-	},
-	{
-		.name = "bp_l2_btb_correct",
-		.event = "event=0x8b",
-		.desc = "L2 BTB Correction",
-		.topic = "branch",
-	},
-	{
-		.name = 0,
-		.event = 0,
-		.desc = 0,
-	},
+struct compact_pmu_event {
+        int offset;
 };
 
-static const struct pmu_metric pmu_metrics__test_soc_cpu[] = {
-	{
-		.metric_expr	= "1 / IPC",
-		.metric_name	= "CPI",
-	},
-	{
-		.metric_expr	= "inst_retired.any / cpu_clk_unhalted.thread",
-		.metric_name	= "IPC",
-		.metric_group	= "group1",
-	},
-	{
-		.metric_expr	= "idq_uops_not_delivered.core / (4 * (( ( cpu_clk_unhalted.thread / 2 ) * "
-		"( 1 + cpu_clk_unhalted.one_thread_active / cpu_clk_unhalted.ref_xclk ) )))",
-		.metric_name	= "Frontend_Bound_SMT",
-	},
-	{
-		.metric_expr	= "l1d\\-loads\\-misses / inst_retired.any",
-		.metric_name	= "dcache_miss_cpi",
-	},
-	{
-		.metric_expr	= "l1i\\-loads\\-misses / inst_retired.any",
-		.metric_name	= "icache_miss_cycles",
-	},
-	{
-		.metric_expr	= "(dcache_miss_cpi + icache_miss_cycles)",
-		.metric_name	= "cache_miss_cycles",
-		.metric_group	= "group1",
-	},
-	{
-		.metric_expr	= "l2_rqsts.demand_data_rd_hit + l2_rqsts.pf_hit + l2_rqsts.rfo_hit",
-		.metric_name	= "DCache_L2_All_Hits",
-	},
-	{
-		.metric_expr	= "max(l2_rqsts.all_demand_data_rd - l2_rqsts.demand_data_rd_hit, 0) + "
-		"l2_rqsts.pf_miss + l2_rqsts.rfo_miss",
-		.metric_name	= "DCache_L2_All_Miss",
-	},
-	{
-		.metric_expr	= "DCache_L2_All_Hits + DCache_L2_All_Miss",
-		.metric_name	= "DCache_L2_All",
-	},
-	{
-		.metric_expr	= "d_ratio(DCache_L2_All_Hits, DCache_L2_All)",
-		.metric_name	= "DCache_L2_Hits",
-	},
-	{
-		.metric_expr	= "d_ratio(DCache_L2_All_Miss, DCache_L2_All)",
-		.metric_name	= "DCache_L2_Misses",
-	},
-	{
-		.metric_expr	= "ipc + M2",
-		.metric_name	= "M1",
-	},
-	{
-		.metric_expr	= "ipc + M1",
-		.metric_name	= "M2",
-	},
-	{
-		.metric_expr	= "1/M3",
-		.metric_name	= "M3",
-	},
-	{
-		.metric_expr	= "64 * l1d.replacement / 1000000000 / duration_time",
-		.metric_name	= "L1D_Cache_Fill_BW",
-	},
-	{
-		.metric_expr = 0,
-		.metric_name = 0,
-	},
+struct pmu_table_entry {
+        const struct compact_pmu_event *entries;
+        uint32_t num_entries;
+        struct compact_pmu_event pmu_name;
+};
+
+static const char *const big_c_string =
+/* offset=0 */ "default_core\000"
+/* offset=13 */ "bp_l1_btb_correct\000branch\000L1 BTB Correction\000event=0x8a\000\00000\000\000"
+/* offset=72 */ "bp_l2_btb_correct\000branch\000L2 BTB Correction\000event=0x8b\000\00000\000\000"
+/* offset=131 */ "l3_cache_rd\000cache\000L3 cache access, read\000event=0x40\000\00000\000Attributable Level 3 cache access, read\000"
+/* offset=226 */ "segment_reg_loads.any\000other\000Number of segment register loads\000event=6,period=200000,umask=0x80\000\00000\000\000"
+/* offset=325 */ "dispatch_blocked.any\000other\000Memory cluster signals to block micro-op dispatch for any reason\000event=9,period=200000,umask=0x20\000\00000\000\000"
+/* offset=455 */ "eist_trans\000other\000Number of Enhanced Intel SpeedStep(R) Technology (EIST) transitions\000event=0x3a,period=200000\000\00000\000\000"
+/* offset=570 */ "hisi_sccl,ddrc\000"
+/* offset=585 */ "uncore_hisi_ddrc.flux_wcmd\000uncore\000DDRC write commands\000event=2\000\00000\000DDRC write commands\000"
+/* offset=671 */ "uncore_cbox\000"
+/* offset=683 */ "unc_cbo_xsnp_response.miss_eviction\000uncore\000A cross-core snoop resulted from L3 Eviction which misses in some processor core\000event=0x22,umask=0x81\000\00000\000A cross-core snoop resulted from L3 Eviction which misses in some processor core\000"
+/* offset=914 */ "event-hyphen\000uncore\000UNC_CBO_HYPHEN\000event=0xe0\000\00000\000UNC_CBO_HYPHEN\000"
+/* offset=979 */ "event-two-hyph\000uncore\000UNC_CBO_TWO_HYPH\000event=0xc0\000\00000\000UNC_CBO_TWO_HYPH\000"
+/* offset=1050 */ "hisi_sccl,l3c\000"
+/* offset=1064 */ "uncore_hisi_l3c.rd_hit_cpipe\000uncore\000Total read hits\000event=7\000\00000\000Total read hits\000"
+/* offset=1144 */ "uncore_imc_free_running\000"
+/* offset=1168 */ "uncore_imc_free_running.cache_miss\000uncore\000Total cache misses\000event=0x12\000\00000\000Total cache misses\000"
+/* offset=1263 */ "uncore_imc\000"
+/* offset=1274 */ "uncore_imc.cache_hits\000uncore\000Total cache hits\000event=0x34\000\00000\000Total cache hits\000"
+/* offset=1352 */ "uncore_sys_ddr_pmu\000"
+/* offset=1371 */ "sys_ddr_pmu.write_cycles\000uncore\000ddr write-cycles event\000event=0x2b\000v8\00000\000\000"
+/* offset=1444 */ "uncore_sys_ccn_pmu\000"
+/* offset=1463 */ "sys_ccn_pmu.read_cycles\000uncore\000ccn read-cycles event\000config=0x2c\0000x01\00000\000\000"
+/* offset=1537 */ "uncore_sys_cmn_pmu\000"
+/* offset=1556 */ "sys_cmn_pmu.hnf_cache_miss\000uncore\000Counts total cache misses in first lookup result (high priority)\000eventid=1,type=5\000(434|436|43c|43a).*\00000\000\000"
+/* offset=1696 */ "CPI\000\0001 / IPC\000\000\000\000\000\000\000\00000"
+/* offset=1718 */ "IPC\000group1\000inst_retired.any / cpu_clk_unhalted.thread\000\000\000\000\000\000\000\00000"
+/* offset=1781 */ "Frontend_Bound_SMT\000\000idq_uops_not_delivered.core / (4 * (cpu_clk_unhalted.thread / 2 * (1 + cpu_clk_unhalted.one_thread_active / cpu_clk_unhalted.ref_xclk)))\000\000\000\000\000\000\000\00000"
+/* offset=1947 */ "dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000"
+/* offset=2011 */ "icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000"
+/* offset=2078 */ "cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000"
+/* offset=2149 */ "DCache_L2_All_Hits\000\000l2_rqsts.demand_data_rd_hit + l2_rqsts.pf_hit + l2_rqsts.rfo_hit\000\000\000\000\000\000\000\00000"
+/* offset=2243 */ "DCache_L2_All_Miss\000\000max(l2_rqsts.all_demand_data_rd - l2_rqsts.demand_data_rd_hit, 0) + l2_rqsts.pf_miss + l2_rqsts.rfo_miss\000\000\000\000\000\000\000\00000"
+/* offset=2377 */ "DCache_L2_All\000\000DCache_L2_All_Hits + DCache_L2_All_Miss\000\000\000\000\000\000\000\00000"
+/* offset=2441 */ "DCache_L2_Hits\000\000d_ratio(DCache_L2_All_Hits, DCache_L2_All)\000\000\000\000\000\000\000\00000"
+/* offset=2509 */ "DCache_L2_Misses\000\000d_ratio(DCache_L2_All_Miss, DCache_L2_All)\000\000\000\000\000\000\000\00000"
+/* offset=2579 */ "M1\000\000ipc + M2\000\000\000\000\000\000\000\00000"
+/* offset=2601 */ "M2\000\000ipc + M1\000\000\000\000\000\000\000\00000"
+/* offset=2623 */ "M3\000\0001 / M3\000\000\000\000\000\000\000\00000"
+/* offset=2643 */ "L1D_Cache_Fill_BW\000\00064 * l1d.replacement / 1e9 / duration_time\000\000\000\000\000\000\000\00000"
+;
+
+static const struct compact_pmu_event pmu_events__test_soc_cpu_default_core[] = {
+{ 13 }, /* bp_l1_btb_correct\000branch\000L1 BTB Correction\000event=0x8a\000\00000\000\000 */
+{ 72 }, /* bp_l2_btb_correct\000branch\000L2 BTB Correction\000event=0x8b\000\00000\000\000 */
+{ 325 }, /* dispatch_blocked.any\000other\000Memory cluster signals to block micro-op dispatch for any reason\000event=9,period=200000,umask=0x20\000\00000\000\000 */
+{ 455 }, /* eist_trans\000other\000Number of Enhanced Intel SpeedStep(R) Technology (EIST) transitions\000event=0x3a,period=200000\000\00000\000\000 */
+{ 131 }, /* l3_cache_rd\000cache\000L3 cache access, read\000event=0x40\000\00000\000Attributable Level 3 cache access, read\000 */
+{ 226 }, /* segment_reg_loads.any\000other\000Number of segment register loads\000event=6,period=200000,umask=0x80\000\00000\000\000 */
+};
+static const struct compact_pmu_event pmu_events__test_soc_cpu_hisi_sccl_ddrc[] = {
+{ 585 }, /* uncore_hisi_ddrc.flux_wcmd\000uncore\000DDRC write commands\000event=2\000\00000\000DDRC write commands\000 */
+};
+static const struct compact_pmu_event pmu_events__test_soc_cpu_hisi_sccl_l3c[] = {
+{ 1064 }, /* uncore_hisi_l3c.rd_hit_cpipe\000uncore\000Total read hits\000event=7\000\00000\000Total read hits\000 */
+};
+static const struct compact_pmu_event pmu_events__test_soc_cpu_uncore_cbox[] = {
+{ 914 }, /* event-hyphen\000uncore\000UNC_CBO_HYPHEN\000event=0xe0\000\00000\000UNC_CBO_HYPHEN\000 */
+{ 979 }, /* event-two-hyph\000uncore\000UNC_CBO_TWO_HYPH\000event=0xc0\000\00000\000UNC_CBO_TWO_HYPH\000 */
+{ 683 }, /* unc_cbo_xsnp_response.miss_eviction\000uncore\000A cross-core snoop resulted from L3 Eviction which misses in some processor core\000event=0x22,umask=0x81\000\00000\000A cross-core snoop resulted from L3 Eviction which misses in some processor core\000 */
+};
+static const struct compact_pmu_event pmu_events__test_soc_cpu_uncore_imc[] = {
+{ 1274 }, /* uncore_imc.cache_hits\000uncore\000Total cache hits\000event=0x34\000\00000\000Total cache hits\000 */
+};
+static const struct compact_pmu_event pmu_events__test_soc_cpu_uncore_imc_free_running[] = {
+{ 1168 }, /* uncore_imc_free_running.cache_miss\000uncore\000Total cache misses\000event=0x12\000\00000\000Total cache misses\000 */
+
+};
+
+const struct pmu_table_entry pmu_events__test_soc_cpu[] = {
+{
+     .entries = pmu_events__test_soc_cpu_default_core,
+     .num_entries = ARRAY_SIZE(pmu_events__test_soc_cpu_default_core),
+     .pmu_name = { 0 /* default_core\000 */ },
+},
+{
+     .entries = pmu_events__test_soc_cpu_hisi_sccl_ddrc,
+     .num_entries = ARRAY_SIZE(pmu_events__test_soc_cpu_hisi_sccl_ddrc),
+     .pmu_name = { 570 /* hisi_sccl,ddrc\000 */ },
+},
+{
+     .entries = pmu_events__test_soc_cpu_hisi_sccl_l3c,
+     .num_entries = ARRAY_SIZE(pmu_events__test_soc_cpu_hisi_sccl_l3c),
+     .pmu_name = { 1050 /* hisi_sccl,l3c\000 */ },
+},
+{
+     .entries = pmu_events__test_soc_cpu_uncore_cbox,
+     .num_entries = ARRAY_SIZE(pmu_events__test_soc_cpu_uncore_cbox),
+     .pmu_name = { 671 /* uncore_cbox\000 */ },
+},
+{
+     .entries = pmu_events__test_soc_cpu_uncore_imc,
+     .num_entries = ARRAY_SIZE(pmu_events__test_soc_cpu_uncore_imc),
+     .pmu_name = { 1263 /* uncore_imc\000 */ },
+},
+{
+     .entries = pmu_events__test_soc_cpu_uncore_imc_free_running,
+     .num_entries = ARRAY_SIZE(pmu_events__test_soc_cpu_uncore_imc_free_running),
+     .pmu_name = { 1144 /* uncore_imc_free_running\000 */ },
+},
 };
 
+static const struct compact_pmu_event pmu_metrics__test_soc_cpu_default_core[] = {
+{ 1696 }, /* CPI\000\0001 / IPC\000\000\000\000\000\000\000\00000 */
+{ 2377 }, /* DCache_L2_All\000\000DCache_L2_All_Hits + DCache_L2_All_Miss\000\000\000\000\000\000\000\00000 */
+{ 2149 }, /* DCache_L2_All_Hits\000\000l2_rqsts.demand_data_rd_hit + l2_rqsts.pf_hit + l2_rqsts.rfo_hit\000\000\000\000\000\000\000\00000 */
+{ 2243 }, /* DCache_L2_All_Miss\000\000max(l2_rqsts.all_demand_data_rd - l2_rqsts.demand_data_rd_hit, 0) + l2_rqsts.pf_miss + l2_rqsts.rfo_miss\000\000\000\000\000\000\000\00000 */
+{ 2441 }, /* DCache_L2_Hits\000\000d_ratio(DCache_L2_All_Hits, DCache_L2_All)\000\000\000\000\000\000\000\00000 */
+{ 2509 }, /* DCache_L2_Misses\000\000d_ratio(DCache_L2_All_Miss, DCache_L2_All)\000\000\000\000\000\000\000\00000 */
+{ 1781 }, /* Frontend_Bound_SMT\000\000idq_uops_not_delivered.core / (4 * (cpu_clk_unhalted.thread / 2 * (1 + cpu_clk_unhalted.one_thread_active / cpu_clk_unhalted.ref_xclk)))\000\000\000\000\000\000\000\00000 */
+{ 1718 }, /* IPC\000group1\000inst_retired.any / cpu_clk_unhalted.thread\000\000\000\000\000\000\000\00000 */
+{ 2643 }, /* L1D_Cache_Fill_BW\000\00064 * l1d.replacement / 1e9 / duration_time\000\000\000\000\000\000\000\00000 */
+{ 2579 }, /* M1\000\000ipc + M2\000\000\000\000\000\000\000\00000 */
+{ 2601 }, /* M2\000\000ipc + M1\000\000\000\000\000\000\000\00000 */
+{ 2623 }, /* M3\000\0001 / M3\000\000\000\000\000\000\000\00000 */
+{ 2078 }, /* cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000 */
+{ 1947 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
+{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
+
+};
+
+const struct pmu_table_entry pmu_metrics__test_soc_cpu[] = {
+{
+     .entries = pmu_metrics__test_soc_cpu_default_core,
+     .num_entries = ARRAY_SIZE(pmu_metrics__test_soc_cpu_default_core),
+     .pmu_name = { 0 /* default_core\000 */ },
+},
+};
+
+static const struct compact_pmu_event pmu_events__test_soc_sys_uncore_sys_ccn_pmu[] = {
+{ 1463 }, /* sys_ccn_pmu.read_cycles\000uncore\000ccn read-cycles event\000config=0x2c\0000x01\00000\000\000 */
+};
+static const struct compact_pmu_event pmu_events__test_soc_sys_uncore_sys_cmn_pmu[] = {
+{ 1556 }, /* sys_cmn_pmu.hnf_cache_miss\000uncore\000Counts total cache misses in first lookup result (high priority)\000eventid=1,type=5\000(434|436|43c|43a).*\00000\000\000 */
+};
+static const struct compact_pmu_event pmu_events__test_soc_sys_uncore_sys_ddr_pmu[] = {
+{ 1371 }, /* sys_ddr_pmu.write_cycles\000uncore\000ddr write-cycles event\000event=0x2b\000v8\00000\000\000 */
+
+};
+
+const struct pmu_table_entry pmu_events__test_soc_sys[] = {
+{
+     .entries = pmu_events__test_soc_sys_uncore_sys_ccn_pmu,
+     .num_entries = ARRAY_SIZE(pmu_events__test_soc_sys_uncore_sys_ccn_pmu),
+     .pmu_name = { 1444 /* uncore_sys_ccn_pmu\000 */ },
+},
+{
+     .entries = pmu_events__test_soc_sys_uncore_sys_cmn_pmu,
+     .num_entries = ARRAY_SIZE(pmu_events__test_soc_sys_uncore_sys_cmn_pmu),
+     .pmu_name = { 1537 /* uncore_sys_cmn_pmu\000 */ },
+},
+{
+     .entries = pmu_events__test_soc_sys_uncore_sys_ddr_pmu,
+     .num_entries = ARRAY_SIZE(pmu_events__test_soc_sys_uncore_sys_ddr_pmu),
+     .pmu_name = { 1352 /* uncore_sys_ddr_pmu\000 */ },
+},
+};
+
+
 /* Struct used to make the PMU event table implementation opaque to callers. */
 struct pmu_events_table {
-	const struct pmu_event *entries;
+        const struct pmu_table_entry *pmus;
+        uint32_t num_pmus;
 };
 
 /* Struct used to make the PMU metric table implementation opaque to callers. */
 struct pmu_metrics_table {
-	const struct pmu_metric *entries;
+        const struct pmu_table_entry *pmus;
+        uint32_t num_pmus;
 };
 
 /*
@@ -202,92 +199,191 @@ struct pmu_metrics_table {
  * The  cpuid can contain any character other than the comma.
  */
 struct pmu_events_map {
-	const char *arch;
-	const char *cpuid;
-	const struct pmu_events_table event_table;
-	const struct pmu_metrics_table metric_table;
+        const char *arch;
+        const char *cpuid;
+        struct pmu_events_table event_table;
+        struct pmu_metrics_table metric_table;
 };
 
 /*
  * Global table mapping each known CPU for the architecture to its
  * table of PMU events.
  */
-static const struct pmu_events_map pmu_events_map[] = {
-	{
-		.arch = "testarch",
-		.cpuid = "testcpu",
-		.event_table = { pmu_events__test_soc_cpu },
-		.metric_table = { pmu_metrics__test_soc_cpu },
-	},
-	{
-		.arch = 0,
-		.cpuid = 0,
-		.event_table = { 0 },
-		.metric_table = { 0 },
-	},
-};
-
-static const struct pmu_event pmu_events__test_soc_sys[] = {
-	{
-		.name = "sys_ddr_pmu.write_cycles",
-		.event = "event=0x2b",
-		.desc = "ddr write-cycles event. Unit: uncore_sys_ddr_pmu ",
-		.compat = "v8",
-		.topic = "uncore",
-		.pmu = "uncore_sys_ddr_pmu",
-	},
-	{
-		.name = "sys_ccn_pmu.read_cycles",
-		.event = "config=0x2c",
-		.desc = "ccn read-cycles event. Unit: uncore_sys_ccn_pmu ",
-		.compat = "0x01",
-		.topic = "uncore",
-		.pmu = "uncore_sys_ccn_pmu",
-	},
-	{
-		.name = "sys_cmn_pmu.hnf_cache_miss",
-		.event = "eventid=0x1,type=0x5",
-		.desc = "Counts total cache misses in first lookup result (high priority). Unit: uncore_sys_cmn_pmu ",
-		.compat = "(434|436|43c|43a).*",
-		.topic = "uncore",
-		.pmu = "uncore_sys_cmn_pmu",
-	},
-	{
-		.name = 0,
-		.event = 0,
-		.desc = 0,
-	},
+const struct pmu_events_map pmu_events_map[] = {
+{
+	.arch = "testarch",
+	.cpuid = "testcpu",
+	.event_table = {
+		.pmus = pmu_events__test_soc_cpu,
+		.num_pmus = ARRAY_SIZE(pmu_events__test_soc_cpu),
+	},
+	.metric_table = {
+		.pmus = pmu_metrics__test_soc_cpu,
+		.num_pmus = ARRAY_SIZE(pmu_metrics__test_soc_cpu),
+	}
+},
+{
+	.arch = 0,
+	.cpuid = 0,
+	.event_table = { 0, 0 },
+	.metric_table = { 0, 0 },
+}
 };
 
 struct pmu_sys_events {
 	const char *name;
-	const struct pmu_events_table table;
+	struct pmu_events_table event_table;
+	struct pmu_metrics_table metric_table;
 };
 
 static const struct pmu_sys_events pmu_sys_event_tables[] = {
 	{
-		.table = { pmu_events__test_soc_sys },
+		.event_table = {
+			.pmus = pmu_events__test_soc_sys,
+			.num_pmus = ARRAY_SIZE(pmu_events__test_soc_sys)
+		},
 		.name = "pmu_events__test_soc_sys",
 	},
 	{
-		.table = { 0 }
+		.event_table = { 0, 0 },
+		.metric_table = { 0, 0 },
 	},
 };
 
-int pmu_events_table__for_each_event(const struct pmu_events_table *table, struct perf_pmu *pmu,
-				     pmu_event_iter_fn fn, void *data)
+static void decompress_event(int offset, struct pmu_event *pe)
+{
+	const char *p = &big_c_string[offset];
+
+	pe->name = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pe->topic = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pe->desc = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pe->event = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pe->compat = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pe->deprecated = *p - '0';
+	p++;
+	pe->perpkg = *p - '0';
+	p++;
+	pe->unit = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pe->long_desc = (*p == '\0' ? NULL : p);
+}
+
+static void decompress_metric(int offset, struct pmu_metric *pm)
 {
-	for (const struct pmu_event *pe = &table->entries[0]; pe->name; pe++) {
-		int ret;
+	const char *p = &big_c_string[offset];
+
+	pm->metric_name = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pm->metric_group = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pm->metric_expr = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pm->metric_threshold = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pm->desc = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pm->long_desc = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pm->unit = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pm->compat = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pm->metricgroup_no_group = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pm->default_metricgroup_name = (*p == '\0' ? NULL : p);
+	while (*p++);
+	pm->aggr_mode = *p - '0';
+	p++;
+	pm->event_grouping = *p - '0';
+}
 
-                if (pmu && !pmu__name_match(pmu, pe->pmu))
+static int pmu_events_table__for_each_event_pmu(const struct pmu_events_table *table,
+                                                const struct pmu_table_entry *pmu,
+                                                pmu_event_iter_fn fn,
+                                                void *data)
+{
+        int ret;
+        struct pmu_event pe = {
+                .pmu = &big_c_string[pmu->pmu_name.offset],
+        };
+
+        for (uint32_t i = 0; i < pmu->num_entries; i++) {
+                decompress_event(pmu->entries[i].offset, &pe);
+                if (!pe.name)
                         continue;
+                ret = fn(&pe, table, data);
+                if (ret)
+                        return ret;
+        }
+        return 0;
+ }
+
+static int pmu_events_table__find_event_pmu(const struct pmu_events_table *table,
+                                            const struct pmu_table_entry *pmu,
+                                            const char *name,
+                                            pmu_event_iter_fn fn,
+                                            void *data)
+{
+        struct pmu_event pe = {
+                .pmu = &big_c_string[pmu->pmu_name.offset],
+        };
+        int low = 0, high = pmu->num_entries - 1;
 
-		ret = fn(pe, table, data);
-		if (ret)
-			return ret;
-	}
-	return 0;
+        while (low <= high) {
+                int cmp, mid = (low + high) / 2;
+
+                decompress_event(pmu->entries[mid].offset, &pe);
+
+                if (!pe.name && !name)
+                        goto do_call;
+
+                if (!pe.name && name) {
+                        low = mid + 1;
+                        continue;
+                }
+                if (pe.name && !name) {
+                        high = mid - 1;
+                        continue;
+                }
+
+                cmp = strcasecmp(pe.name, name);
+                if (cmp < 0) {
+                        low = mid + 1;
+                        continue;
+                }
+                if (cmp > 0) {
+                        high = mid - 1;
+                        continue;
+                }
+  do_call:
+                return fn ? fn(&pe, table, data) : 0;
+        }
+        return PMU_EVENTS__NOT_FOUND;
+}
+
+int pmu_events_table__for_each_event(const struct pmu_events_table *table,
+                                    struct perf_pmu *pmu,
+                                    pmu_event_iter_fn fn,
+                                    void *data)
+{
+        for (size_t i = 0; i < table->num_pmus; i++) {
+                const struct pmu_table_entry *table_pmu = &table->pmus[i];
+                const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset];
+                int ret;
+
+                if (pmu && !pmu__name_match(pmu, pmu_name))
+                        continue;
+
+                ret = pmu_events_table__for_each_event_pmu(table, table_pmu, fn, data);
+                if (pmu || ret)
+                        return ret;
+        }
+        return 0;
 }
 
 int pmu_events_table__find_event(const struct pmu_events_table *table,
@@ -296,14 +392,19 @@ int pmu_events_table__find_event(const struct pmu_events_table *table,
                                  pmu_event_iter_fn fn,
                                  void *data)
 {
-	for (const struct pmu_event *pe = &table->entries[0]; pe->name; pe++) {
-                if (pmu && !pmu__name_match(pmu, pe->pmu))
+        for (size_t i = 0; i < table->num_pmus; i++) {
+                const struct pmu_table_entry *table_pmu = &table->pmus[i];
+                const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset];
+                int ret;
+
+                if (!pmu__name_match(pmu, pmu_name))
                         continue;
 
-		if (!strcasecmp(pe->name, name))
-			return fn(pe, table, data);
-	}
-        return -1000;
+                ret = pmu_events_table__find_event_pmu(table, table_pmu, name, fn, data);
+                if (ret != PMU_EVENTS__NOT_FOUND)
+                        return ret;
+        }
+        return PMU_EVENTS__NOT_FOUND;
 }
 
 size_t pmu_events_table__num_events(const struct pmu_events_table *table,
@@ -311,160 +412,253 @@ size_t pmu_events_table__num_events(const struct pmu_events_table *table,
 {
         size_t count = 0;
 
-	for (const struct pmu_event *pe = &table->entries[0]; pe->name; pe++) {
-                if (pmu && !pmu__name_match(pmu, pe->pmu))
-                        continue;
+        for (size_t i = 0; i < table->num_pmus; i++) {
+                const struct pmu_table_entry *table_pmu = &table->pmus[i];
+                const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset];
 
-		count++;
-	}
+                if (pmu__name_match(pmu, pmu_name))
+                        count += table_pmu->num_entries;
+        }
         return count;
 }
 
-int pmu_metrics_table__for_each_metric(const struct pmu_metrics_table *table, pmu_metric_iter_fn fn,
-				      void *data)
+static int pmu_metrics_table__for_each_metric_pmu(const struct pmu_metrics_table *table,
+                                                const struct pmu_table_entry *pmu,
+                                                pmu_metric_iter_fn fn,
+                                                void *data)
+{
+        int ret;
+        struct pmu_metric pm = {
+                .pmu = &big_c_string[pmu->pmu_name.offset],
+        };
+
+        for (uint32_t i = 0; i < pmu->num_entries; i++) {
+                decompress_metric(pmu->entries[i].offset, &pm);
+                if (!pm.metric_expr)
+                        continue;
+                ret = fn(&pm, table, data);
+                if (ret)
+                        return ret;
+        }
+        return 0;
+}
+
+int pmu_metrics_table__for_each_metric(const struct pmu_metrics_table *table,
+                                     pmu_metric_iter_fn fn,
+                                     void *data)
 {
-	for (const struct pmu_metric *pm = &table->entries[0]; pm->metric_expr; pm++) {
-		int ret = fn(pm, table, data);
+        for (size_t i = 0; i < table->num_pmus; i++) {
+                int ret = pmu_metrics_table__for_each_metric_pmu(table, &table->pmus[i],
+                                                                 fn, data);
+
+                if (ret)
+                        return ret;
+        }
+        return 0;
+}
 
-		if (ret)
-			return ret;
-	}
-	return 0;
+static const struct pmu_events_map *map_for_pmu(struct perf_pmu *pmu)
+{
+        static struct {
+                const struct pmu_events_map *map;
+                struct perf_pmu *pmu;
+        } last_result;
+        static struct {
+                const struct pmu_events_map *map;
+                char *cpuid;
+        } last_map_search;
+        static bool has_last_result, has_last_map_search;
+        const struct pmu_events_map *map = NULL;
+        char *cpuid = NULL;
+        size_t i;
+
+        if (has_last_result && last_result.pmu == pmu)
+                return last_result.map;
+
+        cpuid = perf_pmu__getcpuid(pmu);
+
+        /*
+         * On some platforms which uses cpus map, cpuid can be NULL for
+         * PMUs other than CORE PMUs.
+         */
+        if (!cpuid)
+                goto out_update_last_result;
+
+        if (has_last_map_search && !strcmp(last_map_search.cpuid, cpuid)) {
+                map = last_map_search.map;
+                free(cpuid);
+        } else {
+                i = 0;
+                for (;;) {
+                        map = &pmu_events_map[i++];
+
+                        if (!map->arch) {
+                                map = NULL;
+                                break;
+                        }
+
+                        if (!strcmp_cpuid_str(map->cpuid, cpuid))
+                                break;
+               }
+               free(last_map_search.cpuid);
+               last_map_search.cpuid = cpuid;
+               last_map_search.map = map;
+               has_last_map_search = true;
+        }
+out_update_last_result:
+        last_result.pmu = pmu;
+        last_result.map = map;
+        has_last_result = true;
+        return map;
 }
 
 const struct pmu_events_table *perf_pmu__find_events_table(struct perf_pmu *pmu)
 {
-	const struct pmu_events_table *table = NULL;
-	char *cpuid = perf_pmu__getcpuid(pmu);
-	int i;
+        const struct pmu_events_map *map = map_for_pmu(pmu);
 
-	/* on some platforms which uses cpus map, cpuid can be NULL for
-	 * PMUs other than CORE PMUs.
-	 */
-	if (!cpuid)
-		return NULL;
+        if (!map)
+                return NULL;
 
-	i = 0;
-	for (;;) {
-		const struct pmu_events_map *map = &pmu_events_map[i++];
+        if (!pmu)
+                return &map->event_table;
 
-		if (!map->cpuid)
-			break;
+        for (size_t i = 0; i < map->event_table.num_pmus; i++) {
+                const struct pmu_table_entry *table_pmu = &map->event_table.pmus[i];
+                const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset];
 
-		if (!strcmp_cpuid_str(map->cpuid, cpuid)) {
-			table = &map->event_table;
-			break;
-		}
-	}
-	free(cpuid);
-	return table;
+                if (pmu__name_match(pmu, pmu_name))
+                         return &map->event_table;
+        }
+        return NULL;
 }
 
 const struct pmu_metrics_table *perf_pmu__find_metrics_table(struct perf_pmu *pmu)
 {
-	const struct pmu_metrics_table *table = NULL;
-	char *cpuid = perf_pmu__getcpuid(pmu);
-	int i;
+        const struct pmu_events_map *map = map_for_pmu(pmu);
 
-	/* on some platforms which uses cpus map, cpuid can be NULL for
-	 * PMUs other than CORE PMUs.
-	 */
-	if (!cpuid)
-		return NULL;
+        if (!map)
+                return NULL;
 
-	i = 0;
-	for (;;) {
-		const struct pmu_events_map *map = &pmu_events_map[i++];
+        if (!pmu)
+                return &map->metric_table;
 
-		if (!map->cpuid)
-			break;
+        for (size_t i = 0; i < map->metric_table.num_pmus; i++) {
+                const struct pmu_table_entry *table_pmu = &map->metric_table.pmus[i];
+                const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset];
 
-		if (!strcmp_cpuid_str(map->cpuid, cpuid)) {
-			table = &map->metric_table;
-			break;
-		}
-	}
-	free(cpuid);
-	return table;
+                if (pmu__name_match(pmu, pmu_name))
+                           return &map->metric_table;
+        }
+        return NULL;
 }
 
 const struct pmu_events_table *find_core_events_table(const char *arch, const char *cpuid)
 {
-	for (const struct pmu_events_map *tables = &pmu_events_map[0];
-	     tables->arch;
-	     tables++) {
-		if (!strcmp(tables->arch, arch) && !strcmp_cpuid_str(tables->cpuid, cpuid))
-			return &tables->event_table;
-	}
-	return NULL;
+        for (const struct pmu_events_map *tables = &pmu_events_map[0];
+             tables->arch;
+             tables++) {
+                if (!strcmp(tables->arch, arch) && !strcmp_cpuid_str(tables->cpuid, cpuid))
+                        return &tables->event_table;
+        }
+        return NULL;
 }
 
 const struct pmu_metrics_table *find_core_metrics_table(const char *arch, const char *cpuid)
 {
-	for (const struct pmu_events_map *tables = &pmu_events_map[0];
-	     tables->arch;
-	     tables++) {
-		if (!strcmp(tables->arch, arch) && !strcmp_cpuid_str(tables->cpuid, cpuid))
-			return &tables->metric_table;
-	}
-	return NULL;
+        for (const struct pmu_events_map *tables = &pmu_events_map[0];
+             tables->arch;
+             tables++) {
+                if (!strcmp(tables->arch, arch) && !strcmp_cpuid_str(tables->cpuid, cpuid))
+                        return &tables->metric_table;
+        }
+        return NULL;
 }
 
 int pmu_for_each_core_event(pmu_event_iter_fn fn, void *data)
 {
-	for (const struct pmu_events_map *tables = &pmu_events_map[0]; tables->arch; tables++) {
-		int ret = pmu_events_table__for_each_event(&tables->event_table,
-							   /*pmu=*/ NULL, fn, data);
-
-		if (ret)
-			return ret;
-	}
-	return 0;
+        for (const struct pmu_events_map *tables = &pmu_events_map[0];
+             tables->arch;
+             tables++) {
+                int ret = pmu_events_table__for_each_event(&tables->event_table,
+                                                           /*pmu=*/ NULL, fn, data);
+
+                if (ret)
+                        return ret;
+        }
+        return 0;
 }
 
 int pmu_for_each_core_metric(pmu_metric_iter_fn fn, void *data)
 {
-	for (const struct pmu_events_map *tables = &pmu_events_map[0];
-	     tables->arch;
-	     tables++) {
-		int ret = pmu_metrics_table__for_each_metric(&tables->metric_table, fn, data);
-
-		if (ret)
-			return ret;
-	}
-	return 0;
+        for (const struct pmu_events_map *tables = &pmu_events_map[0];
+             tables->arch;
+             tables++) {
+                int ret = pmu_metrics_table__for_each_metric(&tables->metric_table, fn, data);
+
+                if (ret)
+                        return ret;
+        }
+        return 0;
 }
 
 const struct pmu_events_table *find_sys_events_table(const char *name)
 {
-	for (const struct pmu_sys_events *tables = &pmu_sys_event_tables[0];
-	     tables->name;
-	     tables++) {
-		if (!strcmp(tables->name, name))
-			return &tables->table;
-	}
-	return NULL;
+        for (const struct pmu_sys_events *tables = &pmu_sys_event_tables[0];
+             tables->name;
+             tables++) {
+                if (!strcmp(tables->name, name))
+                        return &tables->event_table;
+        }
+        return NULL;
 }
 
 int pmu_for_each_sys_event(pmu_event_iter_fn fn, void *data)
 {
-	for (const struct pmu_sys_events *tables = &pmu_sys_event_tables[0];
-	     tables->name;
-	     tables++) {
-		int ret = pmu_events_table__for_each_event(&tables->table, /*pmu=*/ NULL, fn, data);
-
-		if (ret)
-			return ret;
-	}
-	return 0;
+        for (const struct pmu_sys_events *tables = &pmu_sys_event_tables[0];
+             tables->name;
+             tables++) {
+                int ret = pmu_events_table__for_each_event(&tables->event_table,
+                                                           /*pmu=*/ NULL, fn, data);
+
+                if (ret)
+                        return ret;
+        }
+        return 0;
 }
 
-int pmu_for_each_sys_metric(pmu_metric_iter_fn fn __maybe_unused, void *data __maybe_unused)
+int pmu_for_each_sys_metric(pmu_metric_iter_fn fn, void *data)
 {
-	return 0;
+        for (const struct pmu_sys_events *tables = &pmu_sys_event_tables[0];
+             tables->name;
+             tables++) {
+                int ret = pmu_metrics_table__for_each_metric(&tables->metric_table, fn, data);
+
+                if (ret)
+                        return ret;
+        }
+        return 0;
 }
 
-const char *describe_metricgroup(const char *group __maybe_unused)
+static const int metricgroups[][2] = {
+
+};
+
+const char *describe_metricgroup(const char *group)
 {
-	return NULL;
+        int low = 0, high = (int)ARRAY_SIZE(metricgroups) - 1;
+
+        while (low <= high) {
+                int mid = (low + high) / 2;
+                const char *mgroup = &big_c_string[metricgroups[mid][0]];
+                int cmp = strcmp(mgroup, group);
+
+                if (cmp == 0) {
+                        return &big_c_string[metricgroups[mid][1]];
+                } else if (cmp < 0) {
+                        low = mid + 1;
+                } else {
+                        high = mid - 1;
+                }
+        }
+        return NULL;
 }
diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py
index 7cc16ff96dc8..32878b02fbcd 100755
--- a/tools/perf/pmu-events/jevents.py
+++ b/tools/perf/pmu-events/jevents.py
@@ -1255,6 +1255,10 @@ such as "arm/cortex-a34".''',
       'output_file', type=argparse.FileType('w', encoding='utf-8'), nargs='?', default=sys.stdout)
   _args = ap.parse_args()
 
+  _args.output_file.write(f"""
+/* SPDX-License-Identifier: GPL-2.0 */
+/* THIS FILE WAS AUTOGENERATED BY jevents.py arch={_args.arch} model={_args.model} ! */
+""")
   _args.output_file.write("""
 #include <pmu-events/pmu-events.h>
 #include "util/header.h"
@@ -1280,7 +1284,7 @@ struct pmu_table_entry {
     if item.name == _args.arch or _args.arch == 'all' or item.name == 'test':
       archs.append(item.name)
 
-  if len(archs) < 2:
+  if len(archs) < 2 and _args.arch != 'none':
     raise IOError(f'Missing architecture directory \'{_args.arch}\'')
 
   archs.sort()
-- 
2.45.1.288.g0e0cd299f1-goog


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 1/2] perf jevents: Use name for special find value
  2024-05-25  1:30 [PATCH v2 1/2] perf jevents: Use name for special find value Ian Rogers
  2024-05-25  1:30 ` [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c Ian Rogers
@ 2024-05-28  9:55 ` John Garry
  1 sibling, 0 replies; 15+ messages in thread
From: John Garry @ 2024-05-28  9:55 UTC (permalink / raw)
  To: Ian Rogers, Weilin Wang, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Adrian Hunter, Kan Liang,
	Jing Zhang, Sandipan Das, linux-perf-users, linux-kernel

On 25/05/2024 02:30, Ian Rogers wrote:
> -1000 was used as a special value added in Commit 3d5045492ab2 ("perf
> pmu-events: Add pmu_events_table__find_event()") to show that 1 table
> lacked a PMU/event but that didn't terminate the search in other
> tables. Add a new constant PMU_EVENTS__NOT_FOUND for this value and
> use it.
> 
> Signed-off-by: Ian Rogers<irogers@google.com>

Reviewed-by: John Garry <john.g.garry@oracle.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c
  2024-05-25  1:30 ` [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c Ian Rogers
@ 2024-05-28 10:00   ` John Garry
  2024-05-28 15:14     ` Ian Rogers
  2024-05-31  8:16   ` kernel test robot
  1 sibling, 1 reply; 15+ messages in thread
From: John Garry @ 2024-05-28 10:00 UTC (permalink / raw)
  To: Ian Rogers, Weilin Wang, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Adrian Hunter, Kan Liang,
	Jing Zhang, Sandipan Das, linux-perf-users, linux-kernel

On 25/05/2024 02:30, Ian Rogers wrote:
> empty-pmu-events.c exists so that builds may occur without python
> being installed on a system. > Manually updating empty-pmu-events.c to
> be in sync with jevents.py is a pain, let's use jevents.py to generate
> empty-pmu-events.c.
> 
> 1) change jevents.py so that an arch and model of none cause
>     generation of a pmu-events.c without any json. Add a SPDX and
>     autogenerated warning to the start of the file.
> 
> 2) change Build so that if a generated pmu-events.c for arch none and
>     model none doesn't match empty-pmu-events.c the build fails with a
>     cat of the differences. Update Makefile.perf to clean up the files
>     used for this.
> 
> 3) update empty-pmu-events.c to match the output of jevents.py with
>     arch and mode of none.
> 
> Signed-off-by: Ian Rogers <irogers@google.com>


Reviewed-by: John Garry <john.g.garry@oracle.com>

> ---
>   tools/perf/Makefile.perf                 |   2 +
>   tools/perf/pmu-events/Build              |  12 +-
>   tools/perf/pmu-events/empty-pmu-events.c | 894 ++++++++++++++---------
>   tools/perf/pmu-events/jevents.py         |   6 +-
>   4 files changed, 562 insertions(+), 352 deletions(-)
> 
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.per

...

> -	},
> +struct pmu_table_entry {
> +        const struct compact_pmu_event *entries;
> +        uint32_t num_entries;
> +        struct compact_pmu_event pmu_name;
> +};
> +
> +static const char *const big_c_string =
> +/* offset=0 */ "default_core\000"
> +/* offset=13 */ "bp_l1_btb_correct\000branch\000L1 BTB Correction\000event=0x8a\000\00000\000\000"
> +/* offset=72 */ "bp_l2_btb_correct\000branch\000L2 BTB Correction\000event=0x8b\000\00000\000\000"

Please remind me: how to figure out this number when adding a new entry?

> +/* offset=131 */ "l3_cache_rd\000cache\000L3 cache access, read\000event=0x40\000\00000\000Attributable Level 3 cache access, read\000"

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c
  2024-05-28 10:00   ` John Garry
@ 2024-05-28 15:14     ` Ian Rogers
  0 siblings, 0 replies; 15+ messages in thread
From: Ian Rogers @ 2024-05-28 15:14 UTC (permalink / raw)
  To: John Garry
  Cc: Weilin Wang, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Adrian Hunter, Kan Liang,
	Jing Zhang, Sandipan Das, linux-perf-users, linux-kernel

On Tue, May 28, 2024 at 3:01 AM John Garry <john.g.garry@oracle.com> wrote:
>
> On 25/05/2024 02:30, Ian Rogers wrote:
> > empty-pmu-events.c exists so that builds may occur without python
> > being installed on a system. > Manually updating empty-pmu-events.c to
> > be in sync with jevents.py is a pain, let's use jevents.py to generate
> > empty-pmu-events.c.
> >
> > 1) change jevents.py so that an arch and model of none cause
> >     generation of a pmu-events.c without any json. Add a SPDX and
> >     autogenerated warning to the start of the file.
> >
> > 2) change Build so that if a generated pmu-events.c for arch none and
> >     model none doesn't match empty-pmu-events.c the build fails with a
> >     cat of the differences. Update Makefile.perf to clean up the files
> >     used for this.
> >
> > 3) update empty-pmu-events.c to match the output of jevents.py with
> >     arch and mode of none.
> >
> > Signed-off-by: Ian Rogers <irogers@google.com>
>
>
> Reviewed-by: John Garry <john.g.garry@oracle.com>

Thanks!

> > ---
> >   tools/perf/Makefile.perf                 |   2 +
> >   tools/perf/pmu-events/Build              |  12 +-
> >   tools/perf/pmu-events/empty-pmu-events.c | 894 ++++++++++++++---------
> >   tools/perf/pmu-events/jevents.py         |   6 +-
> >   4 files changed, 562 insertions(+), 352 deletions(-)
> >
> > diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.per
>
> ...
>
> > -     },
> > +struct pmu_table_entry {
> > +        const struct compact_pmu_event *entries;
> > +        uint32_t num_entries;
> > +        struct compact_pmu_event pmu_name;
> > +};
> > +
> > +static const char *const big_c_string =
> > +/* offset=0 */ "default_core\000"
> > +/* offset=13 */ "bp_l1_btb_correct\000branch\000L1 BTB Correction\000event=0x8a\000\00000\000\000"
> > +/* offset=72 */ "bp_l2_btb_correct\000branch\000L2 BTB Correction\000event=0x8b\000\00000\000\000"
>
> Please remind me: how to figure out this number when adding a new entry?

So this shouldn't be generated by hand. The old one was, this one is
created by jevents.py as maintaining something by hand is a pain. If
you need to add entries then they are in the
`tools/perf/pmu-events/arch/test/` directory. When you build with
NO_JEVENTS=1 then this file will be used. When building normally
jevents.py will be used and used to check that the empty-pmu-events.c
isn't out-of-date - the build will break if it is. The fix is just to
copy `test-empty-pmu-events.c` to `empty-pmu-events.c`, which is
hopefully implied by the result of the diff being shown.

Thanks,
Ian

> > +/* offset=131 */ "l3_cache_rd\000cache\000L3 cache access, read\000event=0x40\000\00000\000Attributable Level 3 cache access, read\000"

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c
  2024-05-25  1:30 ` [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c Ian Rogers
  2024-05-28 10:00   ` John Garry
@ 2024-05-31  8:16   ` kernel test robot
  2024-05-31 16:38     ` Ian Rogers
  1 sibling, 1 reply; 15+ messages in thread
From: kernel test robot @ 2024-05-31  8:16 UTC (permalink / raw)
  To: Ian Rogers
  Cc: oe-lkp, lkp, linux-perf-users, linux-kernel, Weilin Wang,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Kan Liang, Jing Zhang, John Garry,
	Sandipan Das, oliver.sang


hi, Ian Rogers,

we actually want to seek your advice. in our env, there is no problem to build
parent.

* 3249f8b84526d (linux-review/Ian-Rogers/perf-jevents-Autogenerate-empty-pmu-events-c/20240525-093240) perf jevents: Autogenerate empty-pmu-events.c
* 7d88bd0d22746 perf jevents: Use name for special find value   <--- parent

however, failed to build perf upon 3249f8b84526d. but there is not many useful
information in below detail log.

is there any dependency or env setting for us to build this commit? Thanks!



Hello,

kernel test robot noticed "perf-sanity-tests.perf.make.fail" on:

commit: 3249f8b84526d3b69162812908c257ee9816a237 ("[PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c")
url: https://github.com/intel-lab-lkp/linux/commits/Ian-Rogers/perf-jevents-Autogenerate-empty-pmu-events-c/20240525-093240
base: https://git.kernel.org/cgit/linux/kernel/git/perf/perf-tools-next.git perf-tools-next
patch link: https://lore.kernel.org/all/20240525013021.436430-2-irogers@google.com/
patch subject: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c

in testcase: perf-sanity-tests
version: 
with following parameters:

	perf_compiler: gcc



compiler: gcc-13
test machine: 224 threads 2 sockets Intel(R) Xeon(R) Platinum 8480+ (Sapphire Rapids) with 256G memory

(please refer to attached dmesg/kmsg for entire log/backtrace)




If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <oliver.sang@intel.com>
| Closes: https://lore.kernel.org/oe-lkp/202405311548.1e881dea-oliver.sang@intel.com

gcc march setting is sapphirerapids
valid
2024-05-30 15:55:30 make -j224 WERROR=0 BUILD_BPF_SKEL=0 ARCH= DEBUG=1 EXTRA_CFLAGS=-fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address -C /usr/src/linux-perf-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf
make: Entering directory '/usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf'
  BUILD:   Doing 'make ^[[33m-j224^[[m' parallel build
  HOSTCC  fixdep.o
  HOSTLD  fixdep-in.o
  LINK    fixdep
^[[0;33mWarning^[[0m: Kernel ABI header differences:

Auto-detecting system features:
...                                   dwarf: [ ^[[32mon^[[m  ]
...                      dwarf_getlocations: [ ^[[32mon^[[m  ]
...                                   glibc: [ ^[[32mon^[[m  ]
...                                  libbfd: [ ^[[32mon^[[m  ]
...                          libbfd-buildid: [ ^[[32mon^[[m  ]
...                                  libcap: [ ^[[32mon^[[m  ]
...                                  libelf: [ ^[[32mon^[[m  ]
...                                 libnuma: [ ^[[32mon^[[m  ]
...                  numa_num_possible_cpus: [ ^[[32mon^[[m  ]
...                                 libperl: [ ^[[32mon^[[m  ]
...                               libpython: [ ^[[32mon^[[m  ]
...                               libcrypto: [ ^[[32mon^[[m  ]
...                               libunwind: [ ^[[32mon^[[m  ]
...                      libdw-dwarf-unwind: [ ^[[32mon^[[m  ]
...                             libcapstone: [ ^[[31mOFF^[[m ]
...                                    zlib: [ ^[[32mon^[[m  ]
...                                    lzma: [ ^[[32mon^[[m  ]
...                               get_cpuid: [ ^[[32mon^[[m  ]
...                                     bpf: [ ^[[32mon^[[m  ]
...                                  libaio: [ ^[[32mon^[[m  ]
...                                 libzstd: [ ^[[32mon^[[m  ]

  GEN     common-cmds.h
  GEN     /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/arch/arm64/include/generated/asm/sysreg-defs.h
  CC      jvmti/libjvmti.o
  CC      jvmti/jvmti_agent.o
  CC      jvmti/libstring.o
  CC      dlfilters/dlfilter-test-api-v0.o
  CC      jvmti/libctype.o
  CC      dlfilters/dlfilter-test-api-v2.o
  CC      dlfilters/dlfilter-show-cycles.o
  GEN     perf-archive
  GEN     perf-iostat
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/include/subcmd/exec-cmd.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/include/subcmd/help.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/include/subcmd/pager.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/include/subcmd/parse-options.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/include/subcmd/run-command.h
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/exec-cmd.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/help.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/pager.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/parse-options.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/run-command.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/sigchain.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/subcmd-config.o
  INSTALL libsubcmd_headers
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/include/api/cpu.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/include/api/debug.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/include/api/io.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/include/api/fd/array.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsymbol/include/symbol/kallsyms.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/perf/bpf_perf.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/include/api/fs/fs.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/perf/core.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/include/api/fs/tracing_path.h
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsymbol/kallsyms.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/cpu.o
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/perf/cpumap.h
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/debug.o
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/perf/threadmap.h
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/core.o
  MKDIR   /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/fd/
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/perf/evlist.h
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/str_error_r.o
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/perf/evsel.h
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/cpumap.o
  MKDIR   /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/fs/
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/perf/event.h
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/threadmap.o
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/perf/mmap.h
  MKDIR   /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/fs/
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/internal/cpumap.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/internal/evlist.h
  MKDIR   /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/fs/
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/evsel.o
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/internal/evsel.h
  INSTALL libsymbol_headers
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/evlist.o
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/internal/lib.h
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/mmap.o
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/internal/mmap.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/internal/rc_check.h
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/zalloc.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/fd/array.o
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/internal/threadmap.h
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/fs/fs.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/xyarray.o
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/include/internal/xyarray.h
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/fs/tracing_path.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/lib.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/fs/cgroup.o
  INSTALL libapi_headers
  GEN     /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/bpf_helper_defs.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/include/bpf/bpf.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/include/bpf/libbpf.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/include/bpf/btf.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/include/bpf/libbpf_common.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/include/bpf/libbpf_legacy.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/include/bpf/bpf_helpers.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/include/bpf/bpf_tracing.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/include/bpf/bpf_endian.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/include/bpf/bpf_core_read.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/include/bpf/skel_internal.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/include/bpf/libbpf_version.h
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/include/bpf/usdt.bpf.h
  INSTALL libperf_headers
  LINK    dlfilters/dlfilter-show-cycles.so
  LINK    dlfilters/dlfilter-test-api-v0.so
  LINK    dlfilters/dlfilter-test-api-v2.so
  INSTALL /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/include/bpf/bpf_helper_defs.h
  MKDIR   /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/
  MKDIR   /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/
  INSTALL libbpf_headers
  MKDIR   /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/
  MKDIR   /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/libbpf.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/libbpf_errno.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/bpf.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/str_error.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/nlattr.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/btf.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/netlink.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/bpf_prog_linfo.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/libbpf_probes.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/hashmap.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/btf_dump.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/ringbuf.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/strset.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/linker.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/gen_loader.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/relo_core.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/usdt.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/zip.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/elf.o
  CC      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/features.o
  LD      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsymbol/libsymbol-in.o
  LD      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/fd/libapi-in.o
  AR      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsymbol/libsymbol.a
  LD      jvmti/jvmti-in.o
  LINK    libperf-jvmti.so
  LD      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/fs/libapi-in.o
  LD      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/libapi-in.o
  AR      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libapi/libapi.a
  LD      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/libperf-in.o
  AR      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libperf/libperf.a
  LD      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/libsubcmd-in.o
  AR      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libsubcmd/libsubcmd.a
  GEN     python/perf.cpython-311-x86_64-linux-gnu.so
  LD      /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/staticobjs/libbpf-in.o
  LINK    /usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/libbpf/libbpf.a
  CC      builtin-bench.o
  CC      builtin-annotate.o
  CC      builtin-config.o
  CC      builtin-diff.o
  CC      builtin-evlist.o
  CC      builtin-ftrace.o
  CC      builtin-help.o
  CC      builtin-buildid-list.o
  CC      builtin-buildid-cache.o
  CC      builtin-kallsyms.o
  CC      builtin-list.o
  CC      builtin-record.o
  CC      builtin-report.o
  CC      builtin-stat.o
  CC      builtin-top.o
  CC      builtin-script.o
  CC      builtin-kvm.o
  CC      builtin-inject.o
  CC      builtin-mem.o
  CC      builtin-data.o
  CC      builtin-version.o
  CC      builtin-c2c.o
  CC      builtin-daemon.o
  TEST    pmu-events/metric_test.log
  CC      builtin-kmem.o
  CC      builtin-kwork.o
  CC      builtin-lock.o
  CC      builtin-sched.o
  CC      builtin-timechart.o
  CC      builtin-trace.o
  CC      trace/beauty/clone.o
  CC      builtin-probe.o
  CC      perf.o
  CC      trace/beauty/fcntl.o
  CC      bench/sched-messaging.o
  CC      trace/beauty/flock.o
  CC      bench/sched-pipe.o
  CC      tests/builtin-test.o
  CC      trace/beauty/fs_at_flags.o
  CC      arch/common.o
  CC      tests/tests-scripts.o
  CC      bench/sched-seccomp-notify.o
  CC      bench/syscall.o
  CC      ui/setup.o
  CC      trace/beauty/fsmount.o
  CC      ui/helpline.o
  CC      tests/parse-events.o
  CC      trace/beauty/fspick.o
  CC      tests/dso-data.o
  CC      bench/mem-functions.o
  CC      bench/futex-hash.o
  CC      tests/attr.o
  CC      trace/beauty/ioctl.o
  CC      ui/util.o
  CC      ui/progress.o
  CC      tests/vmlinux-kallsyms.o
  CC      ui/hist.o
  CC      trace/beauty/kcmp.o
  CC      trace/beauty/mount_flags.o
  CC      tests/openat-syscall.o
  CC      trace/beauty/move_mount.o
  CC      bench/futex-wake.o
  CC      ui/stdio/hist.o
  CC      bench/futex-wake-parallel.o
  CC      tests/openat-syscall-all-cpus.o
  CC      scripts/perl/Perf-Trace-Util/Context.o
  CC      bench/futex-lock-pi.o
  CC      trace/beauty/arch_prctl.o
  CC      scripts/python/Perf-Trace-Util/Context.o
  CC      trace/beauty/pkey_alloc.o
  CC      ui/browser.o
  CC      bench/futex-requeue.o
  CC      tests/openat-syscall-tp-fields.o
  CC      tests/mmap-basic.o
  CC      tests/perf-record.o
  CC      trace/beauty/prctl.o
  CC      bench/epoll-wait.o
  CC      trace/beauty/renameat.o
  CC      bench/epoll-ctl.o
  CC      tests/evsel-roundtrip-name.o
  CC      trace/beauty/sockaddr.o
  CC      arch/x86/util/header.o
  CC      bench/synthesize.o
  CC      tests/evsel-tp-sched.o
  CC      trace/beauty/socket.o
  CC      trace/beauty/statx.o
  CC      bench/kallsyms-parse.o
  CC      tests/fdarray.o
  CC      arch/x86/util/tsc.o
  CC      arch/x86/tests/regs_load.o
  CC      bench/inject-buildid.o
  CC      bench/find-bit-bench.o
  CC      trace/beauty/timespec.o
  CC      tests/pmu.o
  CC      trace/beauty/sync_file_range.o
  CC      arch/x86/util/kvm-stat.o
  CC      arch/x86/tests/dwarf-unwind.o
  CC      arch/x86/util/pmu.o
  CC      arch/x86/tests/arch-tests.o
  CC      arch/x86/util/perf_regs.o
  CC      tests/pmu-events.o
  CC      ui/browsers/annotate-data.o
  CC      arch/x86/tests/sample-parsing.o
  CC      arch/x86/util/topdown.o
  CC      ui/browsers/annotate.o
  CC      tests/hists_common.o
  CC      bench/breakpoint.o
  CC      ui/tui/setup.o
  CC      bench/evlist-open-close.o
  CC      arch/x86/tests/hybrid.o
  CC      tests/hists_link.o
  CC      ui/browsers/hists.o
  CC      ui/tui/util.o
  CC      ui/tui/helpline.o
  CC      bench/uprobe.o
  CC      tests/hists_filter.o
  CC      ui/browsers/map.o
  CC      bench/pmu-scan.o
  CC      tests/hists_output.o
  CC      ui/tui/progress.o
  CC      arch/x86/tests/intel-pt-test.o
  CC      arch/x86/tests/amd-ibs-via-core-pmu.o
  CC      arch/x86/util/event.o
  CC      arch/x86/util/machine.o
  CC      arch/x86/tests/bp-modify.o
  CC      arch/x86/util/evlist.o
  CC      bench/mem-memcpy-x86-64-asm.o
  CC      tests/hists_cumulate.o
  CC      tests/python-use.o
  CC      ui/browsers/scripts.o
  CC      ui/browsers/header.o
  CC      ui/browsers/res_sample.o
  CC      bench/mem-memset-x86-64-asm.o
  CC      arch/x86/util/mem-events.o
  CC      bench/numa.o
  CC      tests/bp_signal_overflow.o
  CC      tests/bp_signal.o
  CC      arch/x86/util/evsel.o
  CC      tests/bp_account.o
  CC      arch/x86/util/iostat.o
  CC      tests/wp.o
  CC      trace/beauty/tracepoints/x86_msr.o
  CC      trace/beauty/tracepoints/x86_irq_vectors.o
  CC      arch/x86/util/env.o
  CC      arch/x86/util/dwarf-regs.o
  CC      tests/task-exit.o
  CC      arch/x86/util/unwind-libunwind.o
  CC      tests/sw-clock.o
  CC      tests/mmap-thread-lookup.o
  CC      arch/x86/util/archinsn.o
  CC      arch/x86/util/auxtrace.o
  CC      tests/thread-maps-share.o
  CC      tests/switch-tracking.o
  CC      arch/x86/util/intel-pt.o
  CC      tests/keep-tracking.o
  CC      arch/x86/util/intel-bts.o
  CC      tests/code-reading.o
  CC      tests/sample-parsing.o
  CC      tests/parse-no-sample-id-all.o
  CC      tests/kmod-path.o
  CC      tests/thread-map.o
  CC      tests/topology.o
  CC      tests/mem.o
  CC      tests/cpumap.o
  CC      tests/stat.o
  CC      tests/event_update.o
  CC      tests/event-times.o
  CC      tests/expr.o
  CC      tests/backward-ring-buffer.o
  CC      tests/sdt.o
  CC      tests/is_printable_array.o
  CC      tests/perf-hooks.o
  CC      tests/bitmap.o
  CC      tests/mem2node.o
  CC      tests/unit_number__scnprintf.o
  CC      tests/maps.o
  CC      tests/time-utils-test.o
  CC      tests/genelf.o
  CC      tests/api-io.o
  CC      tests/demangle-java-test.o
  CC      tests/demangle-ocaml-test.o
  CC      tests/pfm.o
  CC      tests/parse-metric.o
  CC      tests/pe-file-parsing.o
  CC      tests/expand-cgroup.o
  CC      tests/perf-time-to-tsc.o
  CC      tests/dlfilter-test.o
  CC      tests/sigtrap.o
  CC      tests/event_groups.o
  CC      tests/symbols.o
  CC      tests/util.o
  CC      tests/dwarf-unwind.o
  CC      tests/workloads/noploop.o
  CC      tests/workloads/thloop.o
  CC      tests/workloads/leafloop.o
  CC      tests/workloads/sqrtloop.o
  CC      tests/workloads/brstack.o
  CC      tests/workloads/datasym.o
  GEN     pmu-events/test-empty-pmu-events.c
  CC      util/arm64-frame-pointer-unwind-support.o
  CC      util/addr_location.o
  CC      util/annotate.o
  CC      util/block-info.o
  CC      util/build-id.o
  CC      util/block-range.o
  CC      util/cacheline.o
  CC      util/config.o
  CC      util/copyfile.o
  CC      util/ctype.o
  CC      util/db-export.o
  CC      util/disasm.o
  CC      util/event.o
  CC      util/env.o
  CC      util/evlist.o
  CC      util/sideband_evlist.o
  CC      util/evsel.o
  CC      util/evsel_fprintf.o
  CC      util/perf_event_attr_fprintf.o
  CC      util/evswitch.o
  CC      util/find_bit.o
  CC      util/get_current_dir_name.o
  CC      util/levenshtein.o
  CC      util/mmap.o
  CC      util/memswap.o
  BISON   util/parse-events-bison.c
  CC      util/print-events.o
  CC      util/tracepoint.o
  TEST    pmu-events/empty-pmu-events.log
  CC      util/perf_regs.o
--- pmu-events/empty-pmu-events.c	2024-05-30 08:20:10.000000000 +0000
+++ pmu-events/test-empty-pmu-events.c	2024-05-30 15:55:37.332495538 +0000
@@ -136,7 +136,7 @@
 { 2623 }, /* M3\000\0001 / M3\000\000\000\000\000\000\000\00000 */
 { 2078 }, /* cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000 */
 { 1947 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
-{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retiredany\000\000\000\000\000\000\000\00000 */
+{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
 
 };
 
@@ -373,7 +373,7 @@
 {
         for (size_t i = 0; i < table->num_pmus; i++) {
                 const struct pmu_table_entry *table_pmu = &table->pmus[i];
-                const char *pmu_name = &big_c_string[table_pmu->pmu_nameoffset];
+                const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset];
                 int ret;
 
                 if (pmu && !pmu__name_match(pmu, pmu_name))
@@ -394,7 +394,7 @@
 {
         for (size_t i = 0; i < table->num_pmus; i++) {
                 const struct pmu_table_entry *table_pmu = &table->pmus[i];
-                const char *pmu_name = &big_c_string[table_pmu->pmu_nameoffset];
+                const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset];
                 int ret;
 
                 if (!pmu__name_match(pmu, pmu_name))
@@ -414,7 +414,7 @@
 
         for (size_t i = 0; i < table->num_pmus; i++) {
                 const struct pmu_table_entry *table_pmu = &table->pmus[i];
-                const char *pmu_name = &big_c_string[table_pmu->pmu_nameoffset];
+                const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset];
 
                 if (pmu__name_match(pmu, pmu_name))
                         count += table_pmu->num_entries;
@@ -524,7 +524,7 @@
 
         for (size_t i = 0; i < map->event_table.num_pmus; i++) {
                 const struct pmu_table_entry *table_pmu = &map->event_table.pmus[i];
-                const char *pmu_name = &big_c_string[table_pmu->pmu_nameoffset];
+                const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset];
 
                 if (pmu__name_match(pmu, pmu_name))
                          return &map->event_table;
@@ -544,7 +544,7 @@
 
         for (size_t i = 0; i < map->metric_table.num_pmus; i++) {
                 const struct pmu_table_entry *table_pmu = &map->metric_table.pmus[i];
-                const char *pmu_name = &big_c_string[table_pmu->pmu_nameoffset];
+                const char *pmu_name = &big_c_string[table_pmu->pmu_name.offset];
 
                 if (pmu__name_match(pmu, pmu_name))
                            return &map->metric_table;
  CC      util/perf-regs-arch/perf_regs_aarch64.o
  CC      util/intel-pt-decoder/intel-pt-pkt-decoder.o
  CC      util/arm-spe-decoder/arm-spe-pkt-decoder.o
  CC      util/perf-regs-arch/perf_regs_arm.o
  GEN     util/intel-pt-decoder/inat-tables.c
  CC      util/arm-spe-decoder/arm-spe-decoder.o
  CC      util/intel-pt-decoder/intel-pt-log.o
  CC      util/perf-regs-arch/perf_regs_csky.o
  CC      util/intel-pt-decoder/intel-pt-decoder.o
  CC      util/perf-regs-arch/perf_regs_loongarch.o
  CC      util/hisi-ptt-decoder/hisi-ptt-pkt-decoder.o
  CC      util/perf-regs-arch/perf_regs_mips.o
  CC      util/perf-regs-arch/perf_regs_powerpc.o
  CC      util/path.o
  CC      util/perf-regs-arch/perf_regs_riscv.o
  CC      util/perf-regs-arch/perf_regs_s390.o
  CC      util/scripting-engines/trace-event-perl.o
  CC      util/perf-regs-arch/perf_regs_x86.o
  CC      util/scripting-engines/trace-event-python.o
  CC      util/print_binary.o
  CC      util/print_insn.o
  CC      util/rlimit.o
  CC      util/argv_split.o
  CC      util/bitmap.o
  CC      util/rbtree.o
  CC      util/libstring.o
  CC      util/hweight.o
  CC      util/smt.o
  CC      util/strbuf.o
  CC      util/string.o
  LD      trace/beauty/tracepoints/perf-in.o
  CC      util/strlist.o
  CC      util/top.o
  CC      util/strfilter.o
  CC      util/usage.o
  CC      util/dsos.o
  CC      util/symbol.o
  CC      util/symbol_fprintf.o
  CC      util/dso.o
  CC      util/map_symbol.o
  CC      util/color.o
  CC      util/color_config.o
  CC      util/metricgroup.o
  CC      util/header.o
  CC      util/callchain.o
  CC      util/debug.o
  CC      util/values.o
  CC      util/fncache.o
  CC      util/machine.o
  CC      util/map.o
  CC      util/maps.o
  CC      util/pstack.o
  CC      util/session.o
  CC      util/sample-raw.o
  CC      util/s390-sample-raw.o
  LD      trace/beauty/perf-in.o
  CC      util/amd-sample-raw.o
  CC      util/syscalltbl.o
  CC      util/ordered-events.o
  CC      util/namespaces.o
  CC      util/comm.o
  CC      util/thread.o
  CC      util/threads.o
  CC      util/thread_map.o
  CC      util/parse-events-bison.o
  BISON   util/pmu-bison.c
  CC      util/pmus.o
  CC      util/svghelper.o
  CC      util/trace-event-info.o
  CC      util/trace-event-scripting.o
  CC      util/trace-event.o
  CC      util/trace-event-parse.o
  CC      util/trace-event-read.o
  CC      util/sort.o
  CC      util/hist.o
  CC      util/util.o
  CC      util/cpumap.o
  CC      util/affinity.o
  CC      util/cputopo.o
  CC      util/cgroup.o
  CC      util/target.o
  CC      util/rblist.o
  CC      util/intlist.o
  CC      util/vdso.o
  CC      util/counts.o
  CC      util/stat.o
  CC      util/stat-shadow.o
  CC      util/stat-display.o
  CC      util/perf_api_probe.o
  CC      util/record.o
  CC      util/srcline.o
  CC      util/srccode.o
  CC      util/synthetic-events.o
  CC      util/data.o
  CC      util/tsc.o
  CC      util/cloexec.o
  CC      util/call-path.o
  CC      util/rwsem.o
  CC      util/thread-stack.o
  CC      util/spark.o
  CC      util/topdown.o
  CC      util/iostat.o
  LD      tests/workloads/perf-in.o
  CC      util/stream.o
  CC      util/auxtrace.o
  LD      util/perf-regs-arch/perf-in.o
  CC      util/intel-pt.o
  CC      util/intel-bts.o
  CC      util/arm-spe.o
  CC      util/hisi-ptt.o
  CC      util/s390-cpumsf.o
  CC      util/cs-etm-base.o
  CC      util/parse-branch-options.o
  CC      util/dump-insn.o
  CC      util/parse-regs-options.o
  CC      util/help-unknown-cmd.o
  CC      util/term.o
  CC      util/parse-sublevel-options.o
  CC      util/dlfilter.o
  CC      util/mem-info.o
  CC      util/mem-events.o
  CC      util/vsprintf.o
  CC      util/units.o
  CC      util/time-utils.o
  BISON   util/expr-bison.c
  CC      util/mem2node.o
  CC      util/clockid.o
  LD      ui/tui/perf-in.o
  CC      util/branch.o
  CC      util/list_sort.o
  CC      util/mutex.o
  CC      util/sharded_mutex.o
  CC      util/bpf_map.o
  CC      util/symbol-elf.o
  CC      util/probe-file.o
  CC      util/probe-event.o
  CC      util/probe-finder.o
  CC      util/dwarf-aux.o
  CC      util/dwarf-regs.o
  CC      util/debuginfo.o
  CC      util/annotate-data.o
  CC      util/unwind-libunwind-local.o
  CC      util/unwind-libunwind.o
  CC      util/data-convert-bt.o
  CC      util/lzma.o
  CC      util/zlib.o
  CC      util/data-convert-json.o
  CC      util/zstd.o
  CC      util/cap.o
  CXX     util/demangle-cxx.o
  CC      util/demangle-java.o
  CC      util/demangle-ocaml.o
  CC      util/demangle-rust.o
  CC      util/jitdump.o
  CC      util/genelf.o
  CC      util/genelf_debug.o
  CC      util/perf-hooks.o
  CC      util/bpf-event.o
  CC      util/bpf-utils.o
  CC      util/pfm.o
  FLEX    util/parse-events-flex.c
  FLEX    util/pmu-flex.c
  CC      util/pmu-bison.o
  FLEX    util/expr-flex.c
  CC      util/intel-pt-decoder/intel-pt-insn-decoder.o
  CC      util/expr-bison.o
  LD      util/hisi-ptt-decoder/perf-in.o
  LD      arch/x86/tests/perf-in.o
  CC      util/pmu.o
  CC      util/pmu-flex.o
  CC      util/expr-flex.o
  CC      util/expr.o
  CC      util/parse-events.o
  CC      util/parse-events-flex.o
  LD      scripts/python/Perf-Trace-Util/perf-in.o
  LD      util/arm-spe-decoder/perf-in.o
  LD      arch/x86/util/perf-in.o
  LD      arch/x86/perf-in.o
  LD      arch/perf-in.o
  LD      scripts/perl/Perf-Trace-Util/perf-in.o
  LD      scripts/perf-in.o
  LD      bench/perf-in.o
  LD      tests/perf-in.o
  LD      util/scripting-engines/perf-in.o
  LD      ui/browsers/perf-in.o
  LD      ui/perf-in.o
  LD      util/intel-pt-decoder/perf-in.o
  LD      util/perf-in.o
  LD      perf-in.o
make: Leaving directory '/usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf'
make perf failed

make[3]: *** [pmu-events/Build:42: pmu-events/empty-pmu-events.log] Error 1
make[3]: *** Deleting file 'pmu-events/empty-pmu-events.log'
make[2]: *** [Makefile.perf:730: pmu-events/pmu-events-in.o] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile.perf:264: sub-make] Error 2
make: *** [Makefile:70: all] Error 2



The kernel config and materials to reproduce are available at:
https://download.01.org/0day-ci/archive/20240531/202405311548.1e881dea-oliver.sang@intel.com



-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c
  2024-05-31  8:16   ` kernel test robot
@ 2024-05-31 16:38     ` Ian Rogers
  2024-06-03 14:19       ` Oliver Sang
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Rogers @ 2024-05-31 16:38 UTC (permalink / raw)
  To: kernel test robot
  Cc: oe-lkp, lkp, linux-perf-users, linux-kernel, Weilin Wang,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, Kan Liang, Jing Zhang, John Garry, Sandipan Das

On Fri, May 31, 2024 at 1:16 AM kernel test robot <oliver.sang@intel.com> wrote:
>
>
> hi, Ian Rogers,
>
> we actually want to seek your advice. in our env, there is no problem to build
> parent.
>
> * 3249f8b84526d (linux-review/Ian-Rogers/perf-jevents-Autogenerate-empty-pmu-events-c/20240525-093240) perf jevents: Autogenerate empty-pmu-events.c
> * 7d88bd0d22746 perf jevents: Use name for special find value   <--- parent
>
> however, failed to build perf upon 3249f8b84526d. but there is not many useful
> information in below detail log.
>
> is there any dependency or env setting for us to build this commit? Thanks!

Hi Oliver,

Thanks for the report and the work testing! Seeing the output:

[..snip..]
> --- pmu-events/empty-pmu-events.c       2024-05-30 08:20:10.000000000 +0000
> +++ pmu-events/test-empty-pmu-events.c  2024-05-30 15:55:37.332495538 +0000
> @@ -136,7 +136,7 @@
>  { 2623 }, /* M3\000\0001 / M3\000\000\000\000\000\000\000\00000 */
>  { 2078 }, /* cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000 */
>  { 1947 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> -{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retiredany\000\000\000\000\000\000\000\00000 */
> +{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
>
>  };
>
> @@ -373,7 +373,7 @@
[..snip..]

It appears the version of empty-pmu-events.c the patch adds and the
version generated in your test configuration are differing because of
whitespace. Perhaps a hex editor will show what the exact difference
is, it must relate to locales or something. Like you mention this
could be resolved by an env change.

> The kernel config and materials to reproduce are available at:
> https://download.01.org/0day-ci/archive/20240531/202405311548.1e881dea-oliver.sang@intel.com

I didn't see the generated test-empty-pmu-events.c there and so
couldn't follow up on the locale/env exploration. I wonder that a
suitable workaround is to change from the patch:

+$(EMPTY_PMU_EVENTS_TEST_LOG): $(EMPTY_PMU_EVENTS_C) $(TEST_EMPTY_PMU_EVENTS_C)
+       $(call rule_mkdir)
+       $(Q)$(call echo-cmd,test)diff -u $? 2> $@ || (cat $@ && false)

to instead of invoking "diff -u" to invoke "diff -w -u", that is to
ignore whitespace. I can send a v3 with this.

Thanks,
Ian

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c
  2024-05-31 16:38     ` Ian Rogers
@ 2024-06-03 14:19       ` Oliver Sang
  2024-06-03 15:46         ` Ian Rogers
  0 siblings, 1 reply; 15+ messages in thread
From: Oliver Sang @ 2024-06-03 14:19 UTC (permalink / raw)
  To: Ian Rogers
  Cc: oe-lkp, lkp, linux-perf-users, linux-kernel, Weilin Wang,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, Kan Liang, Jing Zhang, John Garry, Sandipan Das,
	oliver.sang

hi, Ian,

On Fri, May 31, 2024 at 09:38:01AM -0700, Ian Rogers wrote:
> On Fri, May 31, 2024 at 1:16 AM kernel test robot <oliver.sang@intel.com> wrote:
> >
> >
> > hi, Ian Rogers,
> >
> > we actually want to seek your advice. in our env, there is no problem to build
> > parent.
> >
> > * 3249f8b84526d (linux-review/Ian-Rogers/perf-jevents-Autogenerate-empty-pmu-events-c/20240525-093240) perf jevents: Autogenerate empty-pmu-events.c
> > * 7d88bd0d22746 perf jevents: Use name for special find value   <--- parent
> >
> > however, failed to build perf upon 3249f8b84526d. but there is not many useful
> > information in below detail log.
> >
> > is there any dependency or env setting for us to build this commit? Thanks!
> 
> Hi Oliver,
> 
> Thanks for the report and the work testing! Seeing the output:
> 
> [..snip..]
> > --- pmu-events/empty-pmu-events.c       2024-05-30 08:20:10.000000000 +0000
> > +++ pmu-events/test-empty-pmu-events.c  2024-05-30 15:55:37.332495538 +0000
> > @@ -136,7 +136,7 @@
> >  { 2623 }, /* M3\000\0001 / M3\000\000\000\000\000\000\000\00000 */
> >  { 2078 }, /* cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000 */
> >  { 1947 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> > -{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retiredany\000\000\000\000\000\000\000\00000 */
> > +{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> >
> >  };
> >
> > @@ -373,7 +373,7 @@
> [..snip..]
> 
> It appears the version of empty-pmu-events.c the patch adds and the
> version generated in your test configuration are differing because of
> whitespace. Perhaps a hex editor will show what the exact difference
> is, it must relate to locales or something. Like you mention this
> could be resolved by an env change.
> 
> > The kernel config and materials to reproduce are available at:
> > https://download.01.org/0day-ci/archive/20240531/202405311548.1e881dea-oliver.sang@intel.com
> 
> I didn't see the generated test-empty-pmu-events.c there and so
> couldn't follow up on the locale/env exploration. I wonder that a
> suitable workaround is to change from the patch:
> 
> +$(EMPTY_PMU_EVENTS_TEST_LOG): $(EMPTY_PMU_EVENTS_C) $(TEST_EMPTY_PMU_EVENTS_C)
> +       $(call rule_mkdir)
> +       $(Q)$(call echo-cmd,test)diff -u $? 2> $@ || (cat $@ && false)
> 
> to instead of invoking "diff -u" to invoke "diff -w -u", that is to
> ignore whitespace. I can send a v3 with this.

I tried below patch

commit a79a41133a41adc2d69c8f603c7d880b3796cbf7 
Author: 0day robot <lkp@intel.com>
Date:   Mon Jun 3 16:35:45 2024 +0800

    fix from Ian Rogers: invoke "diff -w -u" instead of "diff -u"

diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
index c3fa43c497069..54d19b492db5c 100644
--- a/tools/perf/pmu-events/Build
+++ b/tools/perf/pmu-events/Build
@@ -39,7 +39,7 @@ $(TEST_EMPTY_PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(ME

 $(EMPTY_PMU_EVENTS_TEST_LOG): $(EMPTY_PMU_EVENTS_C) $(TEST_EMPTY_PMU_EVENTS_C)
        $(call rule_mkdir)
-       $(Q)$(call echo-cmd,test)diff -u $? 2> $@ || (cat $@ && false)
+       $(Q)$(call echo-cmd,test)diff -w -u $? 2> $@ || (cat $@ && false)

 $(PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(METRIC_TEST_LOG) $(EMPTY_PMU_EVENTS_TEST_LOG)
        $(call rule_mkdir)


but make still failed. I still saw below in our build log

--- pmu-events/empty-pmu-events.c       2024-06-03 08:41:16.000000000 +0000
+++ pmu-events/test-empty-pmu-events.c  2024-06-03 13:47:19.522463482 +0000
@@ -136,7 +136,7 @@
 { 2623 }, /* M3\000\0001 / M3\000\000\000\000\000\000\000\00000 */
 { 2078 }, /* cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000 */
 { 1947 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
-{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retiredany\000\000\000\000\000\000\000\00000 */
+{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */

 };


I will try to get generated test-empty-pmu-events.c tomorrow.

> 
> Thanks,
> Ian

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c
  2024-06-03 14:19       ` Oliver Sang
@ 2024-06-03 15:46         ` Ian Rogers
  2024-06-12 21:46           ` Ian Rogers
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Rogers @ 2024-06-03 15:46 UTC (permalink / raw)
  To: Oliver Sang
  Cc: oe-lkp, lkp, linux-perf-users, linux-kernel, Weilin Wang,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, Kan Liang, Jing Zhang, John Garry, Sandipan Das

On Mon, Jun 3, 2024 at 7:19 AM Oliver Sang <oliver.sang@intel.com> wrote:
>
> hi, Ian,
>
> On Fri, May 31, 2024 at 09:38:01AM -0700, Ian Rogers wrote:
> > On Fri, May 31, 2024 at 1:16 AM kernel test robot <oliver.sang@intel.com> wrote:
> > >
> > >
> > > hi, Ian Rogers,
> > >
> > > we actually want to seek your advice. in our env, there is no problem to build
> > > parent.
> > >
> > > * 3249f8b84526d (linux-review/Ian-Rogers/perf-jevents-Autogenerate-empty-pmu-events-c/20240525-093240) perf jevents: Autogenerate empty-pmu-events.c
> > > * 7d88bd0d22746 perf jevents: Use name for special find value   <--- parent
> > >
> > > however, failed to build perf upon 3249f8b84526d. but there is not many useful
> > > information in below detail log.
> > >
> > > is there any dependency or env setting for us to build this commit? Thanks!
> >
> > Hi Oliver,
> >
> > Thanks for the report and the work testing! Seeing the output:
> >
> > [..snip..]
> > > --- pmu-events/empty-pmu-events.c       2024-05-30 08:20:10.000000000 +0000
> > > +++ pmu-events/test-empty-pmu-events.c  2024-05-30 15:55:37.332495538 +0000
> > > @@ -136,7 +136,7 @@
> > >  { 2623 }, /* M3\000\0001 / M3\000\000\000\000\000\000\000\00000 */
> > >  { 2078 }, /* cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000 */
> > >  { 1947 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> > > -{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retiredany\000\000\000\000\000\000\000\00000 */
> > > +{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> > >
> > >  };
> > >
> > > @@ -373,7 +373,7 @@
> > [..snip..]
> >
> > It appears the version of empty-pmu-events.c the patch adds and the
> > version generated in your test configuration are differing because of
> > whitespace. Perhaps a hex editor will show what the exact difference
> > is, it must relate to locales or something. Like you mention this
> > could be resolved by an env change.
> >
> > > The kernel config and materials to reproduce are available at:
> > > https://download.01.org/0day-ci/archive/20240531/202405311548.1e881dea-oliver.sang@intel.com
> >
> > I didn't see the generated test-empty-pmu-events.c there and so
> > couldn't follow up on the locale/env exploration. I wonder that a
> > suitable workaround is to change from the patch:
> >
> > +$(EMPTY_PMU_EVENTS_TEST_LOG): $(EMPTY_PMU_EVENTS_C) $(TEST_EMPTY_PMU_EVENTS_C)
> > +       $(call rule_mkdir)
> > +       $(Q)$(call echo-cmd,test)diff -u $? 2> $@ || (cat $@ && false)
> >
> > to instead of invoking "diff -u" to invoke "diff -w -u", that is to
> > ignore whitespace. I can send a v3 with this.
>
> I tried below patch
>
> commit a79a41133a41adc2d69c8f603c7d880b3796cbf7
> Author: 0day robot <lkp@intel.com>
> Date:   Mon Jun 3 16:35:45 2024 +0800
>
>     fix from Ian Rogers: invoke "diff -w -u" instead of "diff -u"
>
> diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
> index c3fa43c497069..54d19b492db5c 100644
> --- a/tools/perf/pmu-events/Build
> +++ b/tools/perf/pmu-events/Build
> @@ -39,7 +39,7 @@ $(TEST_EMPTY_PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(ME
>
>  $(EMPTY_PMU_EVENTS_TEST_LOG): $(EMPTY_PMU_EVENTS_C) $(TEST_EMPTY_PMU_EVENTS_C)
>         $(call rule_mkdir)
> -       $(Q)$(call echo-cmd,test)diff -u $? 2> $@ || (cat $@ && false)
> +       $(Q)$(call echo-cmd,test)diff -w -u $? 2> $@ || (cat $@ && false)
>
>  $(PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(METRIC_TEST_LOG) $(EMPTY_PMU_EVENTS_TEST_LOG)
>         $(call rule_mkdir)
>
>
> but make still failed. I still saw below in our build log
>
> --- pmu-events/empty-pmu-events.c       2024-06-03 08:41:16.000000000 +0000
> +++ pmu-events/test-empty-pmu-events.c  2024-06-03 13:47:19.522463482 +0000
> @@ -136,7 +136,7 @@
>  { 2623 }, /* M3\000\0001 / M3\000\000\000\000\000\000\000\00000 */
>  { 2078 }, /* cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000 */
>  { 1947 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> -{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retiredany\000\000\000\000\000\000\000\00000 */
> +{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
>
>  };
>
>
> I will try to get generated test-empty-pmu-events.c tomorrow.

Thanks Oliver, if you could get the environment variables that would
probably also be useful.

Ian

> >
> > Thanks,
> > Ian

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c
  2024-06-03 15:46         ` Ian Rogers
@ 2024-06-12 21:46           ` Ian Rogers
  2024-06-13  3:04             ` Oliver Sang
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Rogers @ 2024-06-12 21:46 UTC (permalink / raw)
  To: Oliver Sang
  Cc: oe-lkp, lkp, linux-perf-users, linux-kernel, Weilin Wang,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, Kan Liang, Jing Zhang, John Garry, Sandipan Das

On Mon, Jun 3, 2024 at 8:46 AM Ian Rogers <irogers@google.com> wrote:
>
> On Mon, Jun 3, 2024 at 7:19 AM Oliver Sang <oliver.sang@intel.com> wrote:
[...]
> > I tried below patch
> >
> > commit a79a41133a41adc2d69c8f603c7d880b3796cbf7
> > Author: 0day robot <lkp@intel.com>
> > Date:   Mon Jun 3 16:35:45 2024 +0800
> >
> >     fix from Ian Rogers: invoke "diff -w -u" instead of "diff -u"
> >
> > diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
> > index c3fa43c497069..54d19b492db5c 100644
> > --- a/tools/perf/pmu-events/Build
> > +++ b/tools/perf/pmu-events/Build
> > @@ -39,7 +39,7 @@ $(TEST_EMPTY_PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(ME
> >
> >  $(EMPTY_PMU_EVENTS_TEST_LOG): $(EMPTY_PMU_EVENTS_C) $(TEST_EMPTY_PMU_EVENTS_C)
> >         $(call rule_mkdir)
> > -       $(Q)$(call echo-cmd,test)diff -u $? 2> $@ || (cat $@ && false)
> > +       $(Q)$(call echo-cmd,test)diff -w -u $? 2> $@ || (cat $@ && false)
> >
> >  $(PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(METRIC_TEST_LOG) $(EMPTY_PMU_EVENTS_TEST_LOG)
> >         $(call rule_mkdir)
> >
> >
> > but make still failed. I still saw below in our build log
> >
> > --- pmu-events/empty-pmu-events.c       2024-06-03 08:41:16.000000000 +0000
> > +++ pmu-events/test-empty-pmu-events.c  2024-06-03 13:47:19.522463482 +0000
> > @@ -136,7 +136,7 @@
> >  { 2623 }, /* M3\000\0001 / M3\000\000\000\000\000\000\000\00000 */
> >  { 2078 }, /* cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000 */
> >  { 1947 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> > -{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retiredany\000\000\000\000\000\000\000\00000 */
> > +{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> >
> >  };
> >
> >
> > I will try to get generated test-empty-pmu-events.c tomorrow.
>
> Thanks Oliver, if you could get the environment variables that would
> probably also be useful.

Hi Oliver, any update on this?

Thanks,
Ian

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c
  2024-06-12 21:46           ` Ian Rogers
@ 2024-06-13  3:04             ` Oliver Sang
  2024-07-16  0:23               ` Ian Rogers
  0 siblings, 1 reply; 15+ messages in thread
From: Oliver Sang @ 2024-06-13  3:04 UTC (permalink / raw)
  To: Ian Rogers
  Cc: oe-lkp, lkp, linux-perf-users, linux-kernel, Weilin Wang,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, Kan Liang, Jing Zhang, John Garry, Sandipan Das,
	oliver.sang

[-- Attachment #1: Type: text/plain, Size: 8803 bytes --]

hi, Ian,

On Wed, Jun 12, 2024 at 02:46:43PM -0700, Ian Rogers wrote:
> On Mon, Jun 3, 2024 at 8:46 AM Ian Rogers <irogers@google.com> wrote:
> >
> > On Mon, Jun 3, 2024 at 7:19 AM Oliver Sang <oliver.sang@intel.com> wrote:
> [...]
> > > I tried below patch
> > >
> > > commit a79a41133a41adc2d69c8f603c7d880b3796cbf7
> > > Author: 0day robot <lkp@intel.com>
> > > Date:   Mon Jun 3 16:35:45 2024 +0800
> > >
> > >     fix from Ian Rogers: invoke "diff -w -u" instead of "diff -u"
> > >
> > > diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
> > > index c3fa43c497069..54d19b492db5c 100644
> > > --- a/tools/perf/pmu-events/Build
> > > +++ b/tools/perf/pmu-events/Build
> > > @@ -39,7 +39,7 @@ $(TEST_EMPTY_PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(ME
> > >
> > >  $(EMPTY_PMU_EVENTS_TEST_LOG): $(EMPTY_PMU_EVENTS_C) $(TEST_EMPTY_PMU_EVENTS_C)
> > >         $(call rule_mkdir)
> > > -       $(Q)$(call echo-cmd,test)diff -u $? 2> $@ || (cat $@ && false)
> > > +       $(Q)$(call echo-cmd,test)diff -w -u $? 2> $@ || (cat $@ && false)
> > >
> > >  $(PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(METRIC_TEST_LOG) $(EMPTY_PMU_EVENTS_TEST_LOG)
> > >         $(call rule_mkdir)
> > >
> > >
> > > but make still failed. I still saw below in our build log
> > >
> > > --- pmu-events/empty-pmu-events.c       2024-06-03 08:41:16.000000000 +0000
> > > +++ pmu-events/test-empty-pmu-events.c  2024-06-03 13:47:19.522463482 +0000
> > > @@ -136,7 +136,7 @@
> > >  { 2623 }, /* M3\000\0001 / M3\000\000\000\000\000\000\000\00000 */
> > >  { 2078 }, /* cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000 */
> > >  { 1947 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> > > -{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retiredany\000\000\000\000\000\000\000\00000 */
> > > +{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> > >
> > >  };
> > >
> > >
> > > I will try to get generated test-empty-pmu-events.c tomorrow.
> >
> > Thanks Oliver, if you could get the environment variables that would
> > probably also be useful.
> 
> Hi Oliver, any update on this?

sorry for late.

I pack whole pmu-events folder as attached pmu-events.tar.gz

below is the env variables

declare -x ARCH="x86_64"
declare -x BENCHMARK_ROOT="/lkp/benchmarks"
declare -x BOOT_IMAGE="/pkg/linux/x86_64-rhel-8.3-bpf/gcc-13/3249f8b84526d3b69162812908c257ee9816a237/vmlinuz-6.9.0-11004-g3249f8b84526"
declare -x DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/0/bus"
declare -x HISTSIZE="51200"
declare -x HOME="/root"
declare -x HOSTNAME="lkp-spr-2sp1"
declare -x LANG="en_US.UTF-8"
declare -x LC_ADDRESS="zh_CN.UTF-8"
declare -x LC_IDENTIFICATION="zh_CN.UTF-8"
declare -x LC_MEASUREMENT="zh_CN.UTF-8"
declare -x LC_MONETARY="zh_CN.UTF-8"
declare -x LC_NAME="zh_CN.UTF-8"
declare -x LC_NUMERIC="zh_CN.UTF-8"
declare -x LC_PAPER="zh_CN.UTF-8"
declare -x LC_TELEPHONE="zh_CN.UTF-8"
declare -x LC_TIME="zh_CN.UTF-8"
declare -x LESS="-MRiqscj5"
declare -x LESSCLOSE="/usr/bin/lesspipe %s %s"
declare -x LESSOPEN="| /usr/bin/lesspipe %s"
declare -x LOGNAME="root"
declare -x LS_COLORS
declare -x MOTD_SHOWN="pam"
declare -x OLDPWD="/usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf/pmu-events"
declare -x PAGER="less"
declare -x PATH="/root/bin:/usr/local/sbin:/usr/local/bin:/usr/lib/git-core:/usr/sbin:/usr/bin:/sbin:/bin:/lkp/xsang/src/bin"
declare -x PS1="\\[\\033[0m\\]\\[\\033[1;30m\\]\\[\\033[1;31m\\]\\u\\[\\033[1;30m\\]@\\[\\033[1;34m\\]\\h\\[\\033[1;30m\\] \\[\\033[0;37m\\033[4m\\]\\w\\[\\033[0m\\]\\[\\033[1;30m\\]\\[\\033[0;31m\\]# \\[\\033[0;37m\\]"
declare -x PS2="\\[\\033[1;30m\\]> \\[\\033[0;37m\\]"
declare -x PWD="/usr/src/perf_selftests-x86_64-rhel-8.3-bpf-3249f8b84526d3b69162812908c257ee9816a237/tools/perf"
declare -x RESULT_ROOT="/result/perf-sanity-tests/gcc/lkp-spr-2sp1/debian-12-x86_64-20240206.cgz/x86_64-rhel-8.3-bpf/gcc-13/3249f8b84526d3b69162812908c257ee9816a237/20"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x TERM="linux"
declare -x USER="root"
declare -x XAUTHORITY="/root/.Xauthority"
declare -x XDG_RUNTIME_DIR="/run/user/0"
declare -x XDG_SESSION_CLASS="user"
declare -x XDG_SESSION_ID="2"
declare -x XDG_SESSION_TYPE="tty"
declare -x _rt="/result/perf-sanity-tests/gcc/lkp-spr-2sp1/debian-12-x86_64-20240206.cgz/x86_64-rhel-8.3-bpf/gcc-13/3249f8b84526d3b69162812908c257ee9816a237"
declare -x acpi_rsdp="0x777fe014"
declare -x apic="debug"
declare -x arch="x86_64"
declare -x base_commit="a38297e3fb012ddfa7ce0321a7e5a8daeb1872b6"
declare -x bootloader_append=$'root=/dev/ram0\nRESULT_ROOT=/result/perf-sanity-tests/gcc/lkp-spr-2sp1/debian-12-x86_64-20240206.cgz/x86_64-rhel-8.3-bpf/gcc-13/3249f8b84526d3b69162812908c257ee9816a237/20\nBOOT_IMAGE=/pkg/linux/x86_64-rhel-8.3-bpf/gcc-13/3249f8b84526d3b69162812908c257ee9816a237/vmlinuz-6.9.0-11004-g3249f8b84526\nbranch=linux-review/Ian-Rogers/perf-jevents-Autogenerate-empty-pmu-events-c/20240525-093240\njob=/lkp/jobs/scheduled/lkp-spr-2sp1/perf-sanity-tests-gcc-debian-12-x86_64-20240206.cgz-3249f8b84526-20240613-8245-291s0m-0.yaml\nuser=xsang\nARCH=x86_64\nkconfig=x86_64-rhel-8.3-bpf\ncommit=3249f8b84526d3b69162812908c257ee9816a237\nnmi_watchdog=0\nintremap=posted_msi\nacpi_rsdp=0x777fe014\nmax_uptime=1200\nLKP_SERVER=internal-lkp-server\nnokaslr\nselinux=0\ndebug\napic=debug\nsysrq_always_enabled\nrcupdate.rcu_cpu_stall_timeout=100\nnet.ifnames=0\nprintk.devkmsg=on\npanic=-1\nsoftlockup_panic=1\nnmi_watchdog=panic\noops=panic\nload_ramdisk=2\nprompt_ramdisk=0\ndrbd.minor_count=8\nsystemd.log_level=err\nignore_loglevel\nconsole=tty0\nearlyprintk=ttyS0,115200\nconsole=ttyS0,115200\nvga=normal\nrw'
declare -x branch="linux-review/Ian-Rogers/perf-jevents-Autogenerate-empty-pmu-events-c/20240525-093240"
declare -x brand="Intel(R) Xeon(R) Platinum 8480+"
declare -x category="functional"
declare -x commit="3249f8b84526d3b69162812908c257ee9816a237"
declare -x compiler="gcc-13"
declare -x console="tty0"
declare -x enqueue_time="2024-06-13 09:44:38 +0800"
declare -x head_commit="e2c0a3562d2f7822c36edaf8449abbb95db9bd86"
declare -x id="321340fbc98d04a39a68e8fdcfd2415a4c02fe1b"
declare -x initrd="/osimage/debian/debian-12-x86_64-20240206.cgz"
declare -x initrds="linux_perf"
declare -x intremap="posted_msi"
declare -x ip="::::lkp-spr-2sp1::dhcp"
declare -x job="/lkp/jobs/scheduled/lkp-spr-2sp1/perf-sanity-tests-gcc-debian-12-x86_64-20240206.cgz-3249f8b84526-20240613-8245-291s0m-0.yaml"
declare -x job_file="/lkp/jobs/queued/int/lkp-spr-2sp1/perf-sanity-tests-gcc-debian-12-x86_64-20240206.cgz-3249f8b84526-20240613-8245-291s0m-0.yaml"
declare -x job_initrd="/lkp/jobs/scheduled/lkp-spr-2sp1/perf-sanity-tests-gcc-debian-12-x86_64-20240206.cgz-3249f8b84526-20240613-8245-291s0m-0.cgz"
declare -x job_origin="perf-sanity-tests.yaml"
declare -x kbuild_queue_analysis="1"
declare -x kconfig="x86_64-rhel-8.3-bpf"
declare -x kernel="/pkg/linux/x86_64-rhel-8.3-bpf/gcc-13/3249f8b84526d3b69162812908c257ee9816a237/vmlinuz-6.9.0-11004-g3249f8b84526"
declare -x kernel_cmdline_hw="acpi_rsdp=0x777fe014"
declare -x last_kernel="5.9.0-2-amd64"
declare -x linux_perf_initrd="/pkg/linux/x86_64-rhel-8.3-bpf/gcc-13/3249f8b84526d3b69162812908c257ee9816a237/linux-perf.cgz"
declare -x lkp_initrd="/osimage/user/xsang/lkp-x86_64.cgz"
declare -x load_ramdisk="2"
declare -x max_uptime="1200"
declare -x memory="256G"
declare -x model="Sapphire Rapids"
declare -x modules_initrd="/pkg/linux/x86_64-rhel-8.3-bpf/gcc-13/3249f8b84526d3b69162812908c257ee9816a237/modules.cgz"
declare -x need_memory="2G"
declare -x nmi_watchdog="panic"
declare -x nr_cpu="224"
declare -x nr_node="2"
declare -x nr_ssd_partitions="6"
declare -x oops="panic"
declare -x panic="-1"
declare -x prompt_ramdisk="0"
declare -x queue="int"
declare -x queue_cmdline_keys="user"
declare -x queuer_version="/lkp/xsang/.src-20240613-094320"
declare -x result_root="/result/perf-sanity-tests/gcc/lkp-spr-2sp1/debian-12-x86_64-20240206.cgz/x86_64-rhel-8.3-bpf/gcc-13/3249f8b84526d3b69162812908c257ee9816a237/20"
declare -x root="/dev/ram0"
declare -x selinux="0"
declare -x site="inn"
declare -x softlockup_panic="1"
declare -x suite="perf-sanity-tests"
declare -x tbox_group="lkp-spr-2sp1"
declare -x testbox="lkp-spr-2sp1"
declare -x testcase="perf-sanity-tests"
declare -x ucode="0x2b0004b1"
declare -x ucode_initrd="/osimage/ucode/intel-ucode-20230906.cgz"
declare -x vga="normal"


> 
> Thanks,
> Ian

[-- Attachment #2: pmu-events.tar.gz --]
[-- Type: application/gzip, Size: 1871958 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c
  2024-06-13  3:04             ` Oliver Sang
@ 2024-07-16  0:23               ` Ian Rogers
  2024-07-16  2:39                 ` Oliver Sang
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Rogers @ 2024-07-16  0:23 UTC (permalink / raw)
  To: Oliver Sang
  Cc: oe-lkp, lkp, linux-perf-users, linux-kernel, Weilin Wang,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, Kan Liang, Jing Zhang, John Garry, Sandipan Das

On Wed, Jun 12, 2024 at 8:07 PM Oliver Sang <oliver.sang@intel.com> wrote:
> > > > but make still failed. I still saw below in our build log
> > > >
> > > > --- pmu-events/empty-pmu-events.c       2024-06-03 08:41:16.000000000 +0000
> > > > +++ pmu-events/test-empty-pmu-events.c  2024-06-03 13:47:19.522463482 +0000
> > > > @@ -136,7 +136,7 @@
> > > >  { 2623 }, /* M3\000\0001 / M3\000\000\000\000\000\000\000\00000 */
> > > >  { 2078 }, /* cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000 */
> > > >  { 1947 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> > > > -{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retiredany\000\000\000\000\000\000\000\00000 */
> > > > +{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */

Hi Oliver,

I tried to reproduce the problem by installing more locales on my
machine, setting the environment variables, checking my environment
variables, etc. I couldn't reproduce it. Looking more closely at the
diff above and the other diffs in your email something strange appears
to be happening around dots.

From:
 --- pmu-events/empty-pmu-events.c
we know the minus lines are those from the files in this patch series.
From:
+++ pmu-events/test-empty-pmu-events.c
we know the plus lines are those generated by jevents.py.

In the diff output above the "inst_retired.any" doesn't match
"inst_retiredany" (no dot before the word "any"). The repository file
pmu-events/empty-pmu-events.c is missing the dot in the event name but
jevents.py is generating it, hence the diff. But looking at
pmu-events/empty-pmu-events.c in:
https://lore.kernel.org/lkml/20240525013021.436430-2-irogers@google.com/
The dot is present.

I think what is happening is that when you apply the patches for some
reason the dots are being consumed in
tools/perf/pmu-events/empty-pmu-events.c, the build then informs you
of this by failing. The locales idea was a red herring and this has
something to do with how you apply patches.

Does this make sense? Perhaps you can try testing the patches in an
ordinary client applying the patches using something like "b4 am
20240525013021.436430-1-irogers@google.com". At the moment I think the
patch series is good and I don't have a way to fix what I think the
problem is, with how you applied the patches.

Thanks,
Ian

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c
  2024-07-16  0:23               ` Ian Rogers
@ 2024-07-16  2:39                 ` Oliver Sang
  2024-07-29 19:18                   ` Ian Rogers
  0 siblings, 1 reply; 15+ messages in thread
From: Oliver Sang @ 2024-07-16  2:39 UTC (permalink / raw)
  To: Ian Rogers
  Cc: oe-lkp, lkp, linux-perf-users, linux-kernel, Weilin Wang,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, Kan Liang, Jing Zhang, John Garry, Sandipan Das,
	oliver.sang

hi, Ian,

thanks a lot for detail analysis! we will check further.

On Mon, Jul 15, 2024 at 05:23:32PM -0700, Ian Rogers wrote:
> On Wed, Jun 12, 2024 at 8:07 PM Oliver Sang <oliver.sang@intel.com> wrote:
> > > > > but make still failed. I still saw below in our build log
> > > > >
> > > > > --- pmu-events/empty-pmu-events.c       2024-06-03 08:41:16.000000000 +0000
> > > > > +++ pmu-events/test-empty-pmu-events.c  2024-06-03 13:47:19.522463482 +0000
> > > > > @@ -136,7 +136,7 @@
> > > > >  { 2623 }, /* M3\000\0001 / M3\000\000\000\000\000\000\000\00000 */
> > > > >  { 2078 }, /* cache_miss_cycles\000group1\000dcache_miss_cpi + icache_miss_cycles\000\000\000\000\000\000\000\00000 */
> > > > >  { 1947 }, /* dcache_miss_cpi\000\000l1d\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> > > > > -{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retiredany\000\000\000\000\000\000\000\00000 */
> > > > > +{ 2011 }, /* icache_miss_cycles\000\000l1i\\-loads\\-misses / inst_retired.any\000\000\000\000\000\000\000\00000 */
> 
> Hi Oliver,
> 
> I tried to reproduce the problem by installing more locales on my
> machine, setting the environment variables, checking my environment
> variables, etc. I couldn't reproduce it. Looking more closely at the
> diff above and the other diffs in your email something strange appears
> to be happening around dots.
> 
> From:
>  --- pmu-events/empty-pmu-events.c
> we know the minus lines are those from the files in this patch series.
> From:
> +++ pmu-events/test-empty-pmu-events.c
> we know the plus lines are those generated by jevents.py.
> 
> In the diff output above the "inst_retired.any" doesn't match
> "inst_retiredany" (no dot before the word "any"). The repository file
> pmu-events/empty-pmu-events.c is missing the dot in the event name but
> jevents.py is generating it, hence the diff. But looking at
> pmu-events/empty-pmu-events.c in:
> https://lore.kernel.org/lkml/20240525013021.436430-2-irogers@google.com/
> The dot is present.
> 
> I think what is happening is that when you apply the patches for some
> reason the dots are being consumed in
> tools/perf/pmu-events/empty-pmu-events.c, the build then informs you
> of this by failing. The locales idea was a red herring and this has
> something to do with how you apply patches.
> 
> Does this make sense? Perhaps you can try testing the patches in an
> ordinary client applying the patches using something like "b4 am
> 20240525013021.436430-1-irogers@google.com". At the moment I think the
> patch series is good and I don't have a way to fix what I think the
> problem is, with how you applied the patches.
> 
> Thanks,
> Ian

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c
  2024-07-16  2:39                 ` Oliver Sang
@ 2024-07-29 19:18                   ` Ian Rogers
  2024-07-30  1:47                     ` Oliver Sang
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Rogers @ 2024-07-29 19:18 UTC (permalink / raw)
  To: Oliver Sang
  Cc: oe-lkp, lkp, linux-perf-users, linux-kernel, Weilin Wang,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, Kan Liang, Jing Zhang, John Garry, Sandipan Das

On Mon, Jul 15, 2024 at 7:39 PM Oliver Sang <oliver.sang@intel.com> wrote:
>
> hi, Ian,
>
> thanks a lot for detail analysis! we will check further.

Hi Oliver,

I'd like to see these patches land, is there any follow up? I think
the build breakage was patches applied incorrectly so I don't think
there is any reason not to take the series.

Thanks,
Ian

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c
  2024-07-29 19:18                   ` Ian Rogers
@ 2024-07-30  1:47                     ` Oliver Sang
  0 siblings, 0 replies; 15+ messages in thread
From: Oliver Sang @ 2024-07-30  1:47 UTC (permalink / raw)
  To: Ian Rogers
  Cc: oe-lkp, lkp, linux-perf-users, linux-kernel, Weilin Wang,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, Kan Liang, Jing Zhang, John Garry, Sandipan Das,
	philip.li, oliver.sang

hi, Ian,

On Mon, Jul 29, 2024 at 12:18:34PM -0700, Ian Rogers wrote:
> On Mon, Jul 15, 2024 at 7:39 PM Oliver Sang <oliver.sang@intel.com> wrote:
> >
> > hi, Ian,
> >
> > thanks a lot for detail analysis! we will check further.
> 
> Hi Oliver,
> 
> I'd like to see these patches land, is there any follow up? I think
> the build breakage was patches applied incorrectly so I don't think
> there is any reason not to take the series.

yes, our code issue while applying patch. sorry about a wrong report due to it,
and thanks again you helped a lot figure this out for us!


> 
> Thanks,
> Ian

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-07-30  1:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-25  1:30 [PATCH v2 1/2] perf jevents: Use name for special find value Ian Rogers
2024-05-25  1:30 ` [PATCH v2 2/2] perf jevents: Autogenerate empty-pmu-events.c Ian Rogers
2024-05-28 10:00   ` John Garry
2024-05-28 15:14     ` Ian Rogers
2024-05-31  8:16   ` kernel test robot
2024-05-31 16:38     ` Ian Rogers
2024-06-03 14:19       ` Oliver Sang
2024-06-03 15:46         ` Ian Rogers
2024-06-12 21:46           ` Ian Rogers
2024-06-13  3:04             ` Oliver Sang
2024-07-16  0:23               ` Ian Rogers
2024-07-16  2:39                 ` Oliver Sang
2024-07-29 19:18                   ` Ian Rogers
2024-07-30  1:47                     ` Oliver Sang
2024-05-28  9:55 ` [PATCH v2 1/2] perf jevents: Use name for special find value John Garry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).