linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* faddr2line issue
@ 2022-07-08 14:47 John Garry
  2022-07-14  9:57 ` John Garry
  0 siblings, 1 reply; 8+ messages in thread
From: John Garry @ 2022-07-08 14:47 UTC (permalink / raw)
  To: jpoimboe; +Cc: Linux Kernel Mailing List

Hi Josh,

I am finding that for a few mainline kernel releases that faddr2line 
does seem to be working:

./scripts/faddr2line vmlinux  sas_discover_domain+0x4dc/0x560
sas_discover_domain+0x4dc/0x560:
fs mm ??:0

This is on my arm64 system. I have not tried another arch. Are there any 
known issues?

Maybe I'm using it incorrectly... I can go back and see when this 
stopped working for me.

Cheers,
John

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: faddr2line issue
  2022-07-08 14:47 faddr2line issue John Garry
@ 2022-07-14  9:57 ` John Garry
  2022-07-14 16:41   ` Josh Poimboeuf
  0 siblings, 1 reply; 8+ messages in thread
From: John Garry @ 2022-07-14  9:57 UTC (permalink / raw)
  To: jpoimboe, keescook; +Cc: Linux Kernel Mailing List

On 08/07/2022 15:47, John Garry wrote:

+

JFYI, This issue is caused by CONFIG_DEBUG_INFO now being default off in 
my .config from commit f9b3cd245784 ("Kconfig.debug: make DEBUG_INFO 
selectable from a choice").

By enabling that config faddr2line now looks ok again.

BTW, Could we add a check for any kernel dependency in this tool?

Thanks,
John

> Hi Josh,
> 
> I am finding that for a few mainline kernel releases that faddr2line 
> does seem to be working:
> 
> ./scripts/faddr2line vmlinux  sas_discover_domain+0x4dc/0x560
> sas_discover_domain+0x4dc/0x560:
> fs mm ??:0
> 
> This is on my arm64 system. I have not tried another arch. Are there any 
> known issues?
> 
> Maybe I'm using it incorrectly... I can go back and see when this 
> stopped working for me.
> 
> Cheers,
> John


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: faddr2line issue
  2022-07-14  9:57 ` John Garry
@ 2022-07-14 16:41   ` Josh Poimboeuf
  2022-07-19 15:24     ` John Garry
  0 siblings, 1 reply; 8+ messages in thread
From: Josh Poimboeuf @ 2022-07-14 16:41 UTC (permalink / raw)
  To: John Garry; +Cc: keescook, Linux Kernel Mailing List

