perf evsel: Remove use_uncore_alias

This flag used to be used when regrouping uncore events in particular
due to wildcard matches. This is now handled by sorting evlist and so
the flag is redundant.

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:
Ian Rogers 2023-03-11 18:15:41 -08:00 committed by Arnaldo Carvalho de Melo
parent 347c2f0a09
commit e733f87e8c
5 changed files with 11 additions and 17 deletions

View File

@ -458,7 +458,6 @@ struct evsel *evsel__clone(struct evsel *orig)
evsel->per_pkg = orig->per_pkg;
evsel->percore = orig->percore;
evsel->precise_max = orig->precise_max;
evsel->use_uncore_alias = orig->use_uncore_alias;
evsel->is_libpfm_event = orig->is_libpfm_event;
evsel->exclude_GH = orig->exclude_GH;

View File

@ -89,7 +89,6 @@ struct evsel {
bool per_pkg;
bool percore;
bool precise_max;
bool use_uncore_alias;
bool is_libpfm_event;
bool auto_merge_stats;
bool collect_stat;

View File

@ -1445,15 +1445,13 @@ static int parse_events__inside_hybrid_pmu(struct parse_events_state *parse_stat
int parse_events_add_pmu(struct parse_events_state *parse_state,
struct list_head *list, char *name,
struct list_head *head_config,
bool auto_merge_stats,
bool use_alias)
bool auto_merge_stats)
{
struct perf_event_attr attr;
struct perf_pmu_info info;
struct perf_pmu *pmu;
struct evsel *evsel;
struct parse_events_error *err = parse_state->error;
bool use_uncore_alias;
LIST_HEAD(config_terms);
pmu = parse_state->fake_pmu ?: perf_pmu__find(name);
@ -1488,8 +1486,6 @@ int parse_events_add_pmu(struct parse_events_state *parse_state,
memset(&attr, 0, sizeof(attr));
}
use_uncore_alias = (pmu->is_uncore && use_alias);
if (!head_config) {
attr.type = pmu->type;
evsel = __add_event(list, &parse_state->idx, &attr,
@ -1499,7 +1495,6 @@ int parse_events_add_pmu(struct parse_events_state *parse_state,
/*cpu_list=*/NULL);
if (evsel) {
evsel->pmu_name = name ? strdup(name) : NULL;
evsel->use_uncore_alias = use_uncore_alias;
return 0;
} else {
return -ENOMEM;
@ -1560,7 +1555,6 @@ int parse_events_add_pmu(struct parse_events_state *parse_state,
evsel->use_config_name = true;
evsel->pmu_name = name ? strdup(name) : NULL;
evsel->use_uncore_alias = use_uncore_alias;
evsel->percore = config_term_percore(&evsel->config_terms);
if (parse_state->fake_pmu)
@ -1622,7 +1616,7 @@ int parse_events_multi_pmu_add(struct parse_events_state *parse_state,
parse_events_copy_term_list(head, &orig_head);
if (!parse_events_add_pmu(parse_state, list,
pmu->name, orig_head,
true, true)) {
/*auto_merge_stats=*/true)) {
pr_debug("%s -> %s/%s/\n", str,
pmu->name, alias->str);
ok++;
@ -1634,7 +1628,7 @@ int parse_events_multi_pmu_add(struct parse_events_state *parse_state,
if (parse_state->fake_pmu) {
if (!parse_events_add_pmu(parse_state, list, str, head,
true, true)) {
/*auto_merge_stats=*/true)) {
pr_debug("%s -> %s/%s/\n", str, "fake_pmu", str);
ok++;
}

View File

@ -183,8 +183,7 @@ int parse_events_add_breakpoint(struct list_head *list, int *idx,
int parse_events_add_pmu(struct parse_events_state *parse_state,
struct list_head *list, char *name,
struct list_head *head_config,
bool auto_merge_stats,
bool use_alias);
bool auto_merge_stats);
struct evsel *parse_events__add_event(int idx, struct perf_event_attr *attr,
const char *name, const char *metric_id,

View File

@ -313,7 +313,7 @@ event_pmu_name opt_pmu_config
list = alloc_list();
if (!list)
CLEANUP_YYABORT;
if (parse_events_add_pmu(_parse_state, list, $1, $2, false, false)) {
if (parse_events_add_pmu(_parse_state, list, $1, $2, /*auto_merge_stats=*/false)) {
struct perf_pmu *pmu = NULL;
int ok = 0;
@ -330,8 +330,10 @@ event_pmu_name opt_pmu_config
!perf_pmu__match(pattern, pmu->alias_name, $1)) {
if (parse_events_copy_term_list(orig_terms, &terms))
CLEANUP_YYABORT;
if (!parse_events_add_pmu(_parse_state, list, pmu->name, terms, true, false))
if (!parse_events_add_pmu(_parse_state, list, pmu->name, terms,
/*auto_merge_stats=*/true)) {
ok++;
}
parse_events_terms__delete(terms);
}
}
@ -407,7 +409,8 @@ PE_PMU_EVENT_FAKE sep_dc
if (!list)
YYABORT;
err = parse_events_add_pmu(_parse_state, list, $1, NULL, false, false);
err = parse_events_add_pmu(_parse_state, list, $1, /*head_config=*/NULL,
/*auto_merge_stats=*/false);
free($1);
if (err < 0) {
free(list);
@ -425,7 +428,7 @@ PE_PMU_EVENT_FAKE opt_pmu_config
if (!list)
YYABORT;
err = parse_events_add_pmu(_parse_state, list, $1, $2, false, false);
err = parse_events_add_pmu(_parse_state, list, $1, $2, /*auto_merge_stats=*/false);
free($1);
parse_events_terms__delete($2);
if (err < 0) {