All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tao Chen <chen.dylane@linux.dev>
To: Quentin Monnet <qmo@kernel.org>,
	ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org,
	yonghong.song@linux.dev, john.fastabend@gmail.com,
	kpsingh@kernel.org, sdf@fomichev.me, jolsa@kernel.org
Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next v2 3/3] bpftool: Display cookie for raw_tp link probe
Date: Tue, 3 Jun 2025 20:05:51 +0800	[thread overview]
Message-ID: <2f41a74e-06a6-4dc3-806b-a88783d26c8f@linux.dev> (raw)
In-Reply-To: <c3b326ea-8d79-47c1-82b7-a9f2f46ab0c3@kernel.org>

在 2025/6/3 17:36, Quentin Monnet 写道:
> On 03/06/2025 03:26, Tao Chen wrote:
>> Display cookie for raw_tp link probe, in plain mode:
>>
>>   #bpftool link
>>
>> 22: raw_tracepoint  prog 14
>>          tp 'sys_enter'  cookie 23925373020405760
>>          pids test_progs(176)
>>
>> And in json mode:
>>
>>   #bpftool link -j | jq
>>
>> [
>>    {
>>      "id": 47,
>>      "type": "raw_tracepoint",
>>      "prog_id": 79,
>>      "tp_name": "sys_enter",
>>      "cookie": 23925373020405760,
>>      "pids": [
>>        {
>>          "pid": 274,
>>          "comm": "test_progs"
>>        }
>>      ]
>>    }
>> ]
>>
>> Signed-off-by: Tao Chen <chen.dylane@linux.dev>
>> ---
>>   tools/bpf/bpftool/link.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/tools/bpf/bpftool/link.c b/tools/bpf/bpftool/link.c
>> index 52fd2c9fac..bd37f364be 100644
>> --- a/tools/bpf/bpftool/link.c
>> +++ b/tools/bpf/bpftool/link.c
>> @@ -484,6 +484,7 @@ static int show_link_close_json(int fd, struct bpf_link_info *info)
>>   	case BPF_LINK_TYPE_RAW_TRACEPOINT:
>>   		jsonw_string_field(json_wtr, "tp_name",
>>   				   u64_to_ptr(info->raw_tracepoint.tp_name));
>> +		jsonw_lluint_field(json_wtr, "cookie", info->raw_tracepoint.cookie);
>>   		break;
>>   	case BPF_LINK_TYPE_TRACING:
>>   		err = get_prog_info(info->prog_id, &prog_info);
>> @@ -876,6 +877,8 @@ static int show_link_close_plain(int fd, struct bpf_link_info *info)
>>   	case BPF_LINK_TYPE_RAW_TRACEPOINT:
>>   		printf("\n\ttp '%s'  ",
> 
> 
> Nit: See how we use a double space at the end of the string here, to
> separate the different fields in the plain output...
> 
> 
>>   		       (const char *)u64_to_ptr(info->raw_tracepoint.tp_name));
>> +		if (info->raw_tracepoint.cookie)
>> +			printf("cookie %llu ", info->raw_tracepoint.cookie);
> 
> 
> ... Please use a double space here in a similar way, at the end of your
> "cookie %llu  " format string.
> 

Will fix it in v3, thanks.

> Looks good otherwise. Thanks,
> Quentin


-- 
Best Regards
Tao Chen

  reply	other threads:[~2025-06-03 12:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-03  2:26 [PATCH bpf-next v2 1/3] bpf: Add cookie to raw_tp bpf_link_info Tao Chen
2025-06-03  2:26 ` [PATCH bpf-next v2 2/3] selftests/bpf: Add cookies check for raw_tp fill_link_info test Tao Chen
2025-06-03 12:19   ` Jiri Olsa
2025-06-03  2:26 ` [PATCH bpf-next v2 3/3] bpftool: Display cookie for raw_tp link probe Tao Chen
2025-06-03  9:36   ` Quentin Monnet
2025-06-03 12:05     ` Tao Chen [this message]
2025-06-03 12:19 ` [PATCH bpf-next v2 1/3] bpf: Add cookie to raw_tp bpf_link_info Jiri Olsa
2025-06-03 14:52 ` Yonghong Song
2025-06-03 15:07   ` Tao Chen
2025-06-03 16:12     ` Jiri Olsa

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=2f41a74e-06a6-4dc3-806b-a88783d26c8f@linux.dev \
    --to=chen.dylane@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=qmo@kernel.org \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.