linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] perf pmu: Make pmu_alias_terms weak again
@ 2025-10-29 22:26 Ian Rogers
  2025-10-29 22:26 ` [PATCH v1 2/2] perf test: Add test that command line period overrides sysfs/json values Ian Rogers
  2025-10-30  5:46 ` [PATCH v1 1/2] perf pmu: Make pmu_alias_terms weak again Namhyung Kim
  0 siblings, 2 replies; 8+ messages in thread
From: Ian Rogers @ 2025-10-29 22:26 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Alexander Shishkin, Jiri Olsa, Ian Rogers,
	Adrian Hunter, Kan Liang, James Clark, linux-kernel,
	linux-perf-users

The terms for a json event should be weak so they don't override
command line options.

Fixes: 84bae3af20d0 ("perf pmu: Don't eagerly parse event terms")
Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/util/pmu.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index d597263fab4f..f14f2a12d061 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -802,6 +802,7 @@ static int pmu_aliases_parse_eager(struct perf_pmu *pmu, int sysfs_fd)
 static int pmu_alias_terms(struct perf_pmu_alias *alias, struct list_head *terms)
 {
 	struct parse_events_terms alias_terms;
+	struct parse_events_term *term;
 	int ret;
 
 	parse_events_terms__init(&alias_terms);
@@ -812,6 +813,13 @@ static int pmu_alias_terms(struct perf_pmu_alias *alias, struct list_head *terms
 		parse_events_terms__exit(&alias_terms);
 		return ret;
 	}
+	list_for_each_entry(term, &alias_terms.terms, list) {
+		/*
+		 * Weak terms don't override command line options,
+		 * which we don't want for implicit terms in aliases.
+		 */
+		term->weak = true;
+	}
 	list_splice_init(&alias_terms.terms, terms);
 	parse_events_terms__exit(&alias_terms);
 	return 0;
-- 
2.51.1.851.g4ebd6896fd-goog


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

end of thread, other threads:[~2025-11-06  5:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29 22:26 [PATCH v1 1/2] perf pmu: Make pmu_alias_terms weak again Ian Rogers
2025-10-29 22:26 ` [PATCH v1 2/2] perf test: Add test that command line period overrides sysfs/json values Ian Rogers
2025-11-04  3:37   ` Namhyung Kim
2025-11-04  5:22     ` Ian Rogers
2025-11-06  5:50       ` Namhyung Kim
2025-10-30  5:46 ` [PATCH v1 1/2] perf pmu: Make pmu_alias_terms weak again Namhyung Kim
2025-10-30 15:08   ` Ian Rogers
2025-11-04  3:30     ` Namhyung Kim

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).