From aa18a4bcb5a61ba854360fe0f94402845cb57363 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Sat, 2 Jul 2016 01:40:48 +0000 Subject: [PATCH] Logginf cleanup 1. Make PR logging available in the release mode 2. Make /sys/kernel/scst_tgt/trace_level reflect currently available logging 3. Cleanup unused log levels from /sys/kernel/scst_tgt/trace_level Suggested-by: Consus git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6907 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst_debug.h | 5 ++--- scst/src/scst_sysfs.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/scst/include/scst_debug.h b/scst/include/scst_debug.h index ee2e18ee4..6bd8a7407 100644 --- a/scst/include/scst_debug.h +++ b/scst/include/scst_debug.h @@ -157,6 +157,8 @@ do { \ } \ } while (0) +#define TRACE_PR(format, args...) TRACE(TRACE_PRES, format, ## args) + #ifdef CONFIG_SCST_DEBUG #define PRINT_BUFFER(message, buff, len) \ @@ -280,8 +282,6 @@ do { \ TRACE_DBG_FLAG(TRACE_MGMT_DEBUG, format, ## args) #define TRACE_MGMT_DBG_SPECIAL(args...) \ TRACE_DBG_FLAG(TRACE_MGMT_DEBUG|TRACE_SPECIAL, format, ## args) -#define TRACE_PR(format, args...) \ - TRACE_DBG_FLAG(TRACE_PRES, format, ## args) #define TRACE_BLOCK(format, args...) \ TRACE_DBG_FLAG(TRACE_BLOCKING, format, ## args) @@ -369,7 +369,6 @@ do { \ #define TRACE_DBG_SPECIAL(format, args...) no_printk(format, ##args) #define TRACE_MGMT_DBG(format, args...) no_printk(format, ##args) #define TRACE_MGMT_DBG_SPECIAL(format, args...) no_printk(format, ##args) -#define TRACE_PR(format, args...) do {} while (0) #define TRACE_BLOCK(format, args...) no_printk(format, ##args) #define TRACE_BUFFER(message, buff, len) \ ((void)(message), (void)(buff), (void)(len)) diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index 94fa0dc42..1cb3a59de 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -162,6 +162,7 @@ static ssize_t scst_trace_level_show(const struct scst_trace_log *local_tbl, " echo \"all|none|default\" >trace_level\n" " echo \"value DEC|0xHEX|0OCT\" >trace_level\n" " echo \"add|del TOKEN\" >trace_level\n" +#ifdef CONFIG_SCST_DEBUG "\nwhere TOKEN is one of [debug, function, line, pid,\n" #ifndef GENERATING_UPSTREAM_PATCH " entryexit, buff, mem, sg, out_of_mem,\n" @@ -170,8 +171,14 @@ static ssize_t scst_trace_level_show(const struct scst_trace_log *local_tbl, #endif " special, scsi, mgmt, minor,\n" " mgmt_dbg, scsi_serializing,\n" - " retry, recv_bot, send_bot, recv_top, pr,\n" - " block, send_top%s]\n", help != NULL ? help : ""); + " retry, pr, block%s]\n", +#else /* CONFIG_SCST_DEBUG */ + "\nwhere TOKEN is one of [function, line, pid," + "out_of_mem, special, scsi, mgmt, minor," + "scsi_serializing, retry, pr%s]\n", + +#endif /* CONFIG_SCST_DEBUG */ + help != NULL ? help : ""); return pos; }