Received: by 10.223.164.202 with SMTP id h10csp463026wrb; Thu, 23 Nov 2017 00:56:59 -0800 (PST) X-Google-Smtp-Source: AGs4zMYdJLoCyxTp1f7wz2K08PQY5aQBU7OwOGdb5K2geGpka7XuKZto0I/iDdYKDNXrXuWDAJig X-Received: by 10.99.116.94 with SMTP id e30mr23384390pgn.59.1511427418949; Thu, 23 Nov 2017 00:56:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511427418; cv=none; d=google.com; s=arc-20160816; b=ztGOZMARbLWQ5ztlV1das0Y8w4SY+MFSEIge3VsiwWHDKiev8foDOIvazPjUMdW0q+ AUbgsXzfM8XHVAFgN2EHVjpFhp41m0D+fH8IDxd3rBlhve9YcZ67Y/InbvklPwgNubGE rgn/s4oFppZ7szNrEvDcFkSzmRYIexl/3I/ynleXQ42AX6LDP1VCEeIIFYDxnXnNOWR9 qq69Bpxj8Hb/lEKDwufdov3K8Ga5xjuTBkaDXsGvYYEnt/+8MK9DiqoGoomPa19Jq6TK UkwzGS3JFysuIbOCYoclHSvh+HTfzuhmOW2qL1THDrgJLjUp+9MoBfFDxRe7HBPltV9+ 9iYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :organization:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ShCiQNyVfZVTudRwXdgUf7N9VCEwRTrS1GmkynA7K7s=; b=P/3bU5fE19SdgzbHwiuTxkuCyR0uFxzWGQx6QdVCptDn7B6nzDfE0LRPqL0g1yV0fP dWhewTByAGdzWjkC4f6l6e1mSEwBmrTdJtu2PHNcK4T6M26b1rdSgYMAdlXx71hmFo89 xNxlbfM/52qJNAUndOon3BpZoOZxIj8A7txWm2vfSjR4zehCQIZYEpi+IOZfxKx+v+Ve vxQD/hg1+JLnp1vZAmDWR8dlKenrXwrOZOzpMaQANZVJ+y6WUM8zFU0f+PkJvYAT85Wa cuXAYM2oMNxoldgzj9E2HkSZy5v01Eh63IzjvzTZ43WIwD9m9HEy6fdN5O+Icnl9E4rd J6Yw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w70si3648792pfk.109.2017.11.23.00.56.47; Thu, 23 Nov 2017 00:56:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752674AbdKWIzs (ORCPT + 77 others); Thu, 23 Nov 2017 03:55:48 -0500 Received: from mail.kdab.com ([176.9.126.58]:43042 "EHLO mail.kdab.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751863AbdKWIzr (ORCPT ); Thu, 23 Nov 2017 03:55:47 -0500 X-Virus-Scanned: amavisd-new at kdab.com From: Milian Wolff To: alexander.levin@verizon.com Cc: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , David Ahern , Peter Zijlstra , Ravi Bangoria , Yao Jin , Arnaldo Carvalho de Melo Subject: Re: [PATCH AUTOSEL for 4.14 18/51] perf callchain: Compare symbol name for inlined frames when matching Date: Thu, 23 Nov 2017 09:55:37 +0100 Message-ID: <2891438.FCgzeiCqBH@milian-kdab2> Organization: KDAB In-Reply-To: <20171122222526.20021-18-alexander.levin@verizon.com> References: <20171122222526.20021-1-alexander.levin@verizon.com> <20171122222526.20021-18-alexander.levin@verizon.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5366706.g4Ro4b4d8b"; micalg="sha256"; protocol="application/pkcs7-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart5366706.g4Ro4b4d8b Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Wednesday, November 22, 2017 11:25:40 PM CET alexander.levin@verizon.com wrote: > From: Milian Wolff > > [ Upstream commit 9856240ad3269f2fdab0b2fa4400ef8aab792061 ] Hello Alexander, this is the first time I encounter AUTOSEL. I just want to check: The patch below depends on others in a whole series that reworks the handling of inline frames. Why is only this one getting selected? I don't even think it can work stand-alone? Thanks > The fake symbols we create for inlined frames will represent different > functions but can use the symbol start address. This leads to issues > when different inline branches all lead to the same function. > > Before: > ~~~~~ > $ perf report -s sym -i perf.inlining.data --inline --stdio -g function > ... > --38.86%--_start > __libc_start_main > main > > --37.57%--std::norm (inlined) > std::_Norm_helper::_S_do_it > (inlined) > > --36.36%--std::abs (inlined) > std::__complex_abs (inlined) > > > --12.24%--std::linear_congruential_engine 2147483647ul>::operator() (inlined) std::__detail::__mod 2147483647ul, 16807ul, 0ul> (inlined) std::__detail::_Mod 2147483647ul, 16807ul, 0ul, true, true>::__calc (inlined) ~~~~~ > > Note that this backtrace representation is completely bogus. > Complex abs does not call the linear congruential engine! It > is just a side-effect of a longer inlined stack being appended > to a shorter, different inlined stack, both of which originate > in the same function (main). > > This patch fixes the issue: > > ~~~~~ > $ perf report -s sym -i perf.inlining.data --inline --stdio -g function > ... > --38.86%--_start > __libc_start_main > main > > |--35.59%--std::uniform_real_distribution::op > |erator() |long, 16807ul, 0ul, 2147483647ul> > (inlined) | > | std::uniform_real_distribution::op > | erator() | nsigned long, 16807ul, 0ul, 2147483647ul> > | > (inlined) | > | --34.37%--std::__detail::_Adaptor | near_congruential_engine | 16807ul, 0ul, 2147483647ul>, > | double>::operator() (inlined) | > | std::generate_canonical | 53ul, > | std::linear_congruential_engin > | e | 2147483647ul> > (inlined) | > | --12.24%--std::linear_congruen > | tial_engine | 16807ul, 0ul, > | 2147483647ul>::operator() > | (inlined) | > | std::__detail::__mod > | | 2147483647ul, > | 16807ul, 0ul> > | (inlined) > | std::__detail::_Mod< > | unsigned long, > | 2147483647ul, > | 16807ul, 0ul, true, > | true>::__calc > | (inlined) > --1.99%--std::norm (inlined) > std::_Norm_helper::_S_do_it > (inlined) std::abs (inlined) > std::__complex_abs (inlined) > ~~~~~ > > Signed-off-by: Milian Wolff > Reviewed-by: Jiri Olsa > Reviewed-by: Namhyung Kim > Cc: David Ahern > Cc: Peter Zijlstra > Cc: Ravi Bangoria > Cc: Yao Jin > Link: http://lkml.kernel.org/r/20171009203310.17362-10-milian.wolff@kdab.com > Cc: Arnaldo Carvalho de Melo > [ Fix up conflict with c1fbc0cf81f1 ("perf callchain: Compare dsos (as well) > for CCKEY_FUNCTION"), remove unneeded hunk ] Signed-off-by: Arnaldo > Carvalho de Melo > > Signed-off-by: Sasha Levin > --- > tools/perf/util/callchain.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c > index 6031933d811c..3cc51e852cf0 100644 > --- a/tools/perf/util/callchain.c > +++ b/tools/perf/util/callchain.c > @@ -697,6 +697,14 @@ static enum match_result match_chain(struct > callchain_cursor_node *node, } > > if (cnode->ms.sym && sym && callchain_param.key == CCKEY_FUNCTION) { > + /* > + * Compare inlined frames based on their symbol name because > + * different inlined frames will have the same symbol start > + */ > + if (cnode->ms.sym->inlined || node->sym->inlined) > + return match_chain_strings(cnode->ms.sym->name, > + node->sym->name); > + > left = cnode->ms.sym->start; > right = sym->start; > left_dso = cnode->ms.map->dso; -- Milian Wolff | milian.wolff@kdab.com | Senior Software Engineer KDAB (Deutschland) GmbH&Co KG, a KDAB Group company Tel: +49-30-521325470 KDAB - The Qt Experts --nextPart5366706.g4Ro4b4d8b Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQE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zAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hl c3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxPTA7BgNV BAMTNENPTU9ETyBSU0EgQ2xpZW50IEF1dGhlbnRpY2F0aW9uIGFuZCBTZWN1cmUgRW1haWwgQ0EC EAf6KCF9+1doL2oEOTPysLwwDQYJYIZIAWUDBAIBBQCggZMwGAYJKoZIhvcNAQkDMQsGCSqGSIb3 DQEHATAcBgkqhkiG9w0BCQUxDxcNMTcxMTIzMDg1NTM3WjAoBgkqhkiG9w0BCQ8xGzAZMAsGCWCG SAFlAwQBAjAKBggqhkiG9w0DBzAvBgkqhkiG9w0BCQQxIgQgElYPTBw7KYY7tujlJukgtPNsgsjZ oxxLAy/kNPCKNTMwDQYJKoZIhvcNAQEBBQAEggEAV4Q8pkIuRM5IT1Jw3QyGsAHCfyvhqN4krHO5 /MVxiOU1jHrs41UkpGboaNdscbHDWmgJDe/nVV6L+9r7bypp9yHDGgLW2sDXb9/H8r6nxsTOil+x RalhSDcS9UsI8LTiUoZSptjdt546R3ZDl9dC5RWKfDnGojasgVHiOFexCmU0CdPGwotXztau2rvT tiX+qZ5uPj7VyhACS+EzjqNX1iAG7MoDnEZMQlI6TyHwe26tdqsCscjvciUTeF2at2Sjyc9QiynZ Ek2oIWwUSAivKylCQzMJpPwwpf6McKbsDC+3ez0Lqvqu9wDybI/FkaQezZRoxGuwsKYpn3rSbssD qAAAAAAAAA== --nextPart5366706.g4Ro4b4d8b-- From 1585309046312826754@xxx Tue Nov 28 11:28:41 +0000 2017 X-GM-THRID: 1585273300688272271 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread