base: make trace resumable

revert relocations so a paused subject can resume without changing its
policy.

issue #3294
This commit is contained in:
Sebastian Sumpf 2019-05-03 15:56:58 +02:00 committed by Christian Helmuth
parent 399487c85d
commit ac0ecdf855

View File

@ -60,6 +60,11 @@ bool Trace::Logger::_evaluate_control()
/* unload policy */
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);
policy_module = 0;
}
@ -82,7 +87,8 @@ bool Trace::Logger::_evaluate_control()
}
}
if (enabled && (policy_version != control->policy_version())) {
bool const new_policy = policy_version != control->policy_version();
if (enabled && (new_policy || policy_module == 0)) {
/* suppress tracing during policy change */
Control::Inhibit_guard guard(*control);