xref: /haiku/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.h (revision 893988af824e65e49e55f517b157db8386e8002b)
1 /*
2  * Copyright (c) 2007-2008 by Michael Lotz
3  * Heavily based on the original usb_serial driver which is:
4  *
5  * Copyright (c) 2003 by Siarzhuk Zharski <imker@gmx.li>
6  * Distributed under the terms of the MIT License.
7  */
8 #ifndef _USB_SERIAL_TRACING_H_
9 #define _USB_SERIAL_TRACING_H_
10 
11 void load_settings();
12 void create_log_file();
13 void usb_serial_trace(bool force, char *format, ...);
14 
15 #define TRACE_ALWAYS(x...) usb_serial_trace(true, x);
16 #define TRACE(x...) usb_serial_trace(false, x);
17 
18 extern bool gLogFunctionCalls;
19 #define TRACE_FUNCALLS(x...) \
20 	if (gLogFunctionCalls) \
21 		usb_serial_trace(false, x);
22 
23 extern bool gLogFunctionReturns;
24 #define TRACE_FUNCRET(x...) \
25 	if (gLogFunctionReturns) \
26 		usb_serial_trace(false, x);
27 
28 extern bool gLogFunctionResults;
29 #define TRACE_FUNCRES(func, param) \
30 	if (gLogFunctionResults) \
31 		func(param);
32 
33 void trace_ddomain(struct ddomain *dd);
34 void trace_termios(struct termios *tios);
35 void trace_str(struct str *str);
36 void trace_winsize(struct winsize *ws);
37 void trace_tty(struct tty *tty);
38 
39 #endif //_USB_SERIAL_TRACING_H_
40