Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp111015rwb; Thu, 27 Jul 2023 10:04:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlEi74JwAZ/nwgCb6/56UKYgFHYaKfvXnCi6v0/gSi59Z7U/+fBLImlffe3gP10yLUF6HgWr X-Received: by 2002:a17:906:32d6:b0:98d:f4a7:71cf with SMTP id k22-20020a17090632d600b0098df4a771cfmr2393336ejk.62.1690477445784; Thu, 27 Jul 2023 10:04:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690477445; cv=none; d=google.com; s=arc-20160816; b=WxaD9Bp+FTiB2JiHeJu1ge03DmRhXXO8c4tTrDIEtj++tiucA5mp3cuwmhfOr14VM8 bT8H50TJAy56DNGP/MZKw/cJtmWirkSDC44IOwnTBuPDMUabAnAXj4NITuQawHcFderj BjIU10lrx3Nnaj0wvrKuKnV0kg1a251gAceIaE3m+WPxGA+dN3bLgwMgBQmCWle/0CEE ZtkHP+VuffisMHhXQzsjVGsZERci/l8wQWYw2zUXtRsI9ZikrxilC7nabyloTXHWJrKF NU8Zh+fH9qTAIB2s6Y3oOR9OGjYKVttFn5cSneUNEkk6JbBJegKJGn0Y6ihU7OO+4hLu uDVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Tqj4WhV8QRFWNQLTnHkvSMcqqM8OMHp4hVsCnaaW+yQ=; fh=idiqMXLaMQZcpH9/6e4eRIL7FoMVG+SsZ9kcL+9gE9o=; b=z4pWEyxNVwzwg+G3m5XjnnowZuIJj2qzU+Q10y7ChDjmYHD5LkNWYm1HK19ocpow3L U49MWRFRDTnX6KC0S0U4G06S/Wd7Up2Q1YY7BD+rsDMIqTqtMSB8pNy1ZfWZ3NA1T79l uQ+P0g+t9qHMi17JDr89vs1lceoUfdjXWLhTdiOPUe7cPv/eGNGZCZ8jku5PmrMAvG0U BfausmgOHAudFj4UsHXE5MIYUyJ3bUvvpTxLg0xOXwgk2eNatL+tkvFRpYOqie7/d01N 1ufnCWaKlQf0AlJmc6NHaKuqR4SuNH7Ry+PbMfvMDB0wY476OUFy4E38A3qiMkpHWiSX Nx7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ga5J9/+3"; 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 y13-20020a170906524d00b00993cc1242ccsi1211162ejm.623.2023.07.27.10.03.39; Thu, 27 Jul 2023 10:04:05 -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="ga5J9/+3"; 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 S229633AbjG0Qt6 (ORCPT + 99 others); Thu, 27 Jul 2023 12:49:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230085AbjG0Qt5 (ORCPT ); Thu, 27 Jul 2023 12:49:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A41F01724; Thu, 27 Jul 2023 09:49:56 -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 40A9161EE2; Thu, 27 Jul 2023 16:49:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEB7EC433C8; Thu, 27 Jul 2023 16:49:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690476595; bh=gcwSoL2bkDWbowCSuuulpc/4xH1rTxXZ2w4KlNaV8sw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ga5J9/+3lu2HE+A49nb6Q8RsDrf1xcwmIjw20AVQZ1wu+uPt1Qczw2tW5SfIj937U FjQxAIrzJNrwEWwOcjrsbgYsXWxYrCoTFsJfEqickqDZtR6p5W03DnYFnXS1SJZRs7 QTT18Irx2tocg/Lr4BFTVYwyJYSfQwch3AEO2fqf5pZxBriszkPHMbV70I0LJUV67Y DQ/++5Bu58zNLWsZ6nOQi/hTQ73JNz90k5Ma4G4ORiViRqL6SyS3gCfAsqoiNeM8rc uJcyM5wJszKFtdrPXPAhIyfJWMJCgfrRY6sGjOGSsyg9ZTYVHl2sQMLhx1UXqThGA9 yhjEiL6ccCMNQ== Date: Thu, 27 Jul 2023 09:49:27 -0700 From: Josh Poimboeuf To: Will Deacon 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: <20230727164927.3bjth6ac75jh6rdr@treble> References: <20230725211157.17031-1-will@kernel.org> <20230725211157.17031-3-will@kernel.org> <20230725213805.g6osfswz5o6cxusy@treble> <20230727121851.GA19653@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230727121851.GA19653@willie-the-truck> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Thu, Jul 27, 2023 at 01:18:52PM +0100, Will Deacon wrote: > 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. Yes, I think you're right. > > 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. Sounds good, thanks! -- Josh