From e13181422a64183c54c0e0ee80403961c86df2cd Mon Sep 17 00:00:00 2001 From: phil Date: Thu, 11 Sep 2003 18:28:03 +0000 Subject: [PATCH] b=1903 Add /proc/sys/portals/console which defaults to 1; if you set it to 0, it will suppress all console output except LASSERTs --- lnet/include/linux/kp30.h | 3 +++ lnet/libcfs/module.c | 1 + lnet/libcfs/proc.c | 11 +++++++---- lnet/lnet/api-init.c | 1 + lnet/utils/portals.c | 2 +- lustre/portals/include/linux/kp30.h | 3 +++ lustre/portals/libcfs/module.c | 1 + lustre/portals/libcfs/proc.c | 11 +++++++---- lustre/portals/portals/api-init.c | 1 + lustre/portals/utils/portals.c | 2 +- 10 files changed, 26 insertions(+), 10 deletions(-) diff --git a/lnet/include/linux/kp30.h b/lnet/include/linux/kp30.h index a2ef568..1757317 100644 --- a/lnet/include/linux/kp30.h +++ b/lnet/include/linux/kp30.h @@ -19,6 +19,7 @@ extern unsigned int portal_subsystem_debug; extern unsigned int portal_stack; extern unsigned int portal_debug; extern unsigned int portal_printk; +extern unsigned int portal_cerror; /* Debugging subsystems (32 bits, non-overlapping) */ #define S_UNDEFINED (1 << 0) #define S_MDC (1 << 1) @@ -106,6 +107,8 @@ extern unsigned int portal_printk; #if 1 #define CDEBUG(mask, format, a...) \ do { \ + if (portal_cerror == 0) \ + break; \ CHECK_STACK(CDEBUG_STACK); \ if (!(mask) || ((mask) & (D_ERROR | D_EMERG)) || \ (portal_debug & (mask) && \ diff --git a/lnet/libcfs/module.c b/lnet/libcfs/module.c index 7ecbe43..4948769 100644 --- a/lnet/libcfs/module.c +++ b/lnet/libcfs/module.c @@ -546,6 +546,7 @@ EXPORT_SYMBOL(portal_subsystem_debug); EXPORT_SYMBOL(portal_debug); EXPORT_SYMBOL(portal_stack); EXPORT_SYMBOL(portal_printk); +EXPORT_SYMBOL(portal_cerror); EXPORT_SYMBOL(PtlEQWait); EXPORT_SYMBOL(PtlEQFree); EXPORT_SYMBOL(PtlEQGet); diff --git a/lnet/libcfs/proc.c b/lnet/libcfs/proc.c index 8817ace..c1b2aec 100644 --- a/lnet/libcfs/proc.c +++ b/lnet/libcfs/proc.c @@ -65,11 +65,12 @@ extern char portals_upcall[1024]; #define PSDEV_DEBUG 1 /* control debugging */ #define PSDEV_SUBSYSTEM_DEBUG 2 /* control debugging */ #define PSDEV_PRINTK 3 /* force all errors to console */ -#define PSDEV_DEBUG_PATH 4 /* crashdump log location */ -#define PSDEV_DEBUG_DUMP_PATH 5 /* crashdump tracelog location */ -#define PSDEV_PORTALS_UPCALL 6 /* User mode upcall script */ +#define PSDEV_CONSOLE 4 /* allow _any_ messages to console */ +#define PSDEV_DEBUG_PATH 5 /* crashdump log location */ +#define PSDEV_DEBUG_DUMP_PATH 6 /* crashdump tracelog location */ +#define PSDEV_PORTALS_UPCALL 7 /* User mode upcall script */ -#define PORTALS_PRIMARY_CTLCNT 6 +#define PORTALS_PRIMARY_CTLCNT 7 static struct ctl_table portals_table[PORTALS_PRIMARY_CTLCNT + 1] = { {PSDEV_DEBUG, "debug", &portal_debug, sizeof(int), 0644, NULL, &proc_dointvec}, @@ -77,6 +78,8 @@ static struct ctl_table portals_table[PORTALS_PRIMARY_CTLCNT + 1] = { sizeof(int), 0644, NULL, &proc_dointvec}, {PSDEV_PRINTK, "printk", &portal_printk, sizeof(int), 0644, NULL, &proc_dointvec}, + {PSDEV_CONSOLE, "console", &portal_cerror, sizeof(int), 0644, NULL, + &proc_dointvec}, {PSDEV_DEBUG_PATH, "debug_path", debug_file_path, sizeof(debug_file_path), 0644, NULL, &proc_dostring, &sysctl_string}, {PSDEV_DEBUG_DUMP_PATH, "debug_daemon_path", debug_daemon_file_path, diff --git a/lnet/lnet/api-init.c b/lnet/lnet/api-init.c index dc1fead..f77a439 100644 --- a/lnet/lnet/api-init.c +++ b/lnet/lnet/api-init.c @@ -28,6 +28,7 @@ int ptl_init; unsigned int portal_subsystem_debug = ~0 - (S_PORTALS | S_QSWNAL | S_SOCKNAL | S_GMNAL); unsigned int portal_debug = ~0; +unsigned int portal_cerror = 1; unsigned int portal_printk; unsigned int portal_stack; diff --git a/lnet/utils/portals.c b/lnet/utils/portals.c index d8bffab..d70a4f2 100644 --- a/lnet/utils/portals.c +++ b/lnet/utils/portals.c @@ -45,7 +45,7 @@ unsigned int portal_debug; unsigned int portal_printk; unsigned int portal_stack; - +unsigned int portal_cerror; static unsigned int g_nal = 0; diff --git a/lustre/portals/include/linux/kp30.h b/lustre/portals/include/linux/kp30.h index a2ef568..1757317 100644 --- a/lustre/portals/include/linux/kp30.h +++ b/lustre/portals/include/linux/kp30.h @@ -19,6 +19,7 @@ extern unsigned int portal_subsystem_debug; extern unsigned int portal_stack; extern unsigned int portal_debug; extern unsigned int portal_printk; +extern unsigned int portal_cerror; /* Debugging subsystems (32 bits, non-overlapping) */ #define S_UNDEFINED (1 << 0) #define S_MDC (1 << 1) @@ -106,6 +107,8 @@ extern unsigned int portal_printk; #if 1 #define CDEBUG(mask, format, a...) \ do { \ + if (portal_cerror == 0) \ + break; \ CHECK_STACK(CDEBUG_STACK); \ if (!(mask) || ((mask) & (D_ERROR | D_EMERG)) || \ (portal_debug & (mask) && \ diff --git a/lustre/portals/libcfs/module.c b/lustre/portals/libcfs/module.c index 7ecbe43..4948769 100644 --- a/lustre/portals/libcfs/module.c +++ b/lustre/portals/libcfs/module.c @@ -546,6 +546,7 @@ EXPORT_SYMBOL(portal_subsystem_debug); EXPORT_SYMBOL(portal_debug); EXPORT_SYMBOL(portal_stack); EXPORT_SYMBOL(portal_printk); +EXPORT_SYMBOL(portal_cerror); EXPORT_SYMBOL(PtlEQWait); EXPORT_SYMBOL(PtlEQFree); EXPORT_SYMBOL(PtlEQGet); diff --git a/lustre/portals/libcfs/proc.c b/lustre/portals/libcfs/proc.c index 8817ace..c1b2aec 100644 --- a/lustre/portals/libcfs/proc.c +++ b/lustre/portals/libcfs/proc.c @@ -65,11 +65,12 @@ extern char portals_upcall[1024]; #define PSDEV_DEBUG 1 /* control debugging */ #define PSDEV_SUBSYSTEM_DEBUG 2 /* control debugging */ #define PSDEV_PRINTK 3 /* force all errors to console */ -#define PSDEV_DEBUG_PATH 4 /* crashdump log location */ -#define PSDEV_DEBUG_DUMP_PATH 5 /* crashdump tracelog location */ -#define PSDEV_PORTALS_UPCALL 6 /* User mode upcall script */ +#define PSDEV_CONSOLE 4 /* allow _any_ messages to console */ +#define PSDEV_DEBUG_PATH 5 /* crashdump log location */ +#define PSDEV_DEBUG_DUMP_PATH 6 /* crashdump tracelog location */ +#define PSDEV_PORTALS_UPCALL 7 /* User mode upcall script */ -#define PORTALS_PRIMARY_CTLCNT 6 +#define PORTALS_PRIMARY_CTLCNT 7 static struct ctl_table portals_table[PORTALS_PRIMARY_CTLCNT + 1] = { {PSDEV_DEBUG, "debug", &portal_debug, sizeof(int), 0644, NULL, &proc_dointvec}, @@ -77,6 +78,8 @@ static struct ctl_table portals_table[PORTALS_PRIMARY_CTLCNT + 1] = { sizeof(int), 0644, NULL, &proc_dointvec}, {PSDEV_PRINTK, "printk", &portal_printk, sizeof(int), 0644, NULL, &proc_dointvec}, + {PSDEV_CONSOLE, "console", &portal_cerror, sizeof(int), 0644, NULL, + &proc_dointvec}, {PSDEV_DEBUG_PATH, "debug_path", debug_file_path, sizeof(debug_file_path), 0644, NULL, &proc_dostring, &sysctl_string}, {PSDEV_DEBUG_DUMP_PATH, "debug_daemon_path", debug_daemon_file_path, diff --git a/lustre/portals/portals/api-init.c b/lustre/portals/portals/api-init.c index dc1fead..f77a439 100644 --- a/lustre/portals/portals/api-init.c +++ b/lustre/portals/portals/api-init.c @@ -28,6 +28,7 @@ int ptl_init; unsigned int portal_subsystem_debug = ~0 - (S_PORTALS | S_QSWNAL | S_SOCKNAL | S_GMNAL); unsigned int portal_debug = ~0; +unsigned int portal_cerror = 1; unsigned int portal_printk; unsigned int portal_stack; diff --git a/lustre/portals/utils/portals.c b/lustre/portals/utils/portals.c index d8bffab..d70a4f2 100644 --- a/lustre/portals/utils/portals.c +++ b/lustre/portals/utils/portals.c @@ -45,7 +45,7 @@ unsigned int portal_debug; unsigned int portal_printk; unsigned int portal_stack; - +unsigned int portal_cerror; static unsigned int g_nal = 0; -- 1.8.3.1