mirror of
https://github.com/schoebel/mars
synced 2024-12-31 19:32:28 +00:00
infra: allow stopping of log messages
This commit is contained in:
parent
795e931e1f
commit
ad06f69514
@ -43,6 +43,8 @@ char *say_class[MAX_SAY_CLASS] = {
|
||||
[SAY_TOTAL] = "total",
|
||||
};
|
||||
|
||||
int brick_say_logging = 1;
|
||||
EXPORT_SYMBOL_GPL(brick_say_logging);
|
||||
int brick_say_debug =
|
||||
#ifdef CONFIG_MARS_DEBUG_DEFAULT
|
||||
1;
|
||||
@ -632,6 +634,7 @@ void treat_channel(struct say_channel *ch, int class)
|
||||
int len;
|
||||
int overflow;
|
||||
int transact;
|
||||
int start;
|
||||
char *buf;
|
||||
char *tmp;
|
||||
unsigned long flags;
|
||||
@ -653,7 +656,10 @@ void treat_channel(struct say_channel *ch, int class)
|
||||
|
||||
ch->ch_status_written += len;
|
||||
out_to_syslog(class, buf, len);
|
||||
for (transact = 0; transact < 2; transact++) {
|
||||
start = 0;
|
||||
if (!brick_say_logging)
|
||||
start++;
|
||||
for (transact = start; transact < 2; transact++) {
|
||||
if (unlikely(!ch->ch_filp[class][transact])) {
|
||||
char *filename = _make_filename(ch, class, transact, transact);
|
||||
if (likely(filename)) {
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern int brick_say_logging;
|
||||
extern int brick_say_debug;
|
||||
extern int brick_say_syslog_min;
|
||||
extern int brick_say_syslog_max;
|
||||
|
@ -200,6 +200,7 @@ ctl_table mars_table[] = {
|
||||
.mode = 0400,
|
||||
.proc_handler = &lamport_sysctl_handler,
|
||||
},
|
||||
INT_ENTRY("show_log_messages", brick_say_logging, 0600),
|
||||
#ifdef CONFIG_MARS_DEBUG
|
||||
INT_ENTRY("show_debug_messages", brick_say_debug, 0600),
|
||||
INT_ENTRY("show_statistics", global_show_statist, 0600),
|
||||
|
Loading…
Reference in New Issue
Block a user