On Thu, Oct 01, 2026 at 11:14:36PM +0400, [email protected] wrote: > > Conditional checks must call trace_event_get_state_dynamic() > > get_state_backends()?
Opps, yes. > > which checks the state of all backends, while trace_event_get_state() > > only validates state for backends using QEMU's internal state > > tracking. > > I don't understand, tbh, but the doc & tracing.rst agree so, We have a "uint16_t _TRACE....DSTATE" variable for each probe that tracks whether QEMU has marked it enabled or not. This is used to control the ftrace, syslog, log and simple trace backends, and what the -trace command line arg sets. This is what the trace_event_get_state() macro checks. For the systemtap and ust backends, however, that variable is not used, as they use USDT which are dynamically enabled by the external tracing application. They proide a semaphore which can be checked to see if the USDT has been enabled. The "TRACE...DSTATE()" macro (no leading underscore) expands to code that checks the systemtap/ust USDT semaphores *and* the QEMU "_TRACE...DSTATE" variable. This is what the correct trace_event_get_state_backends() macro checks, and thus what needs to be used to ensure things work with dtrace/ust backends, as well as the QEMU internal backends. > Reviewed-by: Marc-André Lureau <[email protected]> With regards, Daniel -- |: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
