mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-21 00:23:16 +00:00
trace: disable tracing when owner disappears
* Disable trace source and release ownership on subject destruction. * Note, since the policy module is also destroyed on descruction of the session component, the traced component must not access the policy module when acknowledging the disabled state (else: page fault). Fixes genodelabs/genode#4247
This commit is contained in:
committed by
Christian Helmuth
parent
81d939f947
commit
5e284bfb35
@ -189,6 +189,19 @@ class Genode::Trace::Subject
|
|||||||
_label(label), _name(name)
|
_label(label), _name(name)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destructor, releases ownership of associated source
|
||||||
|
*/
|
||||||
|
~Subject()
|
||||||
|
{
|
||||||
|
Locked_ptr<Source> source(_source);
|
||||||
|
|
||||||
|
if (source.valid()) {
|
||||||
|
source->disable();
|
||||||
|
source->release_ownership(*this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return registry-local ID
|
* Return registry-local ID
|
||||||
*/
|
*/
|
||||||
|
@ -60,11 +60,6 @@ bool Trace::Logger::_evaluate_control()
|
|||||||
|
|
||||||
/* unload policy */
|
/* unload policy */
|
||||||
if (policy_module) {
|
if (policy_module) {
|
||||||
|
|
||||||
/* revoke relocations */
|
|
||||||
for (unsigned i = 0; i < sizeof(Trace::Policy_module)/sizeof(void *); i++) {
|
|
||||||
((addr_t *)policy_module)[i] -= (addr_t)(policy_module);
|
|
||||||
}
|
|
||||||
_env().rm().detach(policy_module);
|
_env().rm().detach(policy_module);
|
||||||
policy_module = 0;
|
policy_module = 0;
|
||||||
}
|
}
|
||||||
@ -81,7 +76,6 @@ bool Trace::Logger::_evaluate_control()
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (control->to_be_enabled()) {
|
else if (control->to_be_enabled()) {
|
||||||
|
|
||||||
control->acknowledge_enabled();
|
control->acknowledge_enabled();
|
||||||
enabled = true;
|
enabled = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user