diff options
Diffstat (limited to 'drivers/s390/net/ctcm_dbug.c')
-rw-r--r-- | drivers/s390/net/ctcm_dbug.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/drivers/s390/net/ctcm_dbug.c b/drivers/s390/net/ctcm_dbug.c index 8eb25d00b2e7..1ca58f153470 100644 --- a/drivers/s390/net/ctcm_dbug.c +++ b/drivers/s390/net/ctcm_dbug.c | |||
@@ -7,6 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/stddef.h> | 9 | #include <linux/stddef.h> |
10 | #include <linux/string.h> | ||
10 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
11 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
12 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
@@ -22,15 +23,13 @@ | |||
22 | * Debug Facility Stuff | 23 | * Debug Facility Stuff |
23 | */ | 24 | */ |
24 | 25 | ||
25 | DEFINE_PER_CPU(char[256], ctcm_dbf_txt_buf); | ||
26 | |||
27 | struct ctcm_dbf_info ctcm_dbf[CTCM_DBF_INFOS] = { | 26 | struct ctcm_dbf_info ctcm_dbf[CTCM_DBF_INFOS] = { |
28 | [CTCM_DBF_SETUP] = {"ctc_setup", 8, 1, 64, 5, NULL}, | 27 | [CTCM_DBF_SETUP] = {"ctc_setup", 8, 1, 64, CTC_DBF_INFO, NULL}, |
29 | [CTCM_DBF_ERROR] = {"ctc_error", 8, 1, 64, 3, NULL}, | 28 | [CTCM_DBF_ERROR] = {"ctc_error", 8, 1, 64, CTC_DBF_ERROR, NULL}, |
30 | [CTCM_DBF_TRACE] = {"ctc_trace", 8, 1, 64, 3, NULL}, | 29 | [CTCM_DBF_TRACE] = {"ctc_trace", 8, 1, 64, CTC_DBF_ERROR, NULL}, |
31 | [CTCM_DBF_MPC_SETUP] = {"mpc_setup", 8, 1, 64, 5, NULL}, | 30 | [CTCM_DBF_MPC_SETUP] = {"mpc_setup", 8, 1, 80, CTC_DBF_INFO, NULL}, |
32 | [CTCM_DBF_MPC_ERROR] = {"mpc_error", 8, 1, 64, 3, NULL}, | 31 | [CTCM_DBF_MPC_ERROR] = {"mpc_error", 8, 1, 80, CTC_DBF_ERROR, NULL}, |
33 | [CTCM_DBF_MPC_TRACE] = {"mpc_trace", 8, 1, 64, 3, NULL}, | 32 | [CTCM_DBF_MPC_TRACE] = {"mpc_trace", 8, 1, 80, CTC_DBF_ERROR, NULL}, |
34 | }; | 33 | }; |
35 | 34 | ||
36 | void ctcm_unregister_dbf_views(void) | 35 | void ctcm_unregister_dbf_views(void) |
@@ -65,3 +64,17 @@ int ctcm_register_dbf_views(void) | |||
65 | return 0; | 64 | return 0; |
66 | } | 65 | } |
67 | 66 | ||
67 | void ctcm_dbf_longtext(enum ctcm_dbf_names dbf_nix, int level, char *fmt, ...) | ||
68 | { | ||
69 | char dbf_txt_buf[64]; | ||
70 | va_list args; | ||
71 | |||
72 | if (level > (ctcm_dbf[dbf_nix].id)->level) | ||
73 | return; | ||
74 | va_start(args, fmt); | ||
75 | vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args); | ||
76 | va_end(args); | ||
77 | |||
78 | debug_text_event(ctcm_dbf[dbf_nix].id, level, dbf_txt_buf); | ||
79 | } | ||
80 | |||