From: Tao Chen <chen.dylane@gmail.com>
To: Daniel Borkmann <daniel@iogearbox.net>, Jiri Olsa <olsajiri@gmail.com>
Cc: Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next v3] libbpf: Fix expected_attach_type set when kernel not support
Date: Wed, 25 Sep 2024 22:55:00 +0800 [thread overview]
Message-ID: <680bbf09-6939-4056-bfc2-27138a93efe6@gmail.com> (raw)
In-Reply-To: <11e2ed15-b3a5-419a-9e9f-cbfe270d0fe8@iogearbox.net>
在 2024/9/25 18:36, Daniel Borkmann 写道:
> On 9/25/24 12:28 PM, Jiri Olsa wrote:
>> On Sat, Sep 14, 2024 at 11:40:40PM +0800, Tao Chen wrote:
>>> The commit "5902da6d8a52" set expected_attach_type again with
>>> field of bpf_program after libpf_prepare_prog_load, which makes
>>> expected_attach_type = 0 no sense when kenrel not support the
>>> attach_type feature, so fix it.
>>>
>>> Fixes: 5902da6d8a52 ("libbpf: Add uprobe multi link support to
>>> bpf_program__attach_usdt")
>>> Suggested-by: Jiri Olsa <jolsa@kernel.org>
>>> Signed-off-by: Tao Chen <chen.dylane@gmail.com>
>>> ---
>>> tools/lib/bpf/libbpf.c | 12 ++++++++----
>>> 1 file changed, 8 insertions(+), 4 deletions(-)
>>>
>>> Change list:
>>> - v2 -> v3:
>>> - update BPF_TRACE_UPROBE_MULTI both in prog and opts suggedted by
>>> Andrri
>>> - v1 -> v2:
>>> - restore the original initialization way suggested by Jiri
>>>
>>> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
>>> index 219facd0e66e..a78e24ff354b 100644
>>> --- a/tools/lib/bpf/libbpf.c
>>> +++ b/tools/lib/bpf/libbpf.c
>>> @@ -7352,8 +7352,14 @@ static int libbpf_prepare_prog_load(struct
>>> bpf_program *prog,
>>> opts->prog_flags |= BPF_F_XDP_HAS_FRAGS;
>>> /* special check for usdt to use uprobe_multi link */
>>> - if ((def & SEC_USDT) && kernel_supports(prog->obj,
>>> FEAT_UPROBE_MULTI_LINK))
>>> + if ((def & SEC_USDT) && kernel_supports(prog->obj,
>>> FEAT_UPROBE_MULTI_LINK)) {
>>> + /* for BPF_TRACE_KPROBE_MULTI, user might want to query
>>> exected_attach_type
>>> + * in prog, and expected_attach_type we set in kenrel is
>>> from opts, so we
>>> + * update both.
>>> + */
>> s/K/U/ in BPF_TRACE_KPROBE_MULTI in above comment and 'kenrel' typo
>>
>> Acked-by: Jiri Olsa <jolsa@kernel.org>
> Same typo is also in commit desc, would be good to improve the commit
> desc a bit if you spin v4 anyway. Thanks!
Hi,Dnaiel,my bad,i will fix it in v4
--
Best Regards
Dylane Chen
prev parent reply other threads:[~2024-09-25 14:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-14 15:40 [PATCH bpf-next v3] libbpf: Fix expected_attach_type set when kernel not support Tao Chen
2024-09-19 2:05 ` Tao Chen
2024-09-19 4:20 ` Andrii Nakryiko
2024-09-19 13:45 ` Tao Chen
2024-09-25 10:28 ` Jiri Olsa
2024-09-25 10:36 ` Daniel Borkmann
2024-09-25 14:55 ` Tao Chen [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=680bbf09-6939-4056-bfc2-27138a93efe6@gmail.com \
--to=chen.dylane@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=olsajiri@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox