void error(char *m);
int get_random(unsigned long limit, unsigned long *value);
-#define boot_emerg(fmt, ...) boot_printk(KERN_EMERG fmt, ##__VA_ARGS__)
-#define boot_alert(fmt, ...) boot_printk(KERN_ALERT fmt, ##__VA_ARGS__)
-#define boot_crit(fmt, ...) boot_printk(KERN_CRIT fmt, ##__VA_ARGS__)
-#define boot_err(fmt, ...) boot_printk(KERN_ERR fmt, ##__VA_ARGS__)
-#define boot_warn(fmt, ...) boot_printk(KERN_WARNING fmt, ##__VA_ARGS__)
-#define boot_notice(fmt, ...) boot_printk(KERN_NOTICE fmt, ##__VA_ARGS__)
-#define boot_info(fmt, ...) boot_printk(KERN_INFO fmt, ##__VA_ARGS__)
-#define boot_debug(fmt, ...) boot_printk(KERN_DEBUG fmt, ##__VA_ARGS__)
+#ifndef boot_fmt
+#define boot_fmt(fmt) fmt
+#endif
+
+#define boot_emerg(fmt, ...) boot_printk(KERN_EMERG boot_fmt(fmt), ##__VA_ARGS__)
+#define boot_alert(fmt, ...) boot_printk(KERN_ALERT boot_fmt(fmt), ##__VA_ARGS__)
+#define boot_crit(fmt, ...) boot_printk(KERN_CRIT boot_fmt(fmt), ##__VA_ARGS__)
+#define boot_err(fmt, ...) boot_printk(KERN_ERR boot_fmt(fmt), ##__VA_ARGS__)
+#define boot_warn(fmt, ...) boot_printk(KERN_WARNING boot_fmt(fmt), ##__VA_ARGS__)
+#define boot_notice(fmt, ...) boot_printk(KERN_NOTICE boot_fmt(fmt), ##__VA_ARGS__)
+#define boot_info(fmt, ...) boot_printk(KERN_INFO boot_fmt(fmt), ##__VA_ARGS__)
+#define boot_debug(fmt, ...) boot_printk(KERN_DEBUG boot_fmt(fmt), ##__VA_ARGS__)
extern struct machine_info machine;
extern int boot_console_loglevel;
boot_earlyprintk = true;
if (!strcmp(param, "debug"))
boot_console_loglevel = CONSOLE_LOGLEVEL_DEBUG;
- if (!strcmp(param, "bootdebug"))
+ if (!strcmp(param, "bootdebug")) {
bootdebug = true;
+ if (val)
+ strncpy(bootdebug_filter, val, sizeof(bootdebug_filter) - 1);
+ }
if (!strcmp(param, "quiet"))
boot_console_loglevel = CONSOLE_LOGLEVEL_QUIET;
if (!strcmp(param, "ignore_loglevel"))
char __bootdata(boot_rb)[PAGE_SIZE * 2];
bool __bootdata(boot_earlyprintk);
size_t __bootdata(boot_rb_off);
+char __bootdata(bootdebug_filter)[128];
bool __bootdata(bootdebug);
static void boot_rb_add(const char *str, size_t len)
/* always print emergency messages */
if (level > LOGLEVEL_EMERG && !boot_earlyprintk)
return;
+ buf = printk_skip_level(buf);
/* print debug messages only when bootdebug is enabled */
- if (level == LOGLEVEL_DEBUG && !bootdebug)
+ if (level == LOGLEVEL_DEBUG && (!bootdebug || !bootdebug_filter_match(buf)))
return;
if (boot_ignore_loglevel || level < boot_console_loglevel)
- sclp_early_printk(printk_skip_level(buf));
+ sclp_early_printk(buf);
}
#define va_arg_len_type(args, lenmod, typemod) \
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_S390_BOOT_DATA_H
+#include <linux/string.h>
#include <asm/setup.h>
#include <asm/ipl.h>
extern char boot_rb[PAGE_SIZE * 2];
extern bool boot_earlyprintk;
extern size_t boot_rb_off;
+extern char bootdebug_filter[128];
extern bool bootdebug;
#define boot_rb_foreach(cb) \
cb(boot_rb + off); \
} while (0)
+/*
+ * bootdebug_filter is a comma separated list of strings,
+ * where each string can be a prefix of the message.
+ */
+static inline bool bootdebug_filter_match(const char *buf)
+{
+ char *p = bootdebug_filter, *s;
+ char *end;
+
+ if (!*p)
+ return true;
+
+ end = p + strlen(p);
+ while (p < end) {
+ p = skip_spaces(p);
+ s = memscan(p, ',', end - p);
+ if (!strncmp(p, buf, s - p))
+ return true;
+ p = s + 1;
+ }
+ return false;
+}
+
#endif /* _ASM_S390_BOOT_DATA_H */
char __bootdata(boot_rb)[PAGE_SIZE * 2];
bool __bootdata(boot_earlyprintk);
size_t __bootdata(boot_rb_off);
+char __bootdata(bootdebug_filter)[128];
bool __bootdata(bootdebug);
unsigned long __bootdata_preserved(VMALLOC_START);
* Print avoiding interpretation of % in buf and taking bootdebug option
* into consideration.
*/
-static void __init print_rb_entry(char *buf)
+static void __init print_rb_entry(const char *buf)
{
char fmt[] = KERN_SOH "0boot: %s";
int level = printk_get_level(buf);
- if (level == KERN_DEBUG[1] && !bootdebug)
+ buf = printk_skip_level(buf);
+ if (level == KERN_DEBUG[1] && (!bootdebug || !bootdebug_filter_match(buf)))
return;
fmt[1] = level;
- printk(fmt, printk_skip_level(buf));
+ printk(fmt, buf);
}
/*