From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934111AbcLHAlS (ORCPT ); Wed, 7 Dec 2016 19:41:18 -0500 Received: from mga11.intel.com ([192.55.52.93]:17697 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932441AbcLHAlR (ORCPT ); Wed, 7 Dec 2016 19:41:17 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,316,1477983600"; d="scan'208";a="40163373" Subject: Re: [PATCH v2 0/5] perf report: Show inline stack To: Arnaldo Carvalho de Melo References: <1481117424-20673-1-git-send-email-yao.jin@linux.intel.com> <601c4a7b-0806-e0dc-9783-7484d7c9ed64@linux.intel.com> <20161207143007.GG8257@kernel.org> Cc: jolsa@kernel.org, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com From: "Jin, Yao" Message-ID: Date: Thu, 8 Dec 2016 08:41:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161207143007.GG8257@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Got it, thanks so much! I will use the new version rather than just using the "RESEND" prefix in the future. For this time, since the "RESEND PATCH v2" has been sent out, I will not resend the v3 to avoid sending duplicate content to the mailing list. I will take care next time. Jin Yao On 12/7/2016 10:30 PM, Arnaldo Carvalho de Melo wrote: > Em Wed, Dec 07, 2016 at 01:38:29PM +0800, Jin, Yao escreveu: >> So sorry, please ignore this v2 patch series. >> >> I missed the Arnaldo other comments which were added in the code. >> >> I will RESEND v2 patch series later. > No problem, but in the future just bump the version, i.e. ask for me to > disregard v2 and wait for v3 :-) > > And thanks a lot for taking the time to address my requests and > suggestions, really appreciated! > > - Arnaldo > >> On 12/7/2016 9:30 PM, Jin Yao wrote: >>> v2: Thanks so much for Arnaldo's comments! >>> The modifications are: >>> >>> 1. Divide v1 patch "perf report: Find the inline stack for a >>> given address" into 2 patches: >>> a. perf report: Refactor common code in srcline.c >>> b. perf report: Find the inline stack for a given address >>> >>> Some function names are changed: >>> dso_name_get -> dso__name >>> ilist_apend -> inline_list__append >>> get_inline_node -> inline__node >>> free_inline_node -> inline_node__free >>> >>> 2. Since the function name are changed, update following patches >>> accordingly. >>> a. perf report: Show inline stack in stdio mode >>> b. perf report: Show inline stack in browser mode >>> >>> 3. Rebase to latest perf/core branch. This patch is impacted. >>> a. perf report: Create a new option "--inline" >>> >>> v1: Initial post >>> >>> It would be useful for perf to support a mode to query the >>> inline stack for callgraph addresses. This would simplify >>> finding the right code in code that does a lot of inlining. >>> >>> For example, the c code: >>> >>> static inline void f3(void) >>> { >>> int i; >>> for (i = 0; i < 1000;) { >>> >>> if(i%2) >>> i++; >>> else >>> i++; >>> } >>> printf("hello f3\n"); /* D */ >>> } >>> >>> /* < CALLCHAIN: f2 <- f1 > */ >>> static inline void f2(void) >>> { >>> int i; >>> for (i = 0; i < 100; i++) { >>> f3(); /* C */ >>> } >>> } >>> >>> /* < CALLCHAIN: f1 <- main > */ >>> static inline void f1(void) >>> { >>> int i; >>> for (i = 0; i < 100; i++) { >>> f2(); /* B */ >>> } >>> } >>> >>> /* < CALLCHAIN: main <- TOP > */ >>> int main() >>> { >>> struct timeval tv; >>> time_t start, end; >>> >>> gettimeofday(&tv, NULL); >>> start = end = tv.tv_sec; >>> while((end - start) < 5) { >>> f1(); /* A */ >>> gettimeofday(&tv, NULL); >>> end = tv.tv_sec; >>> } >>> return 0; >>> } >>> >>> The printed inline stack is: >>> >>> 0.05% test2 test2 [.] main >>> | >>> ---/home/perf-dev/lck-2867/test/test2.c:27 (inline) >>> /home/perf-dev/lck-2867/test/test2.c:35 (inline) >>> /home/perf-dev/lck-2867/test/test2.c:45 (inline) >>> /home/perf-dev/lck-2867/test/test2.c:61 (inline) >>> >>> I tag A/B/C/D in above c code to indicate the source line, >>> actually the inline stack is equal to: >>> >>> 0.05% test2 test2 [.] main >>> | >>> ---D >>> C >>> B >>> A >>> >>> Jin Yao (5): >>> perf report: Refactor common code in srcline.c >>> perf report: Find the inline stack for a given address >>> perf report: Create a new option "--inline" >>> perf report: Show inline stack in stdio mode >>> perf report: Show inline stack in browser mode >>> >>> tools/perf/Documentation/perf-report.txt | 4 + >>> tools/perf/builtin-report.c | 2 + >>> tools/perf/ui/browsers/hists.c | 98 ++++++++++++++- >>> tools/perf/ui/stdio/hist.c | 56 ++++++++- >>> tools/perf/util/hist.c | 5 + >>> tools/perf/util/sort.h | 1 + >>> tools/perf/util/srcline.c | 207 ++++++++++++++++++++++++++----- >>> tools/perf/util/symbol.h | 3 +- >>> tools/perf/util/util.h | 14 +++ >>> 9 files changed, 356 insertions(+), 34 deletions(-) >>>