Re: Question about 'for_each_kernel_tracepoint(...)' function

From: Steven Rostedt
Date: Thu Oct 20 2022 - 11:14:48 EST


On Thu, 20 Oct 2022 17:32:57 +0800
richard clark <richard.xnu.clark@xxxxxxxxx> wrote:

> Hi,
> Can this function only find the trace points defined in the kernel

It should find all tracepoints.

> image? I want to define a trace event in my kernel module A, then B
> module to register a probe callback function for that event TP in A. I
> want to kick off a timer in A and call the traced function
> periodically, thus I can monitor the events happening in A from B.

You could also export the tracepoint from A and reference it directly in B.

>
> Can I do that, is it possible?
>

Try it and find out. Why ask?

-- Steve