blob: f63500b37e6e4fefda4e97eac811f935ae40e3fb [file] [log] [blame]
Lluís Vilanova45be2f52013-03-05 14:47:32 +01001/*
2 * Interface for configuring and controlling the state of tracing events.
3 *
Lluís Vilanova17f7ac72016-07-11 12:53:24 +02004 * Copyright (C) 2012-2016 Lluís Vilanova <vilanova@ac.upc.edu>
Lluís Vilanova45be2f52013-03-05 14:47:32 +01005 *
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.
8 */
9
10#ifndef TRACE__EVENT_INTERNAL_H
11#define TRACE__EVENT_INTERNAL_H
12
Daniel P. Berrangeef4c9fc2016-10-04 14:35:49 +010013/*
14 * Special value for TraceEvent.vcpu_id field to indicate
15 * that the event is not VCPU specific
16 */
17#define TRACE_VCPU_EVENT_NONE ((uint32_t)-1)
18
Lluís Vilanova45be2f52013-03-05 14:47:32 +010019/**
20 * TraceEvent:
21 * @id: Unique event identifier.
Lluís Vilanova17f7ac72016-07-11 12:53:24 +020022 * @vcpu_id: Unique per-vCPU event identifier.
Lluís Vilanova45be2f52013-03-05 14:47:32 +010023 * @name: Event name.
24 * @sstate: Static tracing state.
Daniel P. Berrange93977402016-10-04 14:35:45 +010025 * @dstate: Dynamic tracing state
26 *
27 * Interpretation of @dstate depends on whether the event has the 'vcpu'
28 * property:
29 * - false: Boolean value indicating whether the event is active.
30 * - true : Integral counting the number of vCPUs that have this event enabled.
Lluís Vilanova45be2f52013-03-05 14:47:32 +010031 *
32 * Opaque generic description of a tracing event.
33 */
34typedef struct TraceEvent {
Daniel P. Berrangea82417b2016-10-04 14:35:47 +010035 uint32_t id;
36 uint32_t vcpu_id;
Lluís Vilanova45be2f52013-03-05 14:47:32 +010037 const char * name;
38 const bool sstate;
Daniel P. Berrange93977402016-10-04 14:35:45 +010039 uint16_t *dstate;
Lluís Vilanova45be2f52013-03-05 14:47:32 +010040} TraceEvent;
41
Lluís Vilanovaa4d50b12016-08-23 10:58:52 +020042void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state);
Lluís Vilanova45be2f52013-03-05 14:47:32 +010043
Markus Armbruster175de522016-06-29 15:29:06 +020044#endif /* TRACE__EVENT_INTERNAL_H */