mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: Stephane Eranian <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, acme@redhat.com,
	peterz@infradead.org, mingo@elte.hu, jolsa@redhat.com,
	namhyung@kernel.org, kan.liang@intel.com, dsahern@gmail.com,
	adrian.hunter@intel.com
Subject: Re: [PATCH v1 4/4] perf script: enable printing of branch stack
Date: Wed, 19 Aug 2015 15:11:47 -0700	[thread overview]
Message-ID: <20150819221147.GK4524@tassilo.jf.intel.com> (raw)
In-Reply-To: <1439973506-2166-5-git-send-email-eranian@google.com>

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

  reply	other threads:[~2015-08-19 22:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19  8:38 [PATCH v1 0/4] perf: improve script and record for iregs and brstack Stephane Eranian
2015-08-19  8:38 ` [PATCH v1 1/4] perf script: enable printing of interrupted machine state Stephane Eranian
2015-08-19  8:38 ` [PATCH v1 2/4] perf/x86: add list of register names Stephane Eranian
2015-08-19  8:38 ` [PATCH v1 3/4] perf record: add ability to name registers to record Stephane Eranian
2015-08-20 11:18   ` Jiri Olsa
2015-08-20 20:02     ` Stephane Eranian
2015-08-19  8:38 ` [PATCH v1 4/4] perf script: enable printing of branch stack Stephane Eranian
2015-08-19 22:11   ` Andi Kleen [this message]
2015-08-19 22:20     ` Stephane Eranian
2015-08-19 23:32       ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150819221147.GK4524@tassilo.jf.intel.com \
    --to=ak@linux.intel.com \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome