From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758419AbcEFLcA (ORCPT ); Fri, 6 May 2016 07:32:00 -0400 Received: from mga01.intel.com ([192.55.52.88]:55931 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758369AbcEFLb5 (ORCPT ); Fri, 6 May 2016 07:31:57 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,587,1455004800"; d="scan'208";a="697745376" Subject: Re: [PATCH 4/6] perf script: add call path id to exported sample in db export To: Chris Phlipot , jolsa@kernel.org, acme@kernel.org, peterz@infradead.org, mingo@redhat.com References: <1461831551-12213-1-git-send-email-cphlipot0@gmail.com> <1461831551-12213-5-git-send-email-cphlipot0@gmail.com> Cc: linux-kernel@vger.kernel.org From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <572C7FC5.3010806@intel.com> Date: Fri, 6 May 2016 14:28:05 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1461831551-12213-5-git-send-email-cphlipot0@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/04/16 11:19, Chris Phlipot wrote: > The exported sample now contains a reference to the call_path_id that > represents its callchain. > > While callchains themselves are nice to have, being able to associate > them with samples makes them much more useful, and can allow for such > things as determining how much cumulative time is spent in a particular > function. This information is normally possible to get from the > call return processor. However, when doing normal sampling, call/return > information is not available, thus necessitating the need for associating > samples directly with call paths. > > This commit include changes to db-export layer to make this information > available for subsequent patches in this change set, but by itself, does > not make any changes visible to the user. > > Signed-off-by: Chris Phlipot Acked-by: Adrian Hunter > --- > tools/perf/util/db-export.c | 4 +++- > tools/perf/util/db-export.h | 1 + > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c > index cb96591..74f6875 100644 > --- a/tools/perf/util/db-export.c > +++ b/tools/perf/util/db-export.c > @@ -412,8 +412,10 @@ int db_export__sample(struct db_export *dbe, union perf_event *event, > struct call_path *cp = call_path_from_sample(dbe, al->machine, > thread, sample, > evsel); > - if (cp) > + if (cp) { > db_export__call_path(dbe, cp); > + es.call_path_id = cp->db_id; > + } > } > > if ((evsel->attr.sample_type & PERF_SAMPLE_ADDR) && > diff --git a/tools/perf/util/db-export.h b/tools/perf/util/db-export.h > index f5daf55..67bc6b8 100644 > --- a/tools/perf/util/db-export.h > +++ b/tools/perf/util/db-export.h > @@ -44,6 +44,7 @@ struct export_sample { > u64 addr_dso_db_id; > u64 addr_sym_db_id; > u64 addr_offset; /* addr offset from symbol start */ > + u64 call_path_id; > }; > > struct db_export { >