Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752625AbbHSWMU (ORCPT ); Wed, 19 Aug 2015 18:12:20 -0400 Received: from mga03.intel.com ([134.134.136.65]:2335 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752352AbbHSWMT (ORCPT ); Wed, 19 Aug 2015 18:12:19 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,712,1432623600"; d="scan'208";a="772035556" Date: Wed, 19 Aug 2015 15:11:47 -0700 From: Andi Kleen To: Stephane Eranian 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 Message-ID: <20150819221147.GK4524@tassilo.jf.intel.com> References: <1439973506-2166-1-git-send-email-eranian@google.com> <1439973506-2166-5-git-send-email-eranian@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1439973506-2166-5-git-send-email-eranian@google.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1298 Lines: 36 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/