print or clear the kernel ring buffer.
.IP "\fB\-r\fR, \fB\-\-raw\fR"
Print the raw message buffer, i.e., do not strip the log level prefixes.
+.IP "\fB\-S\fR, \fB\-\-syslog\fR"
+Force to use
+.BR syslog(2)
+kernel interface to read kernel messages. The default is to use /dev/kmsg rather
+than
+.BR syslog(2)
+since kernel 3.5.0.
.IP "\fB\-s\fR, \fB\-\-buffer-size \fIsize\fR
Use a buffer of
.I size
" -l, --level <list> restrict output to defined levels\n"
" -n, --console-level <level> set level of messages printed to console\n"
" -r, --raw print the raw message buffer\n"
+ " -S, --syslog force to use syslog(2) rather than /dev/kmsg\n"
" -s, --buffer-size <size> buffer size to query the kernel ring buffer\n"
" -T, --ctime show human readable timestamp (could be \n"
" inaccurate if you have used SUSPEND/RESUME)\n"
static struct dmesg_control ctl = {
.filename = NULL,
.action = SYSLOG_ACTION_READ_ALL,
- .method = DMESG_METHOD_SYSLOG,
+ .method = DMESG_METHOD_KMSG,
.kmsg = -1,
};
{ "help", no_argument, NULL, 'h' },
{ "kernel", no_argument, NULL, 'k' },
{ "level", required_argument, NULL, 'l' },
+ { "syslog", no_argument, NULL, 'S' },
{ "raw", no_argument, NULL, 'r' },
{ "read-clear", no_argument, NULL, 'c' },
{ "show-delta", no_argument, NULL, 'd' },
textdomain(PACKAGE);
atexit(close_stdout);
- while ((c = getopt_long(argc, argv, "CcDdEF:f:hkl:n:rs:TtuVx",
+ while ((c = getopt_long(argc, argv, "CcDdEF:f:hkl:n:rSs:TtuVx",
longopts, NULL)) != -1) {
switch (c) {
case 'C':
case 'r':
ctl.raw = 1;
break;
+ case 'S':
+ ctl.method = DMESG_METHOD_SYSLOG;
+ break;
case 's':
ctl.bufsize = strtou32_or_err(optarg,
_("invalid buffer size argument"));