#endif
MODULE_PARM_DESC(libcfs_debug_mb, "Total debug buffer size.");
+unsigned int libcfs_subsystem_printk;
+module_param(libcfs_subsystem_printk, uint, 0644);
+MODULE_PARM_DESC(libcfs_subsystem_printk, "Lustre kernel debug subsystem console mask");
+
unsigned int libcfs_printk = D_CANTMASK;
module_param(libcfs_printk, uint, 0644);
MODULE_PARM_DESC(libcfs_printk, "Lustre kernel debug console mask");
int write, void __user *buffer, size_t *lenp,
loff_t *ppos)
{
- const int tmpstrlen = 512;
- char *tmpstr = NULL;
- int rc;
+ unsigned int *mask = table->data;
+ int is_subsys = (mask == &libcfs_subsystem_debug ||
+ mask == &libcfs_subsystem_printk) ? 1 : 0;
+ int is_printk = (mask == &libcfs_printk) ? 1 : 0;
+ const int tmpstrlen = 512;
+ char *tmpstr = NULL;
size_t nob = *lenp;
loff_t pos = *ppos;
- unsigned int *mask = table->data;
- int is_subsys = (mask == &libcfs_subsystem_debug) ? 1 : 0;
- int is_printk = (mask == &libcfs_printk) ? 1 : 0;
+ int rc;
if (!write) {
tmpstr = kmalloc(tmpstrlen, GFP_KERNEL | __GFP_ZERO);
.proc_handler = cfs_proc_handler(&proc_dobitmasks),
},
{
+ .procname = "subsystem_printk",
+ .data = &libcfs_subsystem_printk,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = cfs_proc_handler(&proc_dobitmasks),
+ },
+ {
.procname = "debug_log_upcall",
.data = lnet_debug_log_upcall,
.maxlen = sizeof(lnet_debug_log_upcall),
struct va_format *vaf, const char *file,
const char *fn)
{
- char *prefix = "Lustre";
+ int subsys = hdr->ph_subsys;
int mask = hdr->ph_mask;
+ char *prefix = "Lustre";
- if (hdr->ph_subsys == S_LND || hdr->ph_subsys == S_LNET)
+ if (subsys == S_LND || subsys == S_LNET)
prefix = "LNet";
if (mask & D_CONSOLE) {
pr_err("%sError: %pV", prefix, vaf);
else if (mask & D_WARNING)
pr_warn("%s: %pV", prefix, vaf);
- else if (mask & libcfs_printk)
+ else if (mask & libcfs_printk ||
+ subsys & libcfs_subsystem_printk)
pr_info("%s: %pV", prefix, vaf);
} else {
if (mask & D_EMERG)
pr_warn("%s: %d:%d:(%s:%d:%s()) %pV", prefix,
hdr->ph_pid, hdr->ph_extern_pid, file,
hdr->ph_line_num, fn, vaf);
- else if (mask & (D_CONSOLE | libcfs_printk))
- pr_info("%s: %pV", prefix, vaf);
+ else if (mask & libcfs_printk ||
+ subsys & libcfs_subsystem_printk)
+ pr_info("%s: %d:%d:(%s:%d:%s()) %pV", prefix,
+ hdr->ph_pid, hdr->ph_extern_pid, file,
+ hdr->ph_line_num, fn, vaf);
}
}
__LASSERT(tage->used <= PAGE_SIZE);
console:
- if ((header.ph_mask & libcfs_printk) == 0) {
+ if ((header.ph_mask & libcfs_printk) == 0 &&
+ (header.ph_subsys & libcfs_subsystem_printk) == 0) {
/* no console output requested */
if (tcd != NULL)
cfs_trace_put_tcd(tcd);