From: Yonghong Song <yonghong.song@linux.dev>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Alan Maguire <alan.maguire@oracle.com>,
Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
dwarves@vger.kernel.org
Cc: Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, kernel-team@fb.com,
Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH dwarves 1/2] dwarf_loader: Trust the entry value register over the first location entry
Date: Tue, 29 Sep 2026 10:59:32 -0700 [thread overview]
Message-ID: <2c5555c4-4dbf-44cd-8fd1-9da41740d23a@linux.dev> (raw)
In-Reply-To: <DLRKT5MG6W2P.2V1P0QD4GQEKY@gmail.com>
On 9/28/26 11:11 PM, Alexei Starovoitov wrote:
> On Sat, Sep 26, 2026 at 10:49 PM Yonghong Song <yonghong.song@linux.dev> wrote:
>> Maybe we need to poke into locations to get precise parameter register.
>> For example, for argument 'b', we have
>> [0x0000000000000000, 0x0000000000000000): DW_OP_reg4 RSI
>> ...
>> [0x0000000000000008, 0x0000000000000015): DW_OP_entry_value(DW_OP_reg5 RDI), DW_OP_stack_value)
>> RSI has location starts from 0x0, RDI starts from 0x8 although it has DW_OP_entry_value.
>>
>> But this makes things complicated, and there is no garantee across different compilers due to
>> code gen.
> I don't think it has to be complicated.
> In your gcc 14 dump the first entry of 'b' starts at low_pc and it's RSI.
> In scx_bpf_task_set_lazy_resched() low_pc is ...d70 and the first entry
> of 'lazy' starts at ...d8b. RBP there says nothing about the register
> 'lazy' was passed in.
> parameter__decode_location() already has 'start' of every entry.
> Can it take the register of the first entry only when that entry
> starts at low_pc and use the entry value otherwise?
Yes, this is what I thought as well.
>
> There is no guarantee, right, but when the guess is wrong the function
> is dropped. It's not encoded with a wrong signature.
Okay, no guarantee, but it should be an improvement.
>
>> One possible workaround is change 'lazy' type from 'bool' to say 'int'.
>> As Alexei mentioned in the above, clang didn't handle 'bool' well
>> in debug info.
> That works for this kfunc and for pahole that is already released,
> but every other function with a bool arg is still dropped.
> Can clang be fixed to keep the entry range?
Let me investigate this. Probably will be slow a little bit
due lpc and some other events.
prev parent reply other threads:[~2026-09-29 17:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 21:36 [PATCH dwarves 1/2] dwarf_loader: Trust the entry value register over the first location entry Yonghong Song
2026-09-25 21:36 ` [PATCH dwarves 2/2] tests: Add test for parameters described by entry values Yonghong Song
2026-09-26 7:45 ` [PATCH dwarves 1/2] dwarf_loader: Trust the entry value register over the first location entry Alexei Starovoitov
2026-09-27 5:49 ` Yonghong Song
2026-09-27 8:37 ` Tejun Heo
2026-09-29 6:11 ` Alexei Starovoitov
2026-09-29 17:59 ` Yonghong Song [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=2c5555c4-4dbf-44cd-8fd1-9da41740d23a@linux.dev \
--to=yonghong.song@linux.dev \
--cc=alan.maguire@oracle.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=arnaldo.melo@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=dwarves@vger.kernel.org \
--cc=kernel-team@fb.com \
--cc=tj@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