Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1210055

Re: [PATCH v1 4/4] perf script: enable printing of branch stack

From Andi Kleen <ak@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v1 4/4] perf script: enable printing of branch stack
Date 2015-08-20 00:20 +0200
Message-ID <pZjSa-2jo-19@gated-at.bofh.it> (permalink)
References <pZ74B-C4-7@gated-at.bofh.it> <pZ74B-C4-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 19, 2015 at 10:38:26AM +0200, Stephane Eranian wrote:
> This patch improves perf script by enabling printing of the
> branch stack via the 'brstack' argument to the field selection
> option -F. The option is off by default and operates only if the
> perf.data file has branch stack content.

Thanks that's very useful. I wanted that several times.
> 
> +static void print_sample_brstack(union perf_event *event __maybe_unused,
> +			  struct perf_sample *sample,
> +			  struct thread *thread __maybe_unused,
> +			  struct perf_event_attr *attr __maybe_unused)
> +{
> +	struct branch_stack *br = sample->branch_stack;
> +	u64 i;
> +
> +	if (!(br && br->nr))
> +		return;
> +
> +	for (i = 0; i < br->nr; i++) {
> +		printf(" 0x%"PRIx64"/0x%"PRIx64" ", br->entries[i].from, br->entries[i].to);

Should print the various flags too. Also tip just added cycles information.

Also it would be good to resolve the addresses to symbol + offset 
(and perhaps have support for srcline too).


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v1 4/4] perf script: enable printing of branch stack Stephane Eranian <eranian@google.com> - 2015-08-19 10:40 +0200
  Re: [PATCH v1 4/4] perf script: enable printing of branch stack Andi Kleen <ak@linux.intel.com> - 2015-08-20 00:20 +0200
    Re: [PATCH v1 4/4] perf script: enable printing of branch stack Stephane Eranian <eranian@google.com> - 2015-08-20 00:30 +0200
      Re: [PATCH v1 4/4] perf script: enable printing of branch stack Andi Kleen <ak@linux.intel.com> - 2015-08-20 01:40 +0200

csiph-web