Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13478589ybl; Sun, 29 Dec 2019 12:53:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwiFv8+VTAY9nO68OQrTJ2++VhMcFOi1BnKd6DEafHJ8QjJMN+H9u+PC4xBQV6aVZvOAaaT X-Received: by 2002:a9d:6d10:: with SMTP id o16mr71993506otp.28.1577652791328; Sun, 29 Dec 2019 12:53:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652791; cv=none; d=google.com; s=arc-20160816; b=INopJ6PdW0ATfM5IjKBkdWRbsfoouL7/HTE9uLtrpNk/8ohZ/PDio/eotbzgMs16TW b+d8R6xoSZrDsSOUd1QXTrYOalSaAZhzrNqJBbJ7DHzEVtMVlfhampLWCLViZM7xqsQn w5OsrmkCJvScs/Z6v1PVVyk8v8wZ6L8LaZkeO1hC2CpQUmpAdmPL3kErsDjq6DZxnrfW BMJ15U3RFGEj1qodWQ1PZvFp7eNHnw7LAjOK6zAGCxUqjr6Jyj65SJVbMN94g4AGqM59 s3hPmXunw9Mqncik8+6sGhf7V6+uc7Io25KEVwef7zgEXrumyZMjXYc9O61rTGv9Va4O Skyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:from :references:cc:to:subject; bh=q4B7eLcsL4cfmnAGXhPtMHDr3KE6XyEpVSvwXDB6zl0=; b=bEEeh7rI+HR3zguSp9mAH8a4RvtJTeUPuZ723YRgjamXpzzpjGCmln17/N+SP16pzW LONuJxvSwAJAFemoU4LMq5Z8HrREGd7NQQtwdu1oZVRGSJIVVDxhFtLn2TLE5BVdlGPr Yyvt9AFQo/OxvFRAuS/46nD+yrn6DPo0Itk/GCBpj2Ehrv3iYa2bgk7zGzBe70uGDnJU vd/4KHwBbJefbF55WzlZ2lEeDanmu8coYjiYn9Y1Ztqk3Jlg2/4bJ0zhMg0yYD5eRmHx 5clVO8ydE9gitWklGbdcF3o5lhGb3foEwhYnPzXh87OUuagtBKHTz4wfrguZwKmdD/kb T6Jw== 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 a5si16402361oie.17.2019.12.29.12.53.00; Sun, 29 Dec 2019 12:53:11 -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 S1727093AbfL2ShH (ORCPT + 99 others); Sun, 29 Dec 2019 13:37:07 -0500 Received: from mx1.yrkesakademin.fi ([85.134.45.194]:16030 "EHLO mx1.yrkesakademin.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726455AbfL2ShH (ORCPT ); Sun, 29 Dec 2019 13:37:07 -0500 Subject: Re: [PATCH 5.4 250/434] perf probe: Fix to show inlined function callsite without entry_pc To: Greg Kroah-Hartman , CC: , Masami Hiramatsu , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Sasha Levin References: <20191229172702.393141737@linuxfoundation.org> <20191229172718.511624671@linuxfoundation.org> From: Thomas Backlund Message-ID: Date: Sun, 29 Dec 2019 20:37:04 +0200 MIME-Version: 1.0 In-Reply-To: <20191229172718.511624671@linuxfoundation.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-WatchGuard-Spam-ID: str=0001.0A0C0209.5E08F252.004A,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-WatchGuard-Spam-Score: 0, clean; 0, virus threat unknown X-WatchGuard-Mail-Client-IP: 85.134.45.194 X-WatchGuard-Mail-From: tmb@mageia.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Den 29-12-2019 kl. 19:25, skrev Greg Kroah-Hartman: > From: Masami Hiramatsu > > [ Upstream commit 18e21eb671dc87a4f0546ba505a89ea93598a634 ] > > Fix 'perf probe --line' option to show inlined function callsite lines > even if the function DIE has only ranges. > > Without this: > > # perf probe -L amd_put_event_constraints > ... > 2 { > 3 if (amd_has_nb(cpuc) && amd_is_nb_event(&event->hw)) > __amd_put_nb_event_constraints(cpuc, event); > 5 } > > With this patch: > > # perf probe -L amd_put_event_constraints > ... > 2 { > 3 if (amd_has_nb(cpuc) && amd_is_nb_event(&event->hw)) > 4 __amd_put_nb_event_constraints(cpuc, event); > 5 } > > Committer testing: > > Before: > > [root@quaco ~]# perf probe -L amd_put_event_constraints > > 0 static void amd_put_event_constraints(struct cpu_hw_events *cpuc, > struct perf_event *event) > 2 { > 3 if (amd_has_nb(cpuc) && amd_is_nb_event(&event->hw)) > __amd_put_nb_event_constraints(cpuc, event); > 5 } > > PMU_FORMAT_ATTR(event, "config:0-7,32-35"); > PMU_FORMAT_ATTR(umask, "config:8-15" ); > > [root@quaco ~]# > > After: > > [root@quaco ~]# perf probe -L amd_put_event_constraints > > 0 static void amd_put_event_constraints(struct cpu_hw_events *cpuc, > struct perf_event *event) > 2 { > 3 if (amd_has_nb(cpuc) && amd_is_nb_event(&event->hw)) > 4 __amd_put_nb_event_constraints(cpuc, event); > 5 } > > PMU_FORMAT_ATTR(event, "config:0-7,32-35"); > PMU_FORMAT_ATTR(umask, "config:8-15" ); > > [root@quaco ~]# perf probe amd_put_event_constraints:4 > Added new event: > probe:amd_put_event_constraints (on amd_put_event_constraints:4) > > You can now use it in all perf tools, such as: > > perf record -e probe:amd_put_event_constraints -aR sleep 1 > > [root@quaco ~]# > > [root@quaco ~]# perf probe -l > probe:amd_put_event_constraints (on amd_put_event_constraints:4@arch/x86/events/amd/core.c) > probe:clear_tasks_mm_cpumask (on clear_tasks_mm_cpumask@kernel/cpu.c) > [root@quaco ~]# > > Using it: > > [root@quaco ~]# perf trace -e probe:* > ^C[root@quaco ~]# > > Ok, Intel system here... :-) > > Fixes: 4cc9cec636e7 ("perf probe: Introduce lines walker interface") > Signed-off-by: Masami Hiramatsu > Tested-by: Arnaldo Carvalho de Melo > Cc: Jiri Olsa > Cc: Namhyung Kim > Link: http://lore.kernel.org/lkml/157199322107.8075.12659099000567865708.stgit@devnote2 > Signed-off-by: Arnaldo Carvalho de Melo > Signed-off-by: Sasha Levin > --- > tools/perf/util/dwarf-aux.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c > index 4b1890204e99..08aba015e072 100644 > --- a/tools/perf/util/dwarf-aux.c > +++ b/tools/perf/util/dwarf-aux.c > @@ -673,7 +673,7 @@ static int __die_walk_funclines_cb(Dwarf_Die *in_die, void *data) > if (dwarf_tag(in_die) == DW_TAG_inlined_subroutine) { > fname = die_get_call_file(in_die); > lineno = die_get_call_lineno(in_die); > - if (fname && lineno > 0 && dwarf_entrypc(in_die, &addr) == 0) { > + if (fname && lineno > 0 && die_entrypc(in_die, &addr) == 0) { > lw->retval = lw->callback(fname, lineno, addr, lw->data); > if (lw->retval != 0) > return DIE_FIND_CB_END; > Still broken... util/dwarf-aux.c: In function '__die_walk_funclines_cb': util/dwarf-aux.c:683:30: warning: implicit declaration of function 'die_entrypc'; did you mean 'dwarf_entrypc'? [-Wimplicit-function-declaration] 683 | if (fname && lineno > 0 && die_entrypc(in_die, &addr) == 0) { -- Thomas