From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Will Deacon <will@kernel.org>
Cc: linux-kernel@vger.kernel.org, kernel-team@android.com,
Masahiro Yamada <masahiroy@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Nicolas Schier <nicolas@fjasle.eu>,
John Stultz <jstultz@google.com>,
linux-kbuild@vger.kernel.org
Subject: Re: [PATCH v2 2/2] scripts/faddr2line: Constrain readelf output to symbols from System.map
Date: Thu, 27 Jul 2023 09:49:27 -0700 [thread overview]
Message-ID: <20230727164927.3bjth6ac75jh6rdr@treble> (raw)
In-Reply-To: <20230727121851.GA19653@willie-the-truck>
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
prev parent reply other threads:[~2023-07-27 16:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-25 21:11 [PATCH v2 0/2] Fix 'faddr2line' for LLVM arm64 builds Will Deacon
2023-07-25 21:11 ` [PATCH v2 1/2] scripts/mksysmap: Factor out sed ignored symbols expression into script Will Deacon
2023-07-25 21:11 ` [PATCH v2 2/2] scripts/faddr2line: Constrain readelf output to symbols from System.map Will Deacon
2023-07-25 21:38 ` Josh Poimboeuf
2023-07-27 12:18 ` Will Deacon
2023-07-27 16:49 ` Josh Poimboeuf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230727164927.3bjth6ac75jh6rdr@treble \
--to=jpoimboe@kernel.org \
--cc=jstultz@google.com \
--cc=kernel-team@android.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nicolas@fjasle.eu \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®