blob: e64e8278c42e9979af1d35fb57c685be02327731 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef CIO_DEBUG_H
2#define CIO_DEBUG_H
3
4#include <asm/debug.h>
5
Peter Oberparleiter06fbcb12006-04-10 22:53:46 -07006/* for use of debug feature */
7extern debug_info_t *cio_debug_msg_id;
8extern debug_info_t *cio_debug_trace_id;
9extern debug_info_t *cio_debug_crw_id;
10
Cornelia Huckbc698bc2008-01-26 14:10:42 +010011#define CIO_TRACE_EVENT(imp, txt) do { \
Linus Torvalds1da177e2005-04-16 15:20:36 -070012 debug_text_event(cio_debug_trace_id, imp, txt); \
13 } while (0)
14
Cornelia Huckbc698bc2008-01-26 14:10:42 +010015#define CIO_MSG_EVENT(imp, args...) do { \
16 debug_sprintf_event(cio_debug_msg_id, imp , ##args); \
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 } while (0)
18
Cornelia Huckbc698bc2008-01-26 14:10:42 +010019#define CIO_CRW_EVENT(imp, args...) do { \
20 debug_sprintf_event(cio_debug_crw_id, imp , ##args); \
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 } while (0)
22
Cornelia Huckbc698bc2008-01-26 14:10:42 +010023static inline void CIO_HEX_EVENT(int level, void *data, int length)
Peter Oberparleiter06fbcb12006-04-10 22:53:46 -070024{
Cornelia Huck303fa9e2007-07-27 12:29:20 +020025 if (unlikely(!cio_debug_trace_id))
26 return;
Peter Oberparleiter06fbcb12006-04-10 22:53:46 -070027 while (length > 0) {
28 debug_event(cio_debug_trace_id, level, data, length);
29 length -= cio_debug_trace_id->buf_size;
30 data += cio_debug_trace_id->buf_size;
31 }
32}
Linus Torvalds1da177e2005-04-16 15:20:36 -070033
Linus Torvalds1da177e2005-04-16 15:20:36 -070034#endif