master
c 61 lines 1.75 KB
Raw
1 /* This file is autogenerated by tracetool, do not edit. */
2 /* SPDX-License-Identifier: GPL-2.0-or-later */
3
4 #include "qemu/osdep.h"
5 #include "qemu/module.h"
6 #include "trace-testsuite.h"
7
8 uint16_t _TRACE_TEST_BLAH_DSTATE;
9 uint16_t _TRACE_TEST_WIBBLE_DSTATE;
10 TraceEvent _TRACE_TEST_BLAH_EVENT = {
11 .id = 0,
12 .name = "test_blah",
13 .sstate = TRACE_TEST_BLAH_ENABLED,
14 .dstate = &_TRACE_TEST_BLAH_DSTATE
15 };
16 TraceEvent _TRACE_TEST_WIBBLE_EVENT = {
17 .id = 0,
18 .name = "test_wibble",
19 .sstate = TRACE_TEST_WIBBLE_ENABLED,
20 .dstate = &_TRACE_TEST_WIBBLE_DSTATE
21 };
22 TraceEvent *testsuite_trace_events[] = {
23 &_TRACE_TEST_BLAH_EVENT,
24 &_TRACE_TEST_WIBBLE_EVENT,
25 NULL,
26 };
27
28 static void trace_testsuite_register_events(void)
29 {
30 trace_event_register_group(testsuite_trace_events);
31 }
32 trace_init(trace_testsuite_register_events)
33 #include "qemu/osdep.h"
34 #include "trace/control.h"
35 #include "trace/simple.h"
36
37 void _simple_trace_test_blah(void *context, const char *filename)
38 {
39 TraceBufferRecord rec;
40 size_t argfilename_len = filename ? MIN(strlen(filename), MAX_TRACE_STRLEN) : 0;
41
42 if (trace_record_start(&rec, _TRACE_TEST_BLAH_EVENT.id, 8 + 4 + argfilename_len)) {
43 return; /* Trace Buffer Full, Event Dropped ! */
44 }
45 trace_record_write_u64(&rec, (uintptr_t)(uint64_t *)context);
46 trace_record_write_str(&rec, filename, argfilename_len);
47 trace_record_finish(&rec);
48 }
49
50 void _simple_trace_test_wibble(void *context, int value)
51 {
52 TraceBufferRecord rec;
53
54 if (trace_record_start(&rec, _TRACE_TEST_WIBBLE_EVENT.id, 8 + 8)) {
55 return; /* Trace Buffer Full, Event Dropped ! */
56 }
57 trace_record_write_u64(&rec, (uintptr_t)(uint64_t *)context);
58 trace_record_write_u64(&rec, (uint64_t)value);
59 trace_record_finish(&rec);
60 }
61