]>
Commit | Line | Data |
---|---|---|
48151859 LV |
1 | /* |
2 | * Interface for configuring and controlling the state of tracing events. | |
3 | * | |
4 | * Copyright (C) 2014-2016 Lluís Vilanova <vilanova@ac.upc.edu> | |
5 | * | |
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 | #include "qemu/osdep.h" | |
11 | #include "trace/control.h" | |
12 | ||
13 | ||
a4d50b1d LV |
14 | void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state) |
15 | { | |
16 | trace_event_set_state_dynamic(ev, state); | |
17 | } | |
18 | ||
48151859 LV |
19 | void trace_event_set_state_dynamic(TraceEvent *ev, bool state) |
20 | { | |
21 | TraceEventID id; | |
8eb1b9db | 22 | bool state_pre; |
48151859 LV |
23 | assert(trace_event_get_state_static(ev)); |
24 | id = trace_event_get_id(ev); | |
8eb1b9db LV |
25 | /* |
26 | * We ignore the "vcpu" property here, since there's no target code. Then | |
27 | * dstate can only be 1 or 0. | |
28 | */ | |
29 | state_pre = trace_events_dstate[id]; | |
30 | if (state_pre != state) { | |
31 | if (state) { | |
32 | trace_events_enabled_count++; | |
33 | trace_events_dstate[id] = 1; | |
34 | } else { | |
35 | trace_events_enabled_count--; | |
36 | trace_events_dstate[id] = 0; | |
37 | } | |
38 | } | |
48151859 LV |
39 | } |
40 | ||
41 | void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, | |
42 | TraceEvent *ev, bool state) | |
43 | { | |
44 | /* should never be called on non-target binaries */ | |
45 | abort(); | |
46 | } | |
2bfe11c8 LV |
47 | |
48 | void trace_init_vcpu(CPUState *vcpu) | |
49 | { | |
50 | /* should never be called on non-target binaries */ | |
51 | abort(); | |
52 | } |