Re: [PATCH 3/8] perf, tools: Add --branch-history option to report v2
From: Jiri Olsa
Date: Fri Mar 07 2014 - 08:20:56 EST
On Thu, Feb 27, 2014 at 08:22:27PM -0800, Andi Kleen wrote:
> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> Add a --branch-history option to perf report that changes all
> the settings necessary for using the branches in callstacks.
>
> This is just a short cut to make this nicer to use, it does
> not enable any functionality by itself.
>
> v2: Change sort order. Rename option to --branch-history to
> be less confusing.
> Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> ---
> tools/perf/Documentation/perf-report.txt | 5 +++++
> tools/perf/builtin-report.c | 28 +++++++++++++++++++++++++---
> 2 files changed, 30 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
> index 349cd2a..5b270fe 100644
> --- a/tools/perf/Documentation/perf-report.txt
> +++ b/tools/perf/Documentation/perf-report.txt
> @@ -228,6 +228,11 @@ OPTIONS
> branch stacks and it will automatically switch to the branch view mode,
> unless --no-branch-stack is used.
>
> +--branch-history::
> + Add the addresses of sampled taken branches to the callstack.
> + This allows to examine the path the program took to each sample.
> + The data collection must have used -b (or -j) and -g.
> +
> --objdump=<path>::
> Path to objdump binary.
>
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index f7a9e3d..302c4e8 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -691,6 +691,16 @@ parse_branch_mode(const struct option *opt __maybe_unused,
> }
>
> static int
> +parse_branch_call_mode(const struct option *opt __maybe_unused,
> + const char *str __maybe_unused, int unset)
> +{
> + int *branch_mode = opt->value;
> +
> + *branch_mode = !unset;
> + return 0;
> +}
this is *same* as parse_branch_mode function and seems to be not needed,
I think both branch-stack and branch-history options could be handled
by OPT_BOOLEAN
jirka
--
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/