Re: [PATCH bpf-next 3/3] bpftool: Display ref_ctr_offset for uprobe link info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2025-05-07 11:18 UTC-0700 ~ Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx>
> On Wed, May 7, 2025 at 2:40 AM Quentin Monnet <qmo@xxxxxxxxxx> wrote:
>>
>> 2025-05-07 10:56 UTC+0200 ~ Jiri Olsa <olsajiri@xxxxxxxxx>
>>> On Tue, May 06, 2025 at 03:33:33PM -0700, Andrii Nakryiko wrote:
>>>> On Tue, May 6, 2025 at 6:58 AM Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
>>>>>
>>>>> Adding support to display ref_ctr_offset in link output, like:
>>>>>
>>>>>   # bpftool link
>>>>>   ...
>>>>>   42: perf_event  prog 174
>>>>>           uprobe /proc/self/exe+0x102f13  cookie 3735928559  ref_ctr_offset 50500538
>>>>
>>>> let's use hex for ref_ctr_offset?
>>>
>>> I had that, then I saw cookie was dec ;-) either way is fine for me
>>
>> I'm fine either way, but let's use the same base for the two values
>> please. If you want to change the cookie to hexa (in the plain output)
>> for better readability, that's OK as well (JSON output needs to remain a
>> decimal in both cases, of course).
> 
> Why should cookie and offset use the same base? Offset is always
> address-like, so hex makes most sense there, 100%. But a cookie is
> most probably going to be some small value (index into array, or small
> number representing attachment point number, etc), so decimal is most
> natural. Importantly, BPF cookie can't really be a pointer (what will
> you do with it on BPF side?), so it's something a bit more
> human-driven, and thus decimal seems like a better default.

OK my bad, I take it back, then :)

Quentin




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux