2 * Interface for configuring and controlling the state of tracing events.
4 * Copyright (C) 2011-2016 LluĂs Vilanova <vilanova@ac.upc.edu>
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
10 #ifndef TRACE__CONTROL_VCPU_H
11 #define TRACE__CONTROL_VCPU_H
14 #include "event-internal.h"
15 #include "hw/core/cpu.h"
18 * trace_event_get_vcpu_state:
20 * @id: Event identifier name.
22 * Get the tracing state of an event (both static and dynamic) for the given
25 * If the event has the disabled property, the check will have no performance
28 #define trace_event_get_vcpu_state(vcpu, id) \
30 trace_event_get_vcpu_state_dynamic_by_vcpu_id( \
31 vcpu, _ ## id ## _EVENT.vcpu_id))
34 * trace_event_get_vcpu_state_dynamic:
36 * Get the dynamic tracing state of an event for the given vCPU.
38 static bool trace_event_get_vcpu_state_dynamic(CPUState
*vcpu
, TraceEvent
*ev
);
40 #include "control-internal.h"
43 trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState
*vcpu
,
46 /* it's on fast path, avoid consistency checks (asserts) */
47 if (unlikely(trace_events_enabled_count
)) {
48 return test_bit(vcpu_id
, vcpu
->trace_dstate
);
54 static inline bool trace_event_get_vcpu_state_dynamic(CPUState
*vcpu
,
58 assert(trace_event_is_vcpu(ev
));
59 vcpu_id
= trace_event_get_vcpu_id(ev
);
60 return trace_event_get_vcpu_state_dynamic_by_vcpu_id(vcpu
, vcpu_id
);