[PATCH 0/3] UTRACE_DETACH fixes
Oleg Nesterov
oleg at redhat.com
Mon Sep 6 16:10:57 UTC 2010
On 09/03, Roland McGrath wrote:
>
> > > So, it is technically kosher enough to use UTRACE_INTERRUPT without
> > > UTRACE_EVENT(QUIESCE) set, if you really know the situation and are sure
> > > about all those caveats above.
> >
> > How? see below.
>
> I mentioned the examples.
I misunderstood the "UTRACE_INTERRUPT without UTRACE_EVENT(QUIESCE)" above
as if you mean it is possible to get UTRACE_SIGNAL_REPORT without QUIESCE.
> > > But, it's only UTRACE_EVENT(QUIESCE) that
> > > gives you any expectation of an "extra" callback for "no event" from either
> > > UTRACE_REPORT or UTRACE_INTERRUPT.
> >
> > Yes, this is clear too.
>
> Apparently not. ;-)
Perhaps ;) At least I certainly missed your point.
> QUIESCE is the only event type for "no event". If you only asked for
> signal events, then you only get a callback when there is an actual signal
> event. If you want an extra callback before dequeuing any signal, then
> that is what QUIESCE is for.
OK. This means ugdb should set QUIESCE, just to ensure its ->report_signal()
will be called.
> > Once again, I am not asking to change utrace now, but could you explain
> > what is wrong with the patch below?
>
> That gives an extra unrequested report_signal callback to every engine that
> is only interested in some signal event. Consider a "crash-catcher"
> engine. It would only track UTRACE_EVENT(SIGNAL_CORE) (and perhaps CLONE
> for its bookkeeping). This engine never asked for a callback before each
> and every attempt to dequeue any signal,
I see your point (I hope).
> which is what you would give it
> with your change.
No ;) My change was wrong. event == 0 in this case, and then later
utrace_get_signal() checks
if ((want & (event | UTRACE_EVENT(QUIESCE))) == 0)
continue;
OK, please forget. I must admit, this still looks a bit, well, unnatural
to me. May be it makes sense to add
_UTRACE_EVENT_SIGNAL_REPORT,
_UTRACE_EVENT_SIGNAL_HANDLER,
into utrace_events. Then ugdb could ask for UTRACE_SIGNAL_REPORT and
avoid the unnecessary ->report_quiesce() calls.
But at least I can see the logic now, thanks.
Roland, could you also comment this patch?
https://www.redhat.com/archives/utrace-devel/2010-August/msg00108.html
Again, this looks like a bug to me, but I won't insist if it is not.
Oleg.
More information about the utrace-devel
mailing list