aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/qdio_debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio/qdio_debug.h')
-rw-r--r--drivers/s390/cio/qdio_debug.h112
1 files changed, 52 insertions, 60 deletions
diff --git a/drivers/s390/cio/qdio_debug.h b/drivers/s390/cio/qdio_debug.h
index 5a4d85b829ad..5d70bd162ae9 100644
--- a/drivers/s390/cio/qdio_debug.h
+++ b/drivers/s390/cio/qdio_debug.h
@@ -12,80 +12,72 @@
12#include <asm/qdio.h> 12#include <asm/qdio.h>
13#include "qdio.h" 13#include "qdio.h"
14 14
15#define QDIO_DBF_HEX(ex, name, level, addr, len) \ 15/* that gives us 15 characters in the text event views */
16#define QDIO_DBF_LEN 16
17
18extern debug_info_t *qdio_dbf_setup;
19extern debug_info_t *qdio_dbf_error;
20
21/* sort out low debug levels early to avoid wasted sprints */
22static inline int qdio_dbf_passes(debug_info_t *dbf_grp, int level)
23{
24 return (level <= dbf_grp->level);
25}
26
27#define DBF_ERR 3 /* error conditions */
28#define DBF_WARN 4 /* warning conditions */
29#define DBF_INFO 6 /* informational */
30
31#undef DBF_EVENT
32#undef DBF_ERROR
33#undef DBF_DEV_EVENT
34
35#define DBF_EVENT(text...) \
16 do { \ 36 do { \
17 if (ex) \ 37 char debug_buffer[QDIO_DBF_LEN]; \
18 debug_exception(qdio_dbf_##name, level, (void *)(addr), len); \ 38 snprintf(debug_buffer, QDIO_DBF_LEN, text); \
19 else \ 39 debug_text_event(qdio_dbf_setup, DBF_ERR, debug_buffer); \
20 debug_event(qdio_dbf_##name, level, (void *)(addr), len); \
21 } while (0) 40 } while (0)
22#define QDIO_DBF_TEXT(ex, name, level, text) \ 41
42#define DBF_HEX(addr, len) \
23 do { \ 43 do { \
24 if (ex) \ 44 debug_event(qdio_dbf_setup, DBF_ERR, (void*)(addr), len); \
25 debug_text_exception(qdio_dbf_##name, level, text); \
26 else \
27 debug_text_event(qdio_dbf_##name, level, text); \
28 } while (0) 45 } while (0)
29 46
30#define QDIO_DBF_HEX0(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 0, addr, len) 47#define DBF_ERROR(text...) \
31#define QDIO_DBF_HEX1(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 1, addr, len) 48 do { \
32#define QDIO_DBF_HEX2(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 2, addr, len) 49 char debug_buffer[QDIO_DBF_LEN]; \
33 50 snprintf(debug_buffer, QDIO_DBF_LEN, text); \
34#ifdef CONFIG_QDIO_DEBUG 51 debug_text_event(qdio_dbf_error, DBF_ERR, debug_buffer); \
35#define QDIO_DBF_HEX3(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 3, addr, len) 52 } while (0)
36#define QDIO_DBF_HEX4(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 4, addr, len)
37#define QDIO_DBF_HEX5(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 5, addr, len)
38#define QDIO_DBF_HEX6(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 6, addr, len)
39#else
40#define QDIO_DBF_HEX3(ex, name, addr, len) do {} while (0)
41#define QDIO_DBF_HEX4(ex, name, addr, len) do {} while (0)
42#define QDIO_DBF_HEX5(ex, name, addr, len) do {} while (0)
43#define QDIO_DBF_HEX6(ex, name, addr, len) do {} while (0)
44#endif /* CONFIG_QDIO_DEBUG */
45
46#define QDIO_DBF_TEXT0(ex, name, text) QDIO_DBF_TEXT(ex, name, 0, text)
47#define QDIO_DBF_TEXT1(ex, name, text) QDIO_DBF_TEXT(ex, name, 1, text)
48#define QDIO_DBF_TEXT2(ex, name, text) QDIO_DBF_TEXT(ex, name, 2, text)
49
50#ifdef CONFIG_QDIO_DEBUG
51#define QDIO_DBF_TEXT3(ex, name, text) QDIO_DBF_TEXT(ex, name, 3, text)
52#define QDIO_DBF_TEXT4(ex, name, text) QDIO_DBF_TEXT(ex, name, 4, text)
53#define QDIO_DBF_TEXT5(ex, name, text) QDIO_DBF_TEXT(ex, name, 5, text)
54#define QDIO_DBF_TEXT6(ex, name, text) QDIO_DBF_TEXT(ex, name, 6, text)
55#else
56#define QDIO_DBF_TEXT3(ex, name, text) do {} while (0)
57#define QDIO_DBF_TEXT4(ex, name, text) do {} while (0)
58#define QDIO_DBF_TEXT5(ex, name, text) do {} while (0)
59#define QDIO_DBF_TEXT6(ex, name, text) do {} while (0)
60#endif /* CONFIG_QDIO_DEBUG */
61 53
62/* s390dbf views */ 54#define DBF_ERROR_HEX(addr, len) \
63#define QDIO_DBF_SETUP_LEN 8 55 do { \
64#define QDIO_DBF_SETUP_PAGES 8 56 debug_event(qdio_dbf_error, DBF_ERR, (void*)(addr), len); \
65#define QDIO_DBF_SETUP_NR_AREAS 1 57 } while (0)
66 58
67#define QDIO_DBF_TRACE_LEN 8
68#define QDIO_DBF_TRACE_NR_AREAS 2
69 59
70#ifdef CONFIG_QDIO_DEBUG 60#define DBF_DEV_EVENT(level, device, text...) \
71#define QDIO_DBF_TRACE_PAGES 32 61 do { \
72#define QDIO_DBF_SETUP_LEVEL 6 62 char debug_buffer[QDIO_DBF_LEN]; \
73#define QDIO_DBF_TRACE_LEVEL 4 63 if (qdio_dbf_passes(device->debug_area, level)) { \
74#else /* !CONFIG_QDIO_DEBUG */ 64 snprintf(debug_buffer, QDIO_DBF_LEN, text); \
75#define QDIO_DBF_TRACE_PAGES 8 65 debug_text_event(device->debug_area, level, debug_buffer); \
76#define QDIO_DBF_SETUP_LEVEL 2 66 } \
77#define QDIO_DBF_TRACE_LEVEL 2 67 } while (0)
78#endif /* CONFIG_QDIO_DEBUG */
79 68
80extern debug_info_t *qdio_dbf_setup; 69#define DBF_DEV_HEX(level, device, addr, len) \
81extern debug_info_t *qdio_dbf_trace; 70 do { \
71 debug_event(device->debug_area, level, (void*)(addr), len); \
72 } while (0)
82 73
83void qdio_allocate_do_dbf(struct qdio_initialize *init_data); 74void qdio_allocate_dbf(struct qdio_initialize *init_data,
84void debug_print_bstat(struct qdio_q *q); 75 struct qdio_irq *irq_ptr);
85void qdio_setup_debug_entries(struct qdio_irq *irq_ptr, 76void qdio_setup_debug_entries(struct qdio_irq *irq_ptr,
86 struct ccw_device *cdev); 77 struct ccw_device *cdev);
87void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr, 78void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr,
88 struct ccw_device *cdev); 79 struct ccw_device *cdev);
89int qdio_debug_init(void); 80int qdio_debug_init(void);
90void qdio_debug_exit(void); 81void qdio_debug_exit(void);
82
91#endif 83#endif