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

Configure Feed

Select the types of activity you want to include in your feed.

perf pmu: Remove mostly unused 'struct perf_pmu' 'is_hybrid' member

Replace usage with perf_pmu__is_hybrid().

Suggested-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Caleb Biggers <caleb.biggers@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Perry Taylor <perry.taylor@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Sandipan Das <sandipan.das@amd.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Weilin Wang <weilin.wang@intel.com>
Cc: Xin Gao <gaoxin@cdjrlc.com>
Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Link: http://lore.kernel.org/lkml/20221114210723.2749751-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
e5f4afbe 7565f961

+6 -16
+1 -4
tools/perf/util/evsel.c
··· 3124 3124 } 3125 3125 } 3126 3126 3127 - bool evsel__is_hybrid(struct evsel *evsel) 3127 + bool evsel__is_hybrid(const struct evsel *evsel) 3128 3128 { 3129 - if (evsel->pmu) 3130 - return evsel->pmu->is_hybrid; 3131 - 3132 3129 return evsel->pmu_name && perf_pmu__is_hybrid(evsel->pmu_name); 3133 3130 } 3134 3131
+1 -1
tools/perf/util/evsel.h
··· 498 498 int evsel__store_ids(struct evsel *evsel, struct evlist *evlist); 499 499 500 500 void evsel__zero_per_pkg(struct evsel *evsel); 501 - bool evsel__is_hybrid(struct evsel *evsel); 501 + bool evsel__is_hybrid(const struct evsel *evsel); 502 502 struct evsel *evsel__leader(struct evsel *evsel); 503 503 bool evsel__has_leader(struct evsel *evsel, struct evsel *leader); 504 504 bool evsel__is_leader(struct evsel *evsel);
+1 -2
tools/perf/util/pmu.c
··· 980 980 pmu->is_uncore = pmu_is_uncore(name); 981 981 if (pmu->is_uncore) 982 982 pmu->id = pmu_id(name); 983 - pmu->is_hybrid = is_hybrid; 984 983 pmu->max_precise = pmu_max_precise(name); 985 984 pmu_add_cpu_aliases(&aliases, pmu); 986 985 pmu_add_sys_aliases(&aliases, pmu); ··· 991 992 list_splice(&aliases, &pmu->aliases); 992 993 list_add_tail(&pmu->list, &pmus); 993 994 994 - if (pmu->is_hybrid) 995 + if (is_hybrid) 995 996 list_add_tail(&pmu->hybrid_list, &perf_pmu__hybrid_pmus); 996 997 997 998 pmu->default_config = perf_pmu__get_default_config(pmu);
-1
tools/perf/util/pmu.h
··· 40 40 __u32 type; 41 41 bool selectable; 42 42 bool is_uncore; 43 - bool is_hybrid; 44 43 bool auxtrace; 45 44 int max_precise; 46 45 struct perf_event_attr *default_config;
+3 -8
tools/perf/util/stat.c
··· 604 604 } 605 605 } 606 606 607 - static bool evsel__should_merge_hybrid(struct evsel *evsel, struct perf_stat_config *config) 607 + static bool evsel__should_merge_hybrid(const struct evsel *evsel, 608 + const struct perf_stat_config *config) 608 609 { 609 - struct perf_pmu *pmu; 610 - 611 - if (!config->hybrid_merge) 612 - return false; 613 - 614 - pmu = evsel__find_pmu(evsel); 615 - return pmu && pmu->is_hybrid; 610 + return config->hybrid_merge && evsel__is_hybrid(evsel); 616 611 } 617 612 618 613 static void evsel__merge_stats(struct evsel *evsel, struct perf_stat_config *config)