On 9/25/25 13:50, Stefan Hajnoczi wrote:
On Wed, Sep 24, 2025 at 09:58:04PM +0200, Paolo Bonzini wrote:
On Wed, Sep 24, 2025, 20:10 Stefan Hajnoczi <[email protected]> wrote:
fn trace_event_state_is_enabled(dstate: u16) -> bool {
unsafe { trace_events_enabled_count } != 0 && dstate != 0
}
The generated code is missing DTrace's SDT semaphore (see
generate_h_backend_dstate() in scripts/tracetool/backend/dtrace.py). The
conditional must be taken when a tool like SystemTap or GDB sets the SDT
semaphore. Right now it will not be taken because the conditional only
looks at _ ## id ## _DSTATE and not the SDT semaphore.
This is private code to trace-*.rs, for use within the tracepoint functions
only; it's not a public "is the tracepoint active" API. The public side in
C does look at the semaphore.
You're right, the code is fine just with the function renamed.
No problem---in fact I have now realized that, for systemtap, I have to
ensure that the semaphore is shared between C and Rust!
Paolo