utrace_set_events — choose which event reports a tracing engine gets
int utrace_set_events ( | struct task_struct * target, |
struct utrace_attached_engine * engine, | |
unsigned long events) ; |
This changes the set of events for which engine
wants callbacks made.
This fails with -EALREADY
and does nothing if you try to clear
UTRACE_EVENT
(DEATH
) when the report_death
callback may already have
begun, if you try to clear UTRACE_EVENT
(REAP
) when the report_reap
callback may already have begun, or if you try to newly set
UTRACE_EVENT
(DEATH
) or UTRACE_EVENT
(QUIESCE
) when target
is
already dead or dying.
This can fail with -ESRCH
when target
has already been detached,
including forcible detach on reaping.
If target
was stopped before the call, then after a successful call,
no event callbacks not requested in events
will be made; if
UTRACE_EVENT
(QUIESCE
) is included in events
, then a report_quiesce
callback will be made when target
resumes. If target
was not stopped,
and was about to make a callback to engine
, this returns -EINPROGRESS
.
In this case, the callback in progress might be one excluded from the
new events
setting. When this returns zero, you can be sure that no
event callbacks you've disabled in events
can be made.
To synchronize after an -EINPROGRESS
return, see utrace_barrier
.
When target
is current
, -EINPROGRESS
is not returned. But
note that a newly-created engine will not receive any callbacks
related to an event notification already in progress. This call
enables events
callbacks to be made as soon as engine
becomes
eligible for any callbacks, see utrace_attach_task
.
These rules provide for coherent synchronization based on UTRACE_STOP
,
even when SIGKILL
is breaking its normal simple rules.