[PATCH -tip v3 6/6] perf branch trace: add print all option

From: Akihiro Nagai
Date: Thu Mar 24 2011 - 07:32:18 EST


For ease of use, add option printing all information '-A' or '--all'.
This option can print following information.
- pid
- command name
- address
- function+offset
- elf file path

Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@xxxxxxxxxxx>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@xxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxx>
---

tools/perf/Documentation/perf-branch.txt | 3 +++
tools/perf/builtin-branch.c | 6 ++++++
2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tools/perf/Documentation/perf-branch.txt b/tools/perf/Documentation/perf-branch.txt
index 9c7e100..dd06090 100644
--- a/tools/perf/Documentation/perf-branch.txt
+++ b/tools/perf/Documentation/perf-branch.txt
@@ -45,6 +45,9 @@ OPTIONS
-s::
--symbol::
Print function name and offset. (default)
+-A::
+--all::
+ Print all information.

SEE ALSO
--------
diff --git a/tools/perf/builtin-branch.c b/tools/perf/builtin-branch.c
index 819443e..efbd8d8 100644
--- a/tools/perf/builtin-branch.c
+++ b/tools/perf/builtin-branch.c
@@ -36,6 +36,9 @@ struct exec_info {
#define EI_FLAG_PRINT_ELFPATH (1 << 3)
#define EI_FLAG_PRINT_SYMBOL (1 << 4)

+/* all print flags are enabled */
+#define EI_FLAG_PRINT_ALL -1UL
+
/* it's used when no print item specified */
#define EI_FLAG_PRINT_DEFAULT EI_FLAG_PRINT_SYMBOL

@@ -94,6 +97,9 @@ static const struct option branch_options[] = {
"print function+offset (default)",
set_print_flags,
(void *)EI_FLAG_PRINT_SYMBOL),
+ OPT_CALLBACK_DEFAULT_NOOPT('A', "all", NULL, NULL,
+ "print all items", set_print_flags,
+ (void *)EI_FLAG_PRINT_ALL),
OPT_END()
};


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