17aa661d4SMichael Lotz /* 27aa661d4SMichael Lotz * Copyright (c) 2007-2008 by Michael Lotz 37aa661d4SMichael Lotz * Heavily based on the original usb_serial driver which is: 47aa661d4SMichael Lotz * 57aa661d4SMichael Lotz * Copyright (c) 2003 by Siarzhuk Zharski <imker@gmx.li> 67aa661d4SMichael Lotz * Distributed under the terms of the MIT License. 77aa661d4SMichael Lotz */ 87aa661d4SMichael Lotz #ifndef _USB_SERIAL_TRACING_H_ 97aa661d4SMichael Lotz #define _USB_SERIAL_TRACING_H_ 107aa661d4SMichael Lotz 117aa661d4SMichael Lotz void load_settings(); 127aa661d4SMichael Lotz void create_log_file(); 13*b77aa015SFrançois Revol void usb_serial_trace(bool force, const char *format, ...); 147aa661d4SMichael Lotz 157aa661d4SMichael Lotz #define TRACE_ALWAYS(x...) usb_serial_trace(true, x); 167aa661d4SMichael Lotz #define TRACE(x...) usb_serial_trace(false, x); 177aa661d4SMichael Lotz 187aa661d4SMichael Lotz extern bool gLogFunctionCalls; 197aa661d4SMichael Lotz #define TRACE_FUNCALLS(x...) \ 207aa661d4SMichael Lotz if (gLogFunctionCalls) \ 217aa661d4SMichael Lotz usb_serial_trace(false, x); 227aa661d4SMichael Lotz 237aa661d4SMichael Lotz extern bool gLogFunctionReturns; 247aa661d4SMichael Lotz #define TRACE_FUNCRET(x...) \ 257aa661d4SMichael Lotz if (gLogFunctionReturns) \ 267aa661d4SMichael Lotz usb_serial_trace(false, x); 277aa661d4SMichael Lotz 287aa661d4SMichael Lotz extern bool gLogFunctionResults; 297aa661d4SMichael Lotz #define TRACE_FUNCRES(func, param) \ 307aa661d4SMichael Lotz if (gLogFunctionResults) \ 317aa661d4SMichael Lotz func(param); 327aa661d4SMichael Lotz 337aa661d4SMichael Lotz void trace_termios(struct termios *tios); 347aa661d4SMichael Lotz 357aa661d4SMichael Lotz #endif //_USB_SERIAL_TRACING_H_ 36