xref: /openbmc/qemu/tests/tracetool/syslog.rs (revision 1abdde1ad42d0ebccc5e8bc574ebe805cd650102)
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 #[inline(always)]
10 fn trace_event_state_is_enabled(dstate: u16) -> bool {
11     (unsafe { trace_events_enabled_count }) != 0 && dstate != 0
12 }
13 
14 extern "C" {
15     static mut trace_events_enabled_count: u32;
16 }
17 extern "C" {
18     static mut _TRACE_TEST_BLAH_DSTATE: u16;
19     static mut _TRACE_TEST_WIBBLE_DSTATE: u16;
20 }
21 
22 #[inline(always)]
23 #[allow(dead_code)]
24 pub fn trace_test_blah(_context: *mut (), _filename: &std::ffi::CStr)
25 {
26     if trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) {
27         let format_string = c"Blah context=%p filename=%s";
28         unsafe {::trace::syslog(::trace::LOG_INFO, format_string.as_ptr() as *const c_char, _context /* as *mut () */, _filename.as_ptr());}
29     }
30 }
31 
32 #[inline(always)]
33 #[allow(dead_code)]
34 pub fn trace_test_wibble(_context: *mut (), _value: std::ffi::c_int)
35 {
36     if trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) {
37         let format_string = c"Wibble context=%p value=%d";
38         unsafe {::trace::syslog(::trace::LOG_INFO, format_string.as_ptr() as *const c_char, _context /* as *mut () */, _value /* as std::ffi::c_int */);}
39     }
40 }
41