Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966326AbdCXTBb (ORCPT ); Fri, 24 Mar 2017 15:01:31 -0400 Received: from mail.kernel.org ([198.145.29.136]:36734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932237AbdCXTB0 (ORCPT ); Fri, 24 Mar 2017 15:01:26 -0400 Date: Fri, 24 Mar 2017 16:01:19 -0300 From: Arnaldo Carvalho de Melo To: Milian Wolff Cc: Jin Yao , jolsa@kernel.org, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com Subject: Re: [PATCH v5 0/5] perf report: Show inline stack Message-ID: <20170324190119.GE5148@kernel.org> References: <1489700547-7260-1-git-send-email-yao.jin@linux.intel.com> <1532086.vKWRnURGfG@agathebauer> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1532086.vKWRnURGfG@agathebauer> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3396 Lines: 95 Em Sat, Mar 18, 2017 at 05:41:09PM +0100, Milian Wolff escreveu: > On Donnerstag, 16. M?rz 2017 22:42:22 CET Jin Yao wrote: > > v5: Update according to Milian Wolff's comments. It groups by address > > (then display file/ line), or by function (then display function name). > > Thank you Jin, that is really good. I tested it and it works really well for > me. > > Arnaldo, could you please consider merging this? It's an extremely useful > feature and direly missing from perf so far. Thanks, applied. > That said, Jin, here are some observations that could be improved in the > future (I don't think any of these should hold back merging this feature now): > > For the following example code build with "-O2 -g" and recorded with "--call- > graph dwarf" I observe some output combinations that could potentially be > improved in the future: > > ~~~~~~~~~~~~~~~~~~~~ > #include > #include > #include > #include > > using namespace std; > > int main() > { > uniform_real_distribution uniform(-1E5, 1E5); > default_random_engine engine; > double s = 0; > for (int i = 0; i < 10000000; ++i) { > s += norm(complex(uniform(engine), uniform(engine))); > } > cout << s << '\n'; > return 0; > } > ~~~~~~~~~~~~~~~~ > > #1 duplicated entries when grouping by function: > > ~~~~~~~~~~~~~~~~ > perf report --inline --stdio > ... > --35.34%--_start > __libc_start_main > main > main (inline) > std::uniform_real_distribution::operator() long, 16807ul, 0ul, 2147483647ul> > (inline) > std::uniform_real_distribution::operator() long, 16807ul, 0ul, 2147483647ul> > (inline) > std::__detail::_Adaptor long, 16807ul, 0ul, 2147483647ul>, double>::operator() (inline) > ~~~~~~~~~~~~~~~~ > > Here, we see main twice, once for the "real" frame, and once for an inlined > one? Then we see the same function twice as inlined frame, which is also odd. > > ~~~~~~~~~~~~~~~~ > perf report --inline --stdio --no-children > ... > 59.81% cpp-inlining libm-2.25.so [.] __hypot_finite > | > ---__hypot_finite > hypot > main > std::norm (inline) > main (inline) > __libc_start_main > _start > ~~~~~~~~~~~~~~~~ > > Here we see a confusing output. The first "main" frame below "hypot" is > actually code form cpp's complex header which got inlined into main. That > associates the wrong function name to this frame, i.e. "main" instead of > std::norm". When the inline stack is shown below we actually see what happens, > i.e. we eventually end up in main again, but of course this output is not the > best as-is. > > But, again: I think these are minor issues, and the feature itself is already > extremely useful and I hope to see it finally merged. > > Thanks again Jin for your good work! > > Cheers > > -- > Milian Wolff | milian.wolff@kdab.com | Software Engineer > KDAB (Deutschland) GmbH&Co KG, a KDAB Group company > Tel: +49-30-521325470 > KDAB - The Qt Experts