Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2360454rwb; Thu, 27 Jul 2023 06:14:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlF+oVPdYnsUw9ANHyz7E3f2cJwR6Gn3efGb2fP9sCIGyseuduxcMf3ERtey/1A6dg/p5fRt X-Received: by 2002:a05:6a21:9995:b0:133:31a5:51e7 with SMTP id ve21-20020a056a21999500b0013331a551e7mr3285987pzb.15.1690463652356; Thu, 27 Jul 2023 06:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690463652; cv=none; d=google.com; s=arc-20160816; b=ZBDIYgck1z0fGFHG89B9b0C+LbdnrPGdLHs5uN8ERUrRXGcDhcCp0ZnUZXLHsw623L 5/S+ajP1D8PiVmeC1AHnQTAPclr4fDOmIvTTSO+iAcX7h0/RIhwVwNDk2rJDghxE/wgW jMRuCEJmeLSy+RmrDTAbL97h/0YwMycZf7c5JIeagbi2NLRpdC4BstF2EfqF3CZQZCoV 3QFP21tC8jH1bI/hFWjenAtPf8dMJRsXOxkQv6Mecm5bio1ToSn485WmLhjw2UQfjD7n CU02b5NRRt9PGmt1ZwxR+sU0sK7d0x5BOvjxtrV+w3mNbt0eZfk4yhc/hmj9vq8/fLAM rU7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=jFRrbIUCHOY+6JOYujMMspRTcHaRqn1EnfviwfGBe5E=; fh=3IBXTelm8+hxyopXmYYV/kZaHl5BXu7iQrIz1MkNI5s=; b=eoufJsLhgrTM3aAoBQhDjx2Q39KHXL2JR6BtmiSfj5w6ghdIjXkIMr3OZTCIkC1W+H HLErbK8HvnyZFzqSHBXxUuXiiLS+om+1gEulvpOhXAq8aBLMiJi4mQqA3XlQ3F6g1O6g Ab/x2AB7d4p1CyhEQqBeP2tgkysCRoWz6eeAe7IPhzuVxpiiCpuh6JMZg/ZnFAG6vioN 5MEhSA6kD8YRofonWE0DsWoNQpYvYfhjKwPIHG6yKVt8iPlGpeIWcMpRMHkjl5VXdp3d 5Z0nPkASx93sdT05kC3j3GbZLAzGJ3kKpesCmTW5MTsj7KKMzsW6meNmAbst/shHUHdh vsAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MhisU28y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a10-20020a631a4a000000b00563de62f2bbsi1205943pgm.340.2023.07.27.06.13.56; Thu, 27 Jul 2023 06:14:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MhisU28y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233804AbjG0MTA (ORCPT + 99 others); Thu, 27 Jul 2023 08:19:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232868AbjG0MS7 (ORCPT ); Thu, 27 Jul 2023 08:18:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8762F2D43; Thu, 27 Jul 2023 05:18:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1452361E4F; Thu, 27 Jul 2023 12:18:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1438C433C7; Thu, 27 Jul 2023 12:18:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690460337; bh=57zSj/yFal01XDGjLFy3lJR7Hb07OITJ0jD0DWpDUbU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MhisU28y87+zEiUIGVZ0R2jAVHJk1SfSwg3N16kkQOFtESybTDjjNyoj88XaypMvh qLZ4i8l9Skc0kHZXWBPsCPFY7nWda3Vx9aDXxk/leqCQ2+/JD5CcN679xql8yLmLT4 q2IDlxNmV8r56FU6PMa4zJg1t6H5yNlRAT+3nQnKgtPqS8gbrRYeZsBNyE1a8t9pDf VB89pWe+fQMgP9G1mzH8HiAjd0JUFjGw7at/oTwSKxIXW764fYgFqjdLSXonDhk3+o GmS2tBJ65cXUMzZ1XlYt53YRhFsFHqqpuvdokYQRUhKrhFq6lopQaxfDiYbYyuuGFn cvi1kZHYMf6TA== Date: Thu, 27 Jul 2023 13:18:52 +0100 From: Will Deacon To: Josh Poimboeuf Cc: linux-kernel@vger.kernel.org, kernel-team@android.com, Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , John Stultz , linux-kbuild@vger.kernel.org Subject: Re: [PATCH v2 2/2] scripts/faddr2line: Constrain readelf output to symbols from System.map Message-ID: <20230727121851.GA19653@willie-the-truck> References: <20230725211157.17031-1-will@kernel.org> <20230725211157.17031-3-will@kernel.org> <20230725213805.g6osfswz5o6cxusy@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230725213805.g6osfswz5o6cxusy@treble> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 25, 2023 at 02:38:05PM -0700, Josh Poimboeuf wrote: > On Tue, Jul 25, 2023 at 10:11:57PM +0100, Will Deacon wrote: > > @@ -185,7 +186,7 @@ __faddr2line() { > > found=2 > > break > > fi > > - done < <(${READELF} --symbols --wide $objfile | sed 's/\[.*\]//' | ${AWK} -v sec=$sym_sec '$7 == sec' | sort --key=2) > > + done < <(${READELF} --symbols --wide $objfile | sed -f ${IGNORED_SYMS} -e 's/\[.*\]//' | ${AWK} -v sec=$sym_sec '$7 == sec' | sort --key=2) > > > > if [[ $found = 0 ]]; then > > warn "can't find symbol: sym_name: $sym_name sym_sec: $sym_sec sym_addr: $sym_addr sym_elf_size: $sym_elf_size" > > Looks good, though the outer loop has another readelf incantation: > > done < <(${READELF} --symbols --wide $objfile | sed 's/\[.*\]//' | ${AWK} -v fn=$sym_name '$4 == "FUNC" && $8 == fn') > > It should probably have the same sed options? Hmm, I don't think it's needed there, is it? The awk expression has a strict match on $sym_name, which is going to be something extracted from a kernel log and therefore exists in kallsyms. > Also it looks like it's wrongly checking for FUNC. Yes, I agree that should be dropped for the reasons you gave before. So I can spin a v3, with an extra patch to avoid checking against FUNC. Will