Skip to content

Commit 2dc065e

Browse files
namhyungacmel
authored andcommitted
perf evsel: Add missing cloning of evsel->use_config_name
The evsel__clone() should copy all fields in the evsel which are set during the event parsing. But it missed the use_config_name field. Fixes: 1227942 ("perf stat: Uniquify hybrid event name") Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Ian Rogers <irogers@google.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20210602212241.2175005-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent f677ec9 commit 2dc065e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tools/perf/util/evsel.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ struct evsel *evsel__clone(struct evsel *orig)
428428
evsel->auto_merge_stats = orig->auto_merge_stats;
429429
evsel->collect_stat = orig->collect_stat;
430430
evsel->weak_group = orig->weak_group;
431+
evsel->use_config_name = orig->use_config_name;
431432

432433
if (evsel__copy_config_terms(evsel, orig) < 0)
433434
goto out_err;

tools/perf/util/evsel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ struct evsel {
8383
bool collect_stat;
8484
bool weak_group;
8585
bool bpf_counter;
86+
bool use_config_name;
8687
int bpf_fd;
8788
struct bpf_object *bpf_obj;
89+
struct list_head config_terms;
8890
};
8991

9092
/*
@@ -116,10 +118,8 @@ struct evsel {
116118
bool merged_stat;
117119
bool reset_group;
118120
bool errored;
119-
bool use_config_name;
120121
struct hashmap *per_pkg_mask;
121122
struct evsel *leader;
122-
struct list_head config_terms;
123123
int err;
124124
int cpu_iter;
125125
struct {

0 commit comments

Comments
 (0)