On Thu, Jul 14, 2022 at 10:57:51AM +0100, John Garry wrote:
> On 08/07/2022 15:47, John Garry wrote:
> 
> +
> 
> JFYI, This issue is caused by CONFIG_DEBUG_INFO now being default off in my
> .config from commit f9b3cd245784 ("Kconfig.debug: make DEBUG_INFO selectable
> from a choice").
> 
> By enabling that config faddr2line now looks ok again.
> 
> BTW, Could we add a check for any kernel dependency in this tool?

Hi John,

The script doesn't know how to reliably find the .config file, but it
should be able to check for missing DWARF in the binary itself.

-- 
Josh

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: faddr2line issue
  2022-07-14 16:41   ` Josh Poimboeuf
@ 2022-07-19 15:24     ` John Garry
  2022-07-20  0:06       ` Josh Poimboeuf
  0 siblings, 1 reply; 8+ messages in thread
From: John Garry @ 2022-07-19 15:24 UTC (permalink / raw)
  To: Josh Poimboeuf; +Cc: keescook, Linux Kernel Mailing List

On 14/07/2022 17:41, Josh Poimboeuf wrote:
> On Thu, Jul 14, 2022 at 10:57:51AM +0100, John Garry wrote:
>> On 08/07/2022 15:47, John Garry wrote:
>>
>> +
>>
>> JFYI, This issue is caused by CONFIG_DEBUG_INFO now being default off in my
>> .config from commit f9b3cd245784 ("Kconfig.debug: make DEBUG_INFO selectable
>> from a choice").
>>
>> By enabling that config faddr2line now looks ok again.
>>
>> BTW, Could we add a check for any kernel dependency in this tool?
> Hi John,
> 
> The script doesn't know how to reliably find the .config file, but it
> should be able to check for missing DWARF in the binary itself.

Hi Josh,

So adding config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT to v5.19-rc2 got it 
working again for me on arm64. However commit dcea997beed6 ("faddr2line: 
Fix overlapping text section failures, the sequel") seems to be broken 
for me, below - this first appeared in rc3. Any idea what the issue 
could be?

$./faddr.sh hisi_sas_sata_done+0x8/0x38
hisi_sas_sata_done+0x8/0x38:
fs mm ??:0

Thanks,
John

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: faddr2line issue
  2022-07-19 15:24     ` John Garry
@ 2022-07-20  0:06       ` Josh Poimboeuf
  2022-07-20  8:39         ` John Garry
  0 siblings, 1 reply; 8+ messages in thread
From: Josh Poimboeuf @ 2022-07-20  0:06 UTC (permalink / raw)
  To: John Garry; +Cc: keescook, Linux Kernel Mailing List

On Tue, Jul 19, 2022 at 04:24:42PM +0100, John Garry wrote:
> On 14/07/2022 17:41, Josh Poimboeuf wrote:
> > On Thu, Jul 14, 2022 at 10:57:51AM +0100, John Garry wrote:
> > > On 08/07/2022 15:47, John Garry wrote:
> > > 
> > > +
> > > 
> > > JFYI, This issue is caused by CONFIG_DEBUG_INFO now being default off in my
> > > .config from commit f9b3cd245784 ("Kconfig.debug: make DEBUG_INFO selectable
> > > from a choice").
> > > 
> > > By enabling that config faddr2line now looks ok again.
> > > 
> > > BTW, Could we add a check for any kernel dependency in this tool?
> > Hi John,
> > 
> > The script doesn't know how to reliably find the .config file, but it
> > should be able to check for missing DWARF in the binary itself.
> 
> Hi Josh,
> 
> So adding config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT to v5.19-rc2 got it
> working again for me on arm64. However commit dcea997beed6 ("faddr2line: Fix
> overlapping text section failures, the sequel") seems to be broken for me,
> below - this first appeared in rc3. Any idea what the issue could be?
> 
> $./faddr.sh hisi_sas_sata_done+0x8/0x38
> hisi_sas_sata_done+0x8/0x38:
> fs mm ??:0

Hm, what does faddr.sh do?  Does addr2line also fail?

Can you run

  bash -x scripts/faddr2line <vmlinux or .ko file> hisi_sas_sata_done+0x8/0x38

and share the output?

-- 
Josh

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: faddr2line issue
  2022-07-20  0:06       ` Josh Poimboeuf
@ 2022-07-20  8:39         ` John Garry
  2022-07-20 23:32           ` Josh Poimboeuf
  0 siblings, 1 reply; 8+ messages in thread
From: John Garry @ 2022-07-20  8:39 UTC (permalink / raw)
  To: Josh Poimboeuf; +Cc: keescook, Linux Kernel Mailing List

On 20/07/2022 01:06, Josh Poimboeuf wrote:
>> So adding config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT to v5.19-rc2 got it
>> working again for me on arm64. However commit dcea997beed6 ("faddr2line: Fix
>> overlapping text section failures, the sequel") seems to be broken for me,
>> below - this first appeared in rc3. Any idea what the issue could be?
>>
>> $./faddr.sh hisi_sas_sata_done+0x8/0x38
>> hisi_sas_sata_done+0x8/0x38:
>> fs mm ??:0
> Hm, what does faddr.sh do? 

ah, it's just a wrapper to call scripts/faddr2line with vmlinux and $1 
(being hisi_sas_sata_done+0x8/0x38, above) args

> Does addr2line also fail?

faddr2line fails, as below.

> 
> Can you run
> 
>    bash -x scripts/faddr2line <vmlinux or .ko file> hisi_sas_sata_done+0x8/0x38
> 
> and share the output?

on rc3 we get:

https://raw.githubusercontent.com/hisilicon/kernel-dev/private-topic-sas-5.19-faddr2line-linux-rc3/before2

With dcea997beed6 reverted on rc3:

https://raw.githubusercontent.com/hisilicon/kernel-dev/private-topic-sas-5.19-faddr2line-linux-rc3/after2

This is my branch is you want to see what I have:
https://github.com/hisilicon/kernel-dev/commits/private-topic-sas-5.19-faddr2line-linux-rc3

Thanks,
John

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: faddr2line issue
  2022-07-20  8:39         ` John Garry
@ 2022-07-20 23:32           ` Josh Poimboeuf
  2022-07-21 15:03             ` John Garry
  0 siblings, 1 reply; 8+ messages in thread
From: Josh Poimboeuf @ 2022-07-20 23:32 UTC (permalink / raw)
  To: John Garry; +Cc: keescook, Linux Kernel Mailing List

On Wed, Jul 20, 2022 at 09:39:42AM +0100, John Garry wrote:
> On 20/07/2022 01:06, Josh Poimboeuf wrote:
> > > So adding config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT to v5.19-rc2 got it
> > > working again for me on arm64. However commit dcea997beed6 ("faddr2line: Fix
> > > overlapping text section failures, the sequel") seems to be broken for me,
> > > below - this first appeared in rc3. Any idea what the issue could be?
> > > 
> > > $./faddr.sh hisi_sas_sata_done+0x8/0x38
> > > hisi_sas_sata_done+0x8/0x38:
> > > fs mm ??:0
> > Hm, what does faddr.sh do?
> 
> ah, it's just a wrapper to call scripts/faddr2line with vmlinux and $1
> (being hisi_sas_sata_done+0x8/0x38, above) args
> 
> > Does addr2line also fail?
> 
> faddr2line fails, as below.
> 
> > 
> > Can you run
> > 
> >    bash -x scripts/faddr2line <vmlinux or .ko file> hisi_sas_sata_done+0x8/0x38
> > 
> > and share the output?
> 
> on rc3 we get:
> 
> https://raw.githubusercontent.com/hisilicon/kernel-dev/private-topic-sas-5.19-faddr2line-linux-rc3/before2

Does this fix it?

diff --git a/scripts/faddr2line b/scripts/faddr2line
index 94ed98dd899f..57099687e5e1 100755
--- a/scripts/faddr2line
+++ b/scripts/faddr2line
@@ -112,7 +112,9 @@ __faddr2line() {
 	# section offsets.
 	local file_type=$(${READELF} --file-header $objfile |
 		${AWK} '$1 == "Type:" { print $2; exit }')
-	[[ $file_type = "EXEC" ]] && is_vmlinux=1
+	if [[ $file_type = "EXEC" ]] || [[ $file_type == "DYN" ]]; then
+		is_vmlinux=1
+	fi
 
 	# Go through each of the object's symbols which match the func name.
 	# In rare cases there might be duplicates, in which case we print all

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: faddr2line issue
  2022-07-20 23:32           ` Josh Poimboeuf
@ 2022-07-21 15:03             ` John Garry
  0 siblings, 0 replies; 8+ messages in thread
From: John Garry @ 2022-07-21 15:03 UTC (permalink / raw)
  To: Josh Poimboeuf; +Cc: keescook, Linux Kernel Mailing List

On 21/07/2022 00:32, Josh Poimboeuf wrote:
> On Wed, Jul 20, 2022 at 09:39:42AM +0100, John Garry wrote:
>> On 20/07/2022 01:06, Josh Poimboeuf wrote:
>>>> So adding config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT to v5.19-rc2 got it
>>>> working again for me on arm64. However commit dcea997beed6 ("faddr2line: Fix
>>>> overlapping text section failures, the sequel") seems to be broken for me,
>>>> below - this first appeared in rc3. Any idea what the issue could be?
>>>>
>>>> $./faddr.sh hisi_sas_sata_done+0x8/0x38
>>>> hisi_sas_sata_done+0x8/0x38:
>>>> fs mm ??:0
>>> Hm, what does faddr.sh do?
>>
>> ah, it's just a wrapper to call scripts/faddr2line with vmlinux and $1
>> (being hisi_sas_sata_done+0x8/0x38, above) args
>>
>>> Does addr2line also fail?
>>
>> faddr2line fails, as below.
>>
>>>
>>> Can you run
>>>
>>>     bash -x scripts/faddr2line <vmlinux or .ko file> hisi_sas_sata_done+0x8/0x38
>>>
>>> and share the output?
>>
>> on rc3 we get:
>>
>> https://raw.githubusercontent.com/hisilicon/kernel-dev/private-topic-sas-5.19-faddr2line-linux-rc3/before2
> 
> Does this fix it?
> 
> diff --git a/scripts/faddr2line b/scripts/faddr2line
> index 94ed98dd899f..57099687e5e1 100755
> --- a/scripts/faddr2line
> +++ b/scripts/faddr2line
> @@ -112,7 +112,9 @@ __faddr2line() {
>   	# section offsets.
>   	local file_type=$(${READELF} --file-header $objfile |
>   		${AWK} '$1 == "Type:" { print $2; exit }')
> -	[[ $file_type = "EXEC" ]] && is_vmlinux=1
> +	if [[ $file_type = "EXEC" ]] || [[ $file_type == "DYN" ]]; then
> +		is_vmlinux=1
> +	fi
>   
>   	# Go through each of the object's symbols which match the func name.
>   	# In rare cases there might be duplicates, in which case we print all
> .

Yeah, looks ok now.

Tested-by: John Garry <john.garry@huawei.com>

thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-07-21 15:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-08 14:47 faddr2line issue John Garry
2022-07-14  9:57 ` John Garry
2022-07-14 16:41   ` Josh Poimboeuf
2022-07-19 15:24     ` John Garry
2022-07-20  0:06       ` Josh Poimboeuf
2022-07-20  8:39         ` John Garry
2022-07-20 23:32           ` Josh Poimboeuf
2022-07-21 15:03             ` John Garry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).