master
rs 65 lines 1.86 KB
Raw
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 // This file is @generated by tracetool, do not edit.
3
4 #[allow(unused_imports)]
5 use std::ffi::c_char;
6 #[allow(unused_imports)]
7 use util::bindings;
8
9 #[allow(dead_code)]
10 #[inline(always)]
11 fn trace_event_state_is_enabled(dstate: u16) -> bool {
12 (unsafe { trace_events_enabled_count }) != 0 && dstate != 0
13 }
14
15 extern "C" {
16 #[allow(dead_code)]
17 static mut trace_events_enabled_count: u32;
18 }
19 extern "C" {
20 #[allow(dead_code)]
21 static mut _TRACE_TEST_BLAH_DSTATE: u16;
22 #[allow(dead_code)]
23 static mut _TRACE_TEST_WIBBLE_DSTATE: u16;
24 }
25
26 #[inline(always)]
27 #[allow(dead_code)]
28 pub fn trace_test_blah_enabled() -> bool
29 {
30 trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) ||
31 false
32 }
33
34 #[inline(always)]
35 #[allow(dead_code)]
36 pub fn trace_test_blah(_context: *mut (), _filename: &std::ffi::CStr)
37 {
38 if trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) {
39 let format_string = c"test_blah Blah context=%p filename=%s\n";
40 if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) != 0 {
41 unsafe { bindings::qemu_log(format_string.as_ptr() as *const c_char, _context /* as *mut () */, _filename.as_ptr());}
42 }
43 }
44 }
45
46 #[inline(always)]
47 #[allow(dead_code)]
48 pub fn trace_test_wibble_enabled() -> bool
49 {
50 trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) ||
51 false
52 }
53
54 #[inline(always)]
55 #[allow(dead_code)]
56 pub fn trace_test_wibble(_context: *mut (), _value: std::ffi::c_int)
57 {
58 if trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) {
59 let format_string = c"test_wibble Wibble context=%p value=%d\n";
60 if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) != 0 {
61 unsafe { bindings::qemu_log(format_string.as_ptr() as *const c_char, _context /* as *mut () */, _value /* as std::ffi::c_int */);}
62 }
63 }
64 }
65