Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 406b5c1

Browse files
bjohannesmeyerjpoimboe
authored andcommitted
scripts/faddr2line: Remove call to addr2line from find_dir_prefix()
Use the single long-running faddr2line process from find_dir_prefix(). Signed-off-by: Brian Johannesmeyer <bjohannesmeyer@gmail.com> Link: https://lore.kernel.org/r/20240415145538.1938745-7-bjohannesmeyer@gmail.com Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
1 parent e36b69e commit 406b5c1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/faddr2line

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,17 @@ command -v ${ADDR2LINE} >/dev/null 2>&1 || die "${ADDR2LINE} isn't installed"
8585
# init/main.c! This only works for vmlinux. Otherwise it falls back to
8686
# printing the absolute path.
8787
find_dir_prefix() {
88-
local objfile=$1
89-
9088
local start_kernel_addr=$(echo "${ELF_SYMS}" | sed 's/\[.*\]//' |
9189
${AWK} '$8 == "start_kernel" {printf "0x%s", $2}')
9290
[[ -z $start_kernel_addr ]] && return
9391

94-
local file_line=$(${ADDR2LINE} -e $objfile $start_kernel_addr)
95-
[[ -z $file_line ]] && return
92+
run_addr2line ${start_kernel_addr} ""
93+
[[ -z $ADDR2LINE_OUT ]] && return
9694

95+
local file_line=${ADDR2LINE_OUT#* at }
96+
if [[ -z $file_line ]] || [[ $file_line = $ADDR2LINE_OUT ]]; then
97+
return
98+
fi
9799
local prefix=${file_line%init/main.c:*}
98100
if [[ -z $prefix ]] || [[ $prefix = $file_line ]]; then
99101
return
@@ -350,7 +352,7 @@ echo "${ELF_SECHEADERS}" | ${GREP} -q '\.debug_info' || die "CONFIG_DEBUG_INFO n
350352
init_addr2line $objfile
351353

352354
DIR_PREFIX=supercalifragilisticexpialidocious
353-
find_dir_prefix $objfile
355+
find_dir_prefix
354356

355357
FIRST=1
356358
while [[ $# -gt 0 ]]; do

0 commit comments

Comments
 (0)