1 48151859SLluís Vilanova /* 2 48151859SLluís Vilanova * Interface for configuring and controlling the state of tracing events. 3 48151859SLluís Vilanova * 4 48151859SLluís Vilanova * Copyright (C) 2014-2016 Lluís Vilanova <vilanova@ac.upc.edu> 5 48151859SLluís Vilanova * 6 48151859SLluís Vilanova * This work is licensed under the terms of the GNU GPL, version 2 or later. 7 48151859SLluís Vilanova * See the COPYING file in the top-level directory. 8 48151859SLluís Vilanova */ 9 48151859SLluís Vilanova 10 48151859SLluís Vilanova #include "qemu/osdep.h" 11 48151859SLluís Vilanova #include "trace/control.h" 12 48151859SLluís Vilanova 13 48151859SLluís Vilanova 14 *a4d50b1dSLluís Vilanova void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state) 15 *a4d50b1dSLluís Vilanova { 16 *a4d50b1dSLluís Vilanova trace_event_set_state_dynamic(ev, state); 17 *a4d50b1dSLluís Vilanova } 18 *a4d50b1dSLluís Vilanova 19 48151859SLluís Vilanova void trace_event_set_state_dynamic(TraceEvent *ev, bool state) 20 48151859SLluís Vilanova { 21 48151859SLluís Vilanova TraceEventID id; 22 48151859SLluís Vilanova assert(trace_event_get_state_static(ev)); 23 48151859SLluís Vilanova id = trace_event_get_id(ev); 24 48151859SLluís Vilanova trace_events_enabled_count += state - trace_events_dstate[id]; 25 48151859SLluís Vilanova trace_events_dstate[id] = state; 26 48151859SLluís Vilanova } 27 48151859SLluís Vilanova 28 48151859SLluís Vilanova void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, 29 48151859SLluís Vilanova TraceEvent *ev, bool state) 30 48151859SLluís Vilanova { 31 48151859SLluís Vilanova /* should never be called on non-target binaries */ 32 48151859SLluís Vilanova abort(); 33 48151859SLluís Vilanova } 34