mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 06:33:34 +00:00
perf evsel: Allow const evsel for certain accesses
List sorting, added later to evlist, passes const elements requiring helper functions to also be const. Make the argument to evsel__find_pmu, evsel__is_aux_event and evsel__leader const. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Florian Fischer <florian.fischer@muhq.space> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@arm.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: John Garry <john.g.garry@oracle.com> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Kim Phillips <kim.phillips@amd.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ravi Bangoria <ravi.bangoria@amd.com> Cc: Sean Christopherson <seanjc@google.com> Cc: Steinar H. Gunderson <sesse@google.com> Cc: Stephane Eranian <eranian@google.com> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com> Link: https://lore.kernel.org/r/20230312021543.3060328-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
ce5b85906c
commit
c6d616fe10
@ -3139,7 +3139,7 @@ bool evsel__is_hybrid(const struct evsel *evsel)
|
||||
return evsel->pmu_name && perf_pmu__is_hybrid(evsel->pmu_name);
|
||||
}
|
||||
|
||||
struct evsel *evsel__leader(struct evsel *evsel)
|
||||
struct evsel *evsel__leader(const struct evsel *evsel)
|
||||
{
|
||||
return container_of(evsel->core.leader, struct evsel, core);
|
||||
}
|
||||
|
@ -212,8 +212,8 @@ int evsel__object_config(size_t object_size,
|
||||
int (*init)(struct evsel *evsel),
|
||||
void (*fini)(struct evsel *evsel));
|
||||
|
||||
struct perf_pmu *evsel__find_pmu(struct evsel *evsel);
|
||||
bool evsel__is_aux_event(struct evsel *evsel);
|
||||
struct perf_pmu *evsel__find_pmu(const struct evsel *evsel);
|
||||
bool evsel__is_aux_event(const struct evsel *evsel);
|
||||
|
||||
struct evsel *evsel__new_idx(struct perf_event_attr *attr, int idx);
|
||||
|
||||
@ -505,7 +505,7 @@ int evsel__store_ids(struct evsel *evsel, struct evlist *evlist);
|
||||
|
||||
void evsel__zero_per_pkg(struct evsel *evsel);
|
||||
bool evsel__is_hybrid(const struct evsel *evsel);
|
||||
struct evsel *evsel__leader(struct evsel *evsel);
|
||||
struct evsel *evsel__leader(const struct evsel *evsel);
|
||||
bool evsel__has_leader(struct evsel *evsel, struct evsel *leader);
|
||||
bool evsel__is_leader(struct evsel *evsel);
|
||||
void evsel__set_leader(struct evsel *evsel, struct evsel *leader);
|
||||
|
@ -988,7 +988,7 @@ struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct perf_pmu *evsel__find_pmu(struct evsel *evsel)
|
||||
struct perf_pmu *evsel__find_pmu(const struct evsel *evsel)
|
||||
{
|
||||
struct perf_pmu *pmu = NULL;
|
||||
|
||||
@ -1000,11 +1000,11 @@ struct perf_pmu *evsel__find_pmu(struct evsel *evsel)
|
||||
break;
|
||||
}
|
||||
|
||||
evsel->pmu = pmu;
|
||||
((struct evsel *)evsel)->pmu = pmu;
|
||||
return pmu;
|
||||
}
|
||||
|
||||
bool evsel__is_aux_event(struct evsel *evsel)
|
||||
bool evsel__is_aux_event(const struct evsel *evsel)
|
||||
{
|
||||
struct perf_pmu *pmu = evsel__find_pmu(evsel);
|
||||
|
||||
|
@ -83,7 +83,7 @@ const char *perf_env__arch(struct perf_env *env __maybe_unused)
|
||||
* far, for the perf python binding known usecases, revisit if this become
|
||||
* necessary.
|
||||
*/
|
||||
struct perf_pmu *evsel__find_pmu(struct evsel *evsel __maybe_unused)
|
||||
struct perf_pmu *evsel__find_pmu(const struct evsel *evsel __maybe_unused)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user