From: Namhyung Kim <namhyung....@lge.com>

Add --group option to enable event grouping.  When enabled, all the
group members information will be shown together with the leader so
skip non-leader events.

Signed-off-by: Namhyung Kim <namhy...@kernel.org>
---
 tools/perf/builtin-annotate.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 0c6edd60d67e..4b12608707f0 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -214,6 +214,10 @@ static int __cmd_annotate(struct perf_annotate *ann)
                struct hists *hists = &pos->hists;
                u32 nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE];
 
+               if (symbol_conf.event_group &&
+                   !perf_evsel__is_group_leader(pos))
+                       continue;
+
                if (nr_samples > 0) {
                        total_nr_samples += nr_samples;
                        hists__collapse_resort(hists);
@@ -293,6 +297,8 @@ int cmd_annotate(int argc, const char **argv, const char 
*prefix __maybe_unused)
                   "Specify disassembler style (e.g. -M intel for intel 
syntax)"),
        OPT_STRING(0, "objdump", &objdump_path, "path",
                   "objdump binary to use for disassembly and annotations"),
+       OPT_BOOLEAN(0, "group", &symbol_conf.event_group,
+                   "Show event grou information together"),
        OPT_END()
        };
 
-- 
1.7.9.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to