Commit 2cfda562 authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

perf evsel: Set leader evsel's ->leader to itself

Currently only non-leader members are set ->leader to the leader evsel
of the group and the leader has set NULL.  Thus it requires special
casing for leader evsels.  Set ->leader to itself will remove this.
Suggested-by: default avatarArnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1354171126-14387-3-git-send-email-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 5fa9041b
...@@ -111,7 +111,6 @@ void __perf_evlist__set_leader(struct list_head *list) ...@@ -111,7 +111,6 @@ void __perf_evlist__set_leader(struct list_head *list)
struct perf_evsel *evsel, *leader; struct perf_evsel *evsel, *leader;
leader = list_entry(list->next, struct perf_evsel, node); leader = list_entry(list->next, struct perf_evsel, node);
leader->leader = NULL;
list_for_each_entry(evsel, list, node) { list_for_each_entry(evsel, list, node) {
if (evsel != leader) if (evsel != leader)
......
...@@ -55,6 +55,7 @@ void perf_evsel__init(struct perf_evsel *evsel, ...@@ -55,6 +55,7 @@ void perf_evsel__init(struct perf_evsel *evsel,
{ {
evsel->idx = idx; evsel->idx = idx;
evsel->attr = *attr; evsel->attr = *attr;
evsel->leader = evsel;
INIT_LIST_HEAD(&evsel->node); INIT_LIST_HEAD(&evsel->node);
hists__init(&evsel->hists); hists__init(&evsel->hists);
evsel->sample_size = __perf_evsel__sample_size(attr->sample_type); evsel->sample_size = __perf_evsel__sample_size(attr->sample_type);
......
...@@ -228,6 +228,6 @@ static inline struct perf_evsel *perf_evsel__next(struct perf_evsel *evsel) ...@@ -228,6 +228,6 @@ static inline struct perf_evsel *perf_evsel__next(struct perf_evsel *evsel)
static inline bool perf_evsel__is_group_member(const struct perf_evsel *evsel) static inline bool perf_evsel__is_group_member(const struct perf_evsel *evsel)
{ {
return evsel->leader != NULL; return evsel->leader != evsel;
} }
#endif /* __PERF_EVSEL_H */ #endif /* __PERF_EVSEL_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment