Skip to content

Commit

Permalink
Logginf cleanup
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vlnb committed Jul 2, 2016
1 parent 4a115b2 commit b7803de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 2 additions & 3 deletions scst/include/scst_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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))
Expand Down
11 changes: 9 additions & 2 deletions scst/src/scst_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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;
}
Expand Down

0 comments on commit b7803de

Please sign in to comment.