Skip to content

Commit

Permalink
perf evsel: Add missing cloning of evsel->use_config_name
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Ian Rogers <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Jin Yao <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
namhyung authored and acmel committed Jun 4, 2021
1 parent f677ec9 commit 2dc065e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions tools/perf/util/evsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ struct evsel *evsel__clone(struct evsel *orig)
evsel->auto_merge_stats = orig->auto_merge_stats;
evsel->collect_stat = orig->collect_stat;
evsel->weak_group = orig->weak_group;
evsel->use_config_name = orig->use_config_name;

if (evsel__copy_config_terms(evsel, orig) < 0)
goto out_err;
Expand Down
4 changes: 2 additions & 2 deletions tools/perf/util/evsel.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ struct evsel {
bool collect_stat;
bool weak_group;
bool bpf_counter;
bool use_config_name;
int bpf_fd;
struct bpf_object *bpf_obj;
struct list_head config_terms;
};

/*
Expand Down Expand Up @@ -116,10 +118,8 @@ struct evsel {
bool merged_stat;
bool reset_group;
bool errored;
bool use_config_name;
struct hashmap *per_pkg_mask;
struct evsel *leader;
struct list_head config_terms;
int err;
int cpu_iter;
struct {
Expand Down

0 comments on commit 2dc065e

Please sign in to comment.