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

It's for enabling the hierarchical view.

Signed-off-by: Namhyung Kim <namhy...@kernel.org>
---
 tools/perf/Documentation/perf-report.txt | 5 +++++
 tools/perf/builtin-report.c              | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/tools/perf/Documentation/perf-report.txt 
b/tools/perf/Documentation/perf-report.txt
index 7d5f4f38aa52..3c86b9f83c54 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -210,6 +210,11 @@ OPTIONS
        Demangle symbol names to human readable form. It's enabled by default,
        disable with --no-demangle.
 
+-H::
+--hierarchy::
+       Show events in hierarchical view.  Each events are grouped under prior
+       sort keys.  Currently --gtk output is supported only.
+
 SEE ALSO
 --------
 linkperf:perf-stat[1], linkperf:perf-annotate[1]
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index d45bf9b0361d..9b9a35b296d8 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -809,6 +809,7 @@ int cmd_report(int argc, const char **argv, const char 
*prefix __maybe_unused)
        OPT_BOOLEAN(0, "demangle", &symbol_conf.demangle,
                    "Disable symbol demangling"),
        OPT_BOOLEAN(0, "mem-mode", &report.mem_mode, "mem access profile"),
+       OPT_BOOLEAN('H', "hierarchy", &symbol_conf.hierarchy, "Hierarchical 
view"),
        OPT_END()
        };
 
@@ -833,6 +834,11 @@ int cmd_report(int argc, const char **argv, const char 
*prefix __maybe_unused)
                        input_name = "perf.data";
        }
 
+       if (symbol_conf.hierarchy && use_browser != 2) {
+               pr_err("--hierarchy option is only used for --gtk output\n");
+               return -EINVAL;
+       }
+
        if (strcmp(input_name, "-") != 0)
                setup_browser(true);
        else {
-- 
1.7.11.7

--
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