> 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 <[email protected]>
> Signed-off-by: Daniel P. Berrangé <[email protected]>
> Message-ID: <[email protected]>
> ---
> qapi/trace.json | 5 ++--
> scripts/tracetool/format/c.py | 2 --
> scripts/tracetool/format/h.py | 8 ------
> stubs/trace-control.c | 1 -
> tests/tracetool/all.c | 2 --
> tests/tracetool/all.h | 14 +++++------
> tests/tracetool/dtrace.c | 2 --
> tests/tracetool/dtrace.h | 2 --
> tests/tracetool/ftrace.c | 2 --
> tests/tracetool/ftrace.h | 6 ++---
> tests/tracetool/log.c | 2 --
> tests/tracetool/log.h | 6 ++---
> tests/tracetool/nop.h | 2 --
> tests/tracetool/simple.c | 2 --
> tests/tracetool/simple.h | 2 --
> tests/tracetool/syslog.c | 2 --
> tests/tracetool/syslog.h | 6 ++---
> tests/tracetool/ust.c | 2 --
> tests/tracetool/ust.h | 2 --
> trace/control-internal.h | 6 -----
> trace/control-target.c | 2 --
> trace/control.c | 9 -------
> trace/control.h | 27 +++-----------------
> trace/event-internal.h | 2 --
> trace/qmp.c | 47 ++++++++++-------------------------
> 25 files changed, 31 insertions(+), 132 deletions(-)
>
> diff --git a/qapi/trace.json b/qapi/trace.json
> index 29c76256055c..8533e3789774 100644
> --- a/qapi/trace.json
> +++ b/qapi/trace.json
> @@ -16,8 +16,6 @@
> # @TraceEventState:
> # State of a tracing event.
> #
> -# @unavailable: The event is statically disabled.
> -#
> # @disabled: The event is dynamically disabled.
> #
> # @enabled: The event is dynamically enabled.
> @@ -25,7 +23,7 @@
> # Since: 2.2
> ##
> { 'enum': 'TraceEventState',
> - 'data': ['unavailable', 'disabled', 'enabled'] }
> + 'data': ['disabled', 'enabled'] }
We may want to keep the field with 'features': ['deprecated'] for a while
to avoid downstream schema users breakage.
>
> ##
> # @TraceEventInfo:
> @@ -69,6 +67,7 @@
> # @enable: Whether to enable tracing.
> #
> # @ignore-unavailable: Do not match unavailable events with @name.
> +# Deprecated: since 11.2
Similarly,
'*ignore-unavailable': { 'type': 'bool', 'features': [ 'deprecated' ] }
and add the deprecation to docs/about/deprecated.rst.
--
Marc-André Lureau <[email protected]>