D_NETERROR | D_HA | D_CONFIG | D_IOCTL);
EXPORT_SYMBOL(libcfs_debug);
-unsigned int libcfs_printk;
+unsigned int libcfs_printk = D_CANTMASK;
EXPORT_SYMBOL(libcfs_printk);
unsigned int libcfs_console_ratelimit = 0;
/* toconsole == 0 - all messages to debug_file_fd
* toconsole == 1 - warnings to console, all to debug_file_fd
* toconsole > 1 - all debug to console */
- if ( ((mask & D_CANTMASK) &&
- (toconsole == 1)) || (toconsole > 1)) {
+ if (((mask & libcfs_printk) && toconsole == 1) || toconsole > 1)
console = 1;
- }
#endif
if ((!console) && (!debug_file_fd)) {
int rc;
unsigned int *mask = data;
int is_subsys = (mask == &libcfs_subsystem_debug) ? 1 : 0;
+ int is_printk = (mask == &libcfs_printk) ? 1 : 0;
rc = trace_allocate_string_buffer(&tmpstr, tmpstrlen);
if (rc < 0)
return rc;
-
+
if (!write) {
libcfs_debug_mask2str(tmpstr, tmpstrlen, *mask, is_subsys);
rc = strlen(tmpstr);
rc = trace_copyin_string(tmpstr, tmpstrlen, buffer, nob);
if (rc < 0)
return rc;
-
+
rc = libcfs_debug_str2mask(mask, tmpstr, is_subsys);
+ /* Always print LBUG/LASSERT to console, so keep this mask */
+ if (is_printk)
+ *mask |= D_EMERG;
}
trace_free_string_buffer(tmpstr, tmpstrlen);
} else if ((mask & D_WARNING) != 0) {
prefix = "Lustre";
ptype = KERN_WARNING;
- } else if ((mask & libcfs_printk) != 0 || (mask & D_CONSOLE)) {
+ } else if ((mask & (D_CONSOLE | libcfs_printk)) != 0) {
prefix = "Lustre";
ptype = KERN_INFO;
}
__LASSERT (tage->used <= CFS_PAGE_SIZE);
console:
- if (!((mask & D_CANTMASK) != 0 || (mask & libcfs_printk) != 0)) {
+ if ((mask & libcfs_printk) == 0) {
/* no console output requested */
if (tcd != NULL)
trace_put_tcd(tcd);
#include "parser.h"
unsigned int libcfs_debug;
-unsigned int libcfs_printk;
+unsigned int libcfs_printk = D_CANTMASK;
static int g_net_set;
static __u32 g_net;