Re: [PATCH 04/21] perf pmu: Make pmu_event tables const.

From: John Garry
Date: Fri Oct 08 2021 - 07:05:18 EST


On 07/10/2021 17:56, Ian Rogers wrote:

- bouncing changbin du address

-int arch_get_runtimeparam(struct pmu_event *pe)
+int arch_get_runtimeparam(const struct pmu_event *pe)
{
int count;
char path[PATH_MAX] = "/devices/hv_24x7/interface/";
diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index a31de0f77097..b3431c11c9cb 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -362,7 +362,7 @@ static int close_table;
static void print_events_table_prefix(FILE *fp, const char *tblname)
{
- fprintf(fp, "struct pmu_event %s[] = {\n", tblname);
+ fprintf(fp, "const struct pmu_event %s[] = {\n", tblname);

can these be static as well?

close_table = 1;
}