mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-20 16:10:29 +00:00
base: distinct TRACED from ATTACHED trace subjects
This patch makes the trace-subject state as reflected to the trace monitor more accurate. Until now, a subject could be in UNTRACED or TRACED state. In reality, however, there exists an intermediate state after the trace monitor called 'trace' for the subject but before the subject locally activated the tracing (done when passing a trace point). This intermediate state was reflected as UNTRACED. Consequently, threads that never pass a trace point (e.g., just waiting for I/O) would remain to appear as UNTRACED even after enabling its tracing by the trace monitor. This is confusing. This patch replaces the former UNTRACED and TRACED states by three distinct states: UNATTACHED prior any call of 'trace' ATTACHED after a trace monitor called 'trace' but before the tracing is active TRACE tracing is active Fixes #4447
This commit is contained in:
committed by
Christian Helmuth
parent
f3984ba5a9
commit
be0a1742ac
@ -156,24 +156,29 @@ class Genode::Trace::Subject
|
||||
if (!source.valid())
|
||||
return Subject_info::DEAD;
|
||||
|
||||
if (source->enabled())
|
||||
return source->owned_by(*this) ? Subject_info::TRACED
|
||||
: Subject_info::FOREIGN;
|
||||
if (source->error())
|
||||
return Subject_info::ERROR;
|
||||
|
||||
return Subject_info::UNTRACED;
|
||||
if (source->enabled() && !source->owned_by(*this))
|
||||
return Subject_info::FOREIGN;
|
||||
|
||||
if (source->owned_by(*this))
|
||||
return source->enabled() ? Subject_info::TRACED
|
||||
: Subject_info::ATTACHED;
|
||||
|
||||
return Subject_info::UNATTACHED;
|
||||
}
|
||||
|
||||
void _traceable_or_throw()
|
||||
{
|
||||
switch(_state()) {
|
||||
case Subject_info::DEAD : throw Source_is_dead();
|
||||
case Subject_info::FOREIGN : throw Traced_by_other_session();
|
||||
case Subject_info::ERROR : throw Source_is_dead();
|
||||
case Subject_info::INVALID : throw Nonexistent_subject();
|
||||
case Subject_info::UNTRACED: return;
|
||||
case Subject_info::TRACED : return;
|
||||
case Subject_info::DEAD : throw Source_is_dead();
|
||||
case Subject_info::FOREIGN : throw Traced_by_other_session();
|
||||
case Subject_info::ERROR : throw Source_is_dead();
|
||||
case Subject_info::INVALID : throw Nonexistent_subject();
|
||||
case Subject_info::UNATTACHED : return;
|
||||
case Subject_info::ATTACHED : return;
|
||||
case Subject_info::TRACED : return;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user