Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13966006ybl; Mon, 30 Dec 2019 01:15:23 -0800 (PST) X-Google-Smtp-Source: APXvYqykAgttq0NxLHBpe1ru3vuJOirlTFmUHo/DUOTn/feGK71sZT3zDx/iLEFPRSvSPgyZaBwo X-Received: by 2002:a9d:768b:: with SMTP id j11mr72707146otl.116.1577697323132; Mon, 30 Dec 2019 01:15:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577697323; cv=none; d=google.com; s=arc-20160816; b=sEm1/Jtya/AITqzbvstHHLa6jgUpWM3nAeu8yQYPaFVqVZdynnghe+JpL5lA06TKuJ fLvlPLpBTUxHt457F5eFJagfUwrHLlXmV/tbjs7pC3PofCXBkoOzkh0Iu2LNt2GXktVy sqV1E9bd6CwxPkJvzjBTsQMBwTxneIIi5gtk68obgrx7h7yBDRnIWYcVnWUDzkXgJ3Cq 64aIy//sT9Qi3sMPKmDInd7Xm8diKTBRjuRX80aBpll7nCE9GA4wkzuiBcWj1H6awXoB bSq9uutWrISfFNYBZ3gRJCBeGfXFz7KA3kekdRAJohTVRI9YDqPQUmx2JLzVHLHKEKut yjUg== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=pRnowo1H5RCI7FakeZrq2XYOTEj7lt2GEJ5qwCEDX+I=; b=k1CQI0uXqlfjxvVSXgvM4PTLzKfkAA4qDG31xQCEimbmm76qBzkfnEw5E7bsznScpq 1tgeZKhyjxzgtn2UcAZT3IJUWMeyjvvJ+Ta0pUJZ/+/NYj4BhT4BhiFFEMjMnqBjF9jz bhf6ItCSOqhnHtLeqh84CgXdHyDsWwplWSiIaKFKNvWXKYFyEC2F2nmqQKi13Qebqf0Y zMVHll3JXLiAofPys59ATT2ZzsUakEnEilQqeiRKY0FtcDYYHd4TPQZl8WXYt58i4Umw SOOwq0QqtoTgY047CANZMKnosigB7qDNf17DP2q71hpHxY5jSvkdbu4Kv0z4J2C9nJQ+ OMyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JslN9Gb1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v28si21910316ote.55.2019.12.30.01.15.11; Mon, 30 Dec 2019 01:15:23 -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; dkim=pass header.i=@kernel.org header.s=default header.b=JslN9Gb1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727334AbfL3JO1 (ORCPT + 99 others); Mon, 30 Dec 2019 04:14:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:34274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727243AbfL3JO1 (ORCPT ); Mon, 30 Dec 2019 04:14:27 -0500 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AA8182072E; Mon, 30 Dec 2019 09:14:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577697265; bh=Jtv2Oqg+19UNbmF4oyZbciqhWHNUAETFbeiuH1l/y9E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JslN9Gb19kdZ+42Z11azLYVaEAVAZchT6BhvZS3hAKN4nh52HDcXDx0mkw+w2pzlZ VAQRhMZJLLq0szxtHceSe9YoPzj7lMqfUeJRpAKzpG4L1jOCt6B5JYRx2dWXPhmReJ wCMZbxfk6Hp0wDNeKUWolUhDFFCbjbDSUX6V2Crg= Date: Mon, 30 Dec 2019 18:14:20 +0900 From: Masami Hiramatsu To: Thomas Backlund Cc: Greg Kroah-Hartman , , , Masami Hiramatsu , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Sasha Levin Subject: Re: [PATCH 5.4 245/434] perf probe: Fix to list probe event with correct line number Message-Id: <20191230181420.737a4da2a8a3efd158f01b06@kernel.org> In-Reply-To: References: <20191229172702.393141737@linuxfoundation.org> <20191229172718.158972713@linuxfoundation.org> <689591f8-0798-af22-9a04-4a1e6e894a55@mageia.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Dec 2019 01:00:14 +0200 Thomas Backlund wrote: > Den 29-12-2019 kl. 20:42, skrev Thomas Backlund: > > Den 29-12-2019 kl. 19:24, skrev Greg Kroah-Hartman: > >> From: Masami Hiramatsu > >> > >> [ Upstream commit 3895534dd78f0fd4d3f9e05ee52b9cdd444a743e ] > >> > >> Since debuginfo__find_probe_point() uses dwarf_entrypc() for finding the > >> entry address of the function on which a probe is, it will fail when the > >> function DIE has only ranges attribute. > >> > >> To fix this issue, use die_entrypc() instead of dwarf_entrypc(). > >> > >> Without this fix, perf probe -l shows incorrect offset: > >> > >>    # perf probe -l > >>      probe:clear_tasks_mm_cpumask (on > >> clear_tasks_mm_cpumask+18446744071579263632@work/linux/linux/kernel/cpu.c) > >> > >>      probe:clear_tasks_mm_cpumask_1 (on > >> clear_tasks_mm_cpumask+18446744071579263752@work/linux/linux/kernel/cpu.c) > >> > >> > >> With this: > >> > >>    # perf probe -l > >>      probe:clear_tasks_mm_cpumask (on > >> clear_tasks_mm_cpumask@work/linux/linux/kernel/cpu.c) > >>      probe:clear_tasks_mm_cpumask_1 (on > >> clear_tasks_mm_cpumask:21@work/linux/linux/kernel/cpu.c) > >> > >> Committer testing: > >> > >> Before: > >> > >>    [root@quaco ~]# perf probe -l > >>      probe:clear_tasks_mm_cpumask (on > >> clear_tasks_mm_cpumask+18446744071579765152@kernel/cpu.c) > >>    [root@quaco ~]# > >> > >> After: > >> > >>    [root@quaco ~]# perf probe -l > >>      probe:clear_tasks_mm_cpumask (on > >> clear_tasks_mm_cpumask@kernel/cpu.c) > >>    [root@quaco ~]# > >> > >> Fixes: 1d46ea2a6a40 ("perf probe: Fix listing incorrect line number > >> with inline function") > >> Signed-off-by: Masami Hiramatsu > >> Tested-by: Arnaldo Carvalho de Melo > >> Cc: Jiri Olsa > >> Cc: Namhyung Kim > >> Link: > >> http://lore.kernel.org/lkml/157199321227.8075.14655572419136993015.stgit@devnote2 > >> > >> Signed-off-by: Arnaldo Carvalho de Melo > >> Signed-off-by: Sasha Levin > >> --- > >>   tools/perf/util/probe-finder.c | 4 ++-- > >>   1 file changed, 2 insertions(+), 2 deletions(-) > >> > >> diff --git a/tools/perf/util/probe-finder.c > >> b/tools/perf/util/probe-finder.c > >> index cd9f95e5044e..7c8d30fb2b99 100644 > >> --- a/tools/perf/util/probe-finder.c > >> +++ b/tools/perf/util/probe-finder.c > >> @@ -1578,7 +1578,7 @@ int debuginfo__find_probe_point(struct debuginfo > >> *dbg, unsigned long addr, > >>           /* Get function entry information */ > >>           func = basefunc = dwarf_diename(&spdie); > >>           if (!func || > >> -            dwarf_entrypc(&spdie, &baseaddr) != 0 || > >> +            die_entrypc(&spdie, &baseaddr) != 0 || > >>               dwarf_decl_line(&spdie, &baseline) != 0) { > >>               lineno = 0; > >>               goto post; > >> @@ -1595,7 +1595,7 @@ int debuginfo__find_probe_point(struct debuginfo > >> *dbg, unsigned long addr, > >>           while (die_find_top_inlinefunc(&spdie, (Dwarf_Addr)addr, > >>                           &indie)) { > >>               /* There is an inline function */ > >> -            if (dwarf_entrypc(&indie, &_addr) == 0 && > >> +            if (die_entrypc(&indie, &_addr) == 0 && > >>                   _addr == addr) { > >>                   /* > >>                    * addr is at an inline function entry. > >> > > > > > > still broken > > > > /usr/bin/ld: perf-in.o: in function `debuginfo__find_probe_point': > > /work/rpmbuild/BUILD/kernel-x86_64/linux-5.4/tools/perf/util/probe-finder.c:1616: > > undefined reference to `die_entrypc' > > > > > And the fix for the perf build errors I reported against: > [PATCH 5.4 245/434] perf probe: Fix to list probe event with correct > line number > [PATCH 5.4 248/434] perf probe: Fix to probe an inline function which > has no entry pc > [PATCH 5.4 249/434] perf probe: Fix to show ranges of variables in > functions without entry_pc > [PATCH 5.4 250/434] perf probe: Fix to show inlined function callsite > without entry_pc > [PATCH 5.4 252/434] perf probe: Fix to probe a function which has no > entry pc > > is to add the missing: > > From 91e2f539eeda26ab00bd03fae8dc434c128c85ed Mon Sep 17 00:00:00 2001 > From: Masami Hiramatsu > Date: Thu, 24 Oct 2019 18:12:54 +0900 > Subject: [PATCH] perf probe: Fix to show function entry line as probe-able Thanks Thomas, you're right. The die_entrypc() was newly added by that commit for finding correct entry PC of functions. Greg, could you please apply above fix too? Thank you, -- Masami Hiramatsu