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

perf tool: Move pmus list variable to a new file

The 'pmus' list variable is defined as static variable under pmu.c file.

Introduce a new pmus.c file and migrate this variable to it. Also make
it non static so that it can be accessed from outside.

Suggested-by: Ian Rogers <irogers@google.com>
Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Acked-by: Ian Rogers <irogers@google.com>
Acked-by: Kan Liang <kan.liang@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ananth Narayan <ananth.narayan@amd.com>
Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Santosh Shukla <santosh.shukla@amd.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: carsten.haitzler@arm.com
Link: https://lore.kernel.org/r/20221206043237.12159-2-ravi.bangoria@amd.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ravi Bangoria and committed by
Arnaldo Carvalho de Melo
336b92da 5b7a29fb

+16 -1
+1
tools/perf/util/Build
··· 73 73 perf-y += parse-events-flex.o 74 74 perf-y += parse-events-bison.o 75 75 perf-y += pmu.o 76 + perf-y += pmus.o 76 77 perf-y += pmu-flex.o 77 78 perf-y += pmu-bison.o 78 79 perf-y += pmu-hybrid.o
+1 -1
tools/perf/util/pmu.c
··· 22 22 #include "debug.h" 23 23 #include "evsel.h" 24 24 #include "pmu.h" 25 + #include "pmus.h" 25 26 #include "parse-events.h" 26 27 #include "print-events.h" 27 28 #include "header.h" ··· 59 58 int perf_pmu_parse(struct list_head *list, char *name); 60 59 extern FILE *perf_pmu_in; 61 60 62 - static LIST_HEAD(pmus); 63 61 static bool hybrid_scanned; 64 62 65 63 /*
+5
tools/perf/util/pmus.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + #include <linux/list.h> 3 + #include <pmus.h> 4 + 5 + LIST_HEAD(pmus);
+9
tools/perf/util/pmus.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef __PMUS_H 3 + #define __PMUS_H 4 + 5 + extern struct list_head pmus; 6 + 7 + #define perf_pmus__for_each_pmu(pmu) list_for_each_entry(pmu, &pmus, list) 8 + 9 + #endif /* __PMUS_H */