Re: [PATCH] RFC: Add signal command to trace events

From: Oleg Nesterov
Date: Thu Jun 26 2014 - 12:31:32 EST


On 06/26, Steven Rostedt wrote:
>
> [ Added Oleg who is the guru of signals ;-) ]

Thanks,

I didn't see the patch, so I can only guess what it does,

> On Thu, 26 Jun 2014 09:57:21 -0400
> Christopher Covington <cov@xxxxxxxxxxxxxx> wrote:
>
> > This stops a process after an event has been triggered a given
> > number of times. For example:
> >
> > [[ -d /sys/kernel/debug/tracing ]] || \
> > mount -t debugfs none /sys/kernel/debug
> > echo "p:myevent $(which myapp):0x700" > /sys/kernel/debug/tracing/uprobe_events
> > echo 1 > /sys/kernel/debug/tracing/events/uprobes/myevent/enable
> > echo 'signal:3' > /sys/kernel/debug/tracing/events/uprobes/myevent/trigger
> > myapp
> > myapp
> > myapp &
> >
> > Here, the 0x700 offset is the entry to main(). On the third
> > invocation of the program, the process is stopped.
> >
>
> Interesting trigger. I can see this being useful.

Yes. I thought about this too.

> > +//ifdef CONFIG_TRACER_SIGNAL
> > +static void
> > +signal_trigger(struct event_trigger_data *data)
> > +{
> > + force_sig(SIGSTOP, current);

Well, I don't like this. Imho, it would be nice to avoid signals here.

And SIGSTOP in particular. It can interfere with the "real" SIGSTOP
sent by user, with ptrace, with tty.

I think we need something else... "STOP" is actually simple, but we need
some interface which allows to wakeup a task sleeping in TASK_KILLABLE
after it hits ETT_FREEZE.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/