Thread (15 messages) 15 messages, 4 authors, 2025-01-24

Re: [PATCH RFC net-next] trace: tcp: Add tracepoint for tcp_cwnd_reduction()

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2025-01-22 14:56:01
Also in: lkml, netdev

On Wed, 22 Jan 2025 01:39:42 -0800
Breno Leitao [off-list ref] 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 (local)
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.
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help