control.c (30e7d092b26146eb2abb77e0a0952aea012e36bf) control.c (2bfe11c8fac96db4f94abbe818fbc964a6744130)
1/*
2 * Interface for configuring and controlling the state of tracing events.
3 *
4 * Copyright (C) 2011-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 */

--- 255 unchanged lines hidden (view full) ---

264 trace_enable_events(qemu_opt_get(opts, "enable"));
265 }
266 trace_init_events(qemu_opt_get(opts, "events"));
267 trace_file = g_strdup(qemu_opt_get(opts, "file"));
268 qemu_opts_del(opts);
269
270 return trace_file;
271}
1/*
2 * Interface for configuring and controlling the state of tracing events.
3 *
4 * Copyright (C) 2011-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 */

--- 255 unchanged lines hidden (view full) ---

264 trace_enable_events(qemu_opt_get(opts, "enable"));
265 }
266 trace_init_events(qemu_opt_get(opts, "events"));
267 trace_file = g_strdup(qemu_opt_get(opts, "file"));
268 qemu_opts_del(opts);
269
270 return trace_file;
271}
272
273void trace_init_vcpu_events(void)
274{
275 TraceEvent *ev = NULL;
276 while ((ev = trace_event_pattern("*", ev)) != NULL) {
277 if (trace_event_is_vcpu(ev) &&
278 trace_event_get_state_static(ev) &&
279 trace_event_get_state_dynamic(ev)) {
280 TraceEventID id = trace_event_get_id(ev);
281 /* check preconditions */
282 assert(trace_events_dstate[id] == 1);
283 /* disable early-init state ... */
284 trace_events_dstate[id] = 0;
285 trace_events_enabled_count--;
286 /* ... and properly re-enable */
287 trace_event_set_state_dynamic(ev, true);
288 }
289 }
290}