Re: [PATCH v4] [RFC] trace: Add kprobe on tracepoint

From: Masami Hiramatsu
Date: Thu Aug 12 2021 - 07:31:16 EST

On Thu, 12 Aug 2021 10:27:35 +0900
Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:

> > Currently, we don't see any real use case to allow synthetic events to
> > attach to an eprobe, but if there is, we can change the code to allow
> > it, but we need to keep track of how many are attached, and limit them,
> > and we need to find a way to check for loops.
> Yes, anyway we need a way to find loops on histogram/eprobe at last.

BTW, what about using similar machanism of "current_kprobe()" to detect
the reccursion? As an easy way, prepare a static per-cpu pointer which sets
the current eprobe and if the eprobe handler detects that is already set,
it may warn (or silently ignore) and reject it.
(Of course it is better to detect the loop when user sets the hist-trigger
by reverse link)

Thank you,

Masami Hiramatsu <mhiramat@xxxxxxxxxx>