diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-01-22 04:09:29 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-01-31 11:07:43 -0500 |
commit | 97f63e4a2cf88e9d7bc086a1c3f10fa41c9174df (patch) | |
tree | c143cd0b6758fbfe59eb80ba346ccc943c7e589c /tools/perf/util/evsel.h | |
parent | 0de233b9c4f8c83b2cb655bfdbec306c8da81199 (diff) |
perf tools: Keep group information
Add a few of group-related field in struct perf_{evlist,evsel} so that
the group information in a evlist can be known easily. It only counts
groups which have more than 1 members since leader-only groups are
treated as non-group events.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
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/1358845787-1350-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evsel.h')
-rw-r--r-- | tools/perf/util/evsel.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index cbf42322a27e..c9031ebf196e 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h | |||
@@ -74,6 +74,7 @@ struct perf_evsel { | |||
74 | bool needs_swap; | 74 | bool needs_swap; |
75 | /* parse modifier helper */ | 75 | /* parse modifier helper */ |
76 | int exclude_GH; | 76 | int exclude_GH; |
77 | int nr_members; | ||
77 | struct perf_evsel *leader; | 78 | struct perf_evsel *leader; |
78 | char *group_name; | 79 | char *group_name; |
79 | }; | 80 | }; |
@@ -259,4 +260,9 @@ bool perf_evsel__fallback(struct perf_evsel *evsel, int err, | |||
259 | int perf_evsel__open_strerror(struct perf_evsel *evsel, | 260 | int perf_evsel__open_strerror(struct perf_evsel *evsel, |
260 | struct perf_target *target, | 261 | struct perf_target *target, |
261 | int err, char *msg, size_t size); | 262 | int err, char *msg, size_t size); |
263 | |||
264 | static inline int perf_evsel__group_idx(struct perf_evsel *evsel) | ||
265 | { | ||
266 | return evsel->idx - evsel->leader->idx; | ||
267 | } | ||
262 | #endif /* __PERF_EVSEL_H */ | 268 | #endif /* __PERF_EVSEL_H */ |