qemu-cr16/tests/tracetool/log.h
Tanish Desai 494492c5c5 tracetool/backend: remove redundant trace event checks
Use CHECK_TRACE_EVENT_GET_STATE in log, syslog, dtrace and simple
backend, so that the "if (trace_event_get_state)" is created from common
code and unified when multiple backends are active.

When a single backend is active there is no code change (except
for the log backend, as shown in tests/tracetool/log.h), but the
code in the backends is simpler.

Signed-off-by: Tanish Desai <tanishdesai37@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20250929154938.594389-8-pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-10-01 11:22:07 -04:00

47 lines
1.4 KiB
C

/* This file is autogenerated by tracetool, do not edit. */
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef TRACE_TESTSUITE_GENERATED_TRACERS_H
#define TRACE_TESTSUITE_GENERATED_TRACERS_H
#include "trace/control.h"
extern TraceEvent _TRACE_TEST_BLAH_EVENT;
extern TraceEvent _TRACE_TEST_WIBBLE_EVENT;
extern uint16_t _TRACE_TEST_BLAH_DSTATE;
extern uint16_t _TRACE_TEST_WIBBLE_DSTATE;
#define TRACE_TEST_BLAH_ENABLED 1
#define TRACE_TEST_WIBBLE_ENABLED 1
#include "qemu/log-for-trace.h"
#define TRACE_TEST_BLAH_BACKEND_DSTATE() ( \
trace_event_get_state_dynamic_by_id(TRACE_TEST_BLAH) || \
false)
static inline void trace_test_blah(void *context, const char *filename)
{
if (trace_event_get_state(TRACE_TEST_BLAH)) {
if (qemu_loglevel_mask(LOG_TRACE)) {
#line 4 "trace-events"
qemu_log("test_blah " "Blah context=%p filename=%s" "\n", context, filename);
#line 29 "log.h"
}
}
}
#define TRACE_TEST_WIBBLE_BACKEND_DSTATE() ( \
trace_event_get_state_dynamic_by_id(TRACE_TEST_WIBBLE) || \
false)
static inline void trace_test_wibble(void *context, int value)
{
if (trace_event_get_state(TRACE_TEST_WIBBLE)) {
if (qemu_loglevel_mask(LOG_TRACE)) {
#line 5 "trace-events"
qemu_log("test_wibble " "Wibble context=%p value=%d" "\n", context, value);
#line 44 "log.h"
}
}
}
#endif /* TRACE_TESTSUITE_GENERATED_TRACERS_H */