Name

utrace_set_events — choose which event reports a tracing engine gets

Synopsis

int utrace_set_events (struct task_struct * target,
 struct utrace_engine * engine,
 unsigned long events);
 

Arguments

target

thread to affect

engine

attached engine to affect

events

new event mask

Description

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 events excludes some bits that were set before, this can return -EINPROGRESS to indicate that target may have been making some callback to engine. When this returns zero, you can be sure that no event callbacks you've disabled in events can be made. If events only sets new bits that were not set before on engine, then -EINPROGRESS will never be returned.

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.