The TraceEvent struct contains a "bool sstate" field which track whether a trace event was disabled statically. i.e. at build time via the "disable" property annotation in trace-events. The only runtime use of this field is to let "trace-event-get-state" report that an event is "unavailable" instead of reporting an error for an unknown trace event. Trace events are not ABI so their names can change and the event can come and go at any time. Thus there is little utility in reporting the existence of a disabled event that cannot ever be used at runtime. Removing the "bool sstate" field from TraceEvent saves 8 bytes of space in the struct, adding up to approx 64 KB across all current events. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20261102142844.3464712-24-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
26 lines
661 B
C
26 lines
661 B
C
/*
|
|
* Interface for configuring and controlling the state of tracing events.
|
|
*
|
|
* Copyright (C) 2014-2017 Lluís Vilanova <vilanova@ac.upc.edu>
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*/
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "trace/control.h"
|
|
|
|
void trace_event_set_state_dynamic(TraceEvent *ev, bool state)
|
|
{
|
|
bool state_pre = *ev->dstate;
|
|
if (state_pre != state) {
|
|
if (state) {
|
|
trace_events_enabled_count++;
|
|
*ev->dstate = 1;
|
|
} else {
|
|
trace_events_enabled_count--;
|
|
*ev->dstate = 0;
|
|
}
|
|
}
|
|
}
|