From: Steven Rostedt <rostedt@goodmis.org>
To: Breno Leitao <leitao@debian.org>
Cc: Jason Xing <kerneljasonxing@gmail.com>,
Eric Dumazet <edumazet@google.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
"David S. Miller" <davem@davemloft.net>,
David Ahern <dsahern@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-trace-kernel@vger.kernel.org, kernel-team@meta.com,
Yonghong Song <yonghong.song@linux.dev>,
Song Liu <song@kernel.org>,
Martin KaFai Lau <martin.lau@kernel.org>
Subject: Re: [PATCH RFC net-next] trace: tcp: Add tracepoint for tcp_cwnd_reduction()
Date: Wed, 22 Jan 2025 09:56:04 -0500 [thread overview]
Message-ID: <20250122095604.3c93bc93@gandalf.local.home> (raw)
In-Reply-To: <20250122-vengeful-myna-of-tranquility-f0f8cf@leitao>
On Wed, 22 Jan 2025 01:39:42 -0800
Breno Leitao <leitao@debian.org> wrote:
> Right, DECLARE_TRACE would solve my current problem, but, a056a5bed7fa
> ("sched/debug: Export the newly added tracepoints") says "BPF doesn't
> have infrastructure to access these bare tracepoints either.".
>
> Does BPF know how to attach to this bare tracepointers now?
>
> On the other side, it seems real tracepoints is getting more pervasive?
> So, this current approach might be OK also?
>
> https://lore.kernel.org/bpf/20250118033723.GV1977892@ZenIV/T/#m4c2fb2d904e839b34800daf8578dff0b9abd69a0
Thanks for the pointer. I didn't know this discussion was going on. I just
asked to attend if this gets accepted. I'm only a 6 hour drive from
Montreal anyway.
>
> > You can see its use in include/trace/events/sched.h
>
> I suppose I need to export the tracepointer with
> EXPORT_TRACEPOINT_SYMBOL_GPL(), right?
For modules to use them directly, yes. But there's other ways too.
>
> I am trying to hack something as the following, but, I struggled to hook
> BPF into it.
Maybe you can use the iterator to search for the tracepoint.
#include <linux/tracepoint.h>
static void fct(struct tracepoint *tp, void *priv)
{
if (!tp->name || strcmp(tp->name, "<tracepoint_name>") != 0)
return 0;
// attach to tracepoint tp
}
[..]
for_each_kernel_tracepoint(fct, NULL);
This is how LTTng hooks to tracepoints.
-- Steve
next prev parent reply other threads:[~2025-01-22 14:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-20 12:02 [PATCH RFC net-next] trace: tcp: Add tracepoint for tcp_cwnd_reduction() Breno Leitao
2025-01-20 12:08 ` Jason Xing
2025-01-20 13:02 ` Breno Leitao
2025-01-20 13:06 ` Jason Xing
2025-01-20 13:20 ` Breno Leitao
2025-01-20 15:03 ` Steven Rostedt
2025-01-22 9:39 ` Breno Leitao
2025-01-22 14:56 ` Steven Rostedt [this message]
2025-01-22 19:02 ` Yonghong Song
2025-01-24 4:40 ` Yonghong Song
2025-01-24 15:50 ` Steven Rostedt
2025-01-24 17:35 ` Yonghong Song
2025-01-22 18:40 ` Yonghong Song
2025-01-21 1:15 ` Jason Xing
2025-01-21 1:22 ` Jason Xing
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=20250122095604.3c93bc93@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kernel-team@meta.com \
--cc=kerneljasonxing@gmail.com \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--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.