19 #include <linux/kernel.h>
21 #include <linux/tty.h>
27 #include <linux/module.h>
36 #include <linux/kexec.h>
44 #include <linux/poll.h>
46 #include <asm/uaccess.h>
48 #define CREATE_TRACE_POINTS
59 #define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL
62 #define MINIMUM_CONSOLE_LOGLEVEL 1
63 #define DEFAULT_CONSOLE_LOGLEVEL 7
98 static int console_locked, console_suspended;
103 static struct console *exclusive_console;
113 #ifdef CONFIG_A11Y_BRAILLE_CONSOLE
118 #define MAX_CMDLINECONSOLES 8
121 static int selected_console = -1;
122 static int preferred_console = -1;
127 static int console_may_schedule;
221 static u64 syslog_seq;
222 static u32 syslog_idx;
224 static size_t syslog_partial;
227 static u64 log_first_seq;
228 static u32 log_first_idx;
231 static u64 log_next_seq;
232 static u32 log_next_idx;
235 static u64 console_seq;
236 static u32 console_idx;
240 static u64 clear_seq;
241 static u32 clear_idx;
243 #define PREFIX_MAX 32
244 #define LOG_LINE_MAX 1024 - PREFIX_MAX
247 #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
250 #define LOG_ALIGN __alignof__(struct log)
252 #define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT)
253 static char __log_buf[__LOG_BUF_LEN]
__aligned(LOG_ALIGN);
254 static char *log_buf = __log_buf;
255 static u32 log_buf_len = __LOG_BUF_LEN;
258 static volatile unsigned int logbuf_cpu =
UINT_MAX;
261 static char *log_text(
const struct log *
msg)
263 return (
char *)msg +
sizeof(
struct log);
267 static char *log_dict(
const struct log *msg)
269 return (
char *)msg +
sizeof(
struct log) + msg->
text_len;
275 struct log *msg = (
struct log *)(log_buf + idx);
282 return (
struct log *)log_buf;
287 static u32 log_next(
u32 idx)
289 struct log *msg = (
struct log *)(log_buf + idx);
298 msg = (
struct log *)log_buf;
301 return idx + msg->
len;
314 size =
sizeof(
struct log) + text_len + dict_len;
315 pad_len = (-
size) & (LOG_ALIGN - 1);
318 while (log_first_seq < log_next_seq) {
321 if (log_next_idx > log_first_idx)
322 free =
max(log_buf_len - log_next_idx, log_first_idx);
324 free = log_first_idx - log_next_idx;
326 if (free > size +
sizeof(
struct log))
330 log_first_idx = log_next(log_first_idx);
334 if (log_next_idx + size +
sizeof(
struct log) >= log_buf_len) {
340 memset(log_buf + log_next_idx, 0,
sizeof(
struct log));
345 msg = (
struct log *)(log_buf + log_next_idx);
346 memcpy(log_text(msg), text, text_len);
348 memcpy(log_dict(msg), dict, dict_len);
351 msg->
level = level & 7;
352 msg->
flags = flags & 0x1f;
357 memset(log_dict(msg) + dict_len, 0, pad_len);
358 msg->
len =
sizeof(
struct log) + text_len + dict_len + pad_len;
361 log_next_idx += msg->
len;
366 struct devkmsg_user {
381 size_t len = iov_length(iv, count);
391 for (i = 0; i <
count; i++) {
409 if (line[0] ==
'<') {
413 if (endp && endp[0] ==
'>') {
424 printk_emit(facility, level,
NULL, 0,
"%s", line);
431 size_t count, loff_t *ppos)
448 while (user->seq == log_next_seq) {
457 user->seq != log_next_seq);
463 if (user->seq < log_first_seq) {
465 user->idx = log_first_idx;
466 user->seq = log_first_seq;
472 msg = log_from_idx(user->idx);
490 len =
sprintf(user->buf,
"%u,%llu,%llu,%c;",
492 user->seq, ts_usec, cont);
493 user->prev = msg->
flags;
496 for (i = 0; i < msg->
text_len; i++) {
497 unsigned char c = log_text(msg)[
i];
499 if (c < ' ' || c >= 127 || c ==
'\\')
500 len +=
sprintf(user->buf + len,
"\\x%02x", c);
502 user->buf[len++] =
c;
504 user->buf[len++] =
'\n';
509 for (i = 0; i < msg->
dict_len; i++) {
510 unsigned char c = log_dict(msg)[
i];
513 user->buf[len++] =
' ';
518 user->buf[len++] =
'\n';
523 if (c < ' ' || c >= 127 || c ==
'\\') {
524 len +=
sprintf(user->buf + len,
"\\x%02x", c);
528 user->buf[len++] =
c;
530 user->buf[len++] =
'\n';
533 user->idx = log_next(user->idx);
552 static loff_t devkmsg_llseek(
struct file *file, loff_t
offset,
int whence)
566 user->idx = log_first_idx;
567 user->seq = log_first_seq;
575 user->idx = clear_idx;
576 user->seq = clear_seq;
580 user->idx = log_next_idx;
581 user->seq = log_next_seq;
590 static unsigned int devkmsg_poll(
struct file *file,
poll_table *
wait)
598 poll_wait(file, &log_wait, wait);
601 if (user->seq < log_next_seq) {
603 if (user->seq < log_first_seq)
612 static int devkmsg_open(
struct inode *
inode,
struct file *file)
614 struct devkmsg_user *
user;
632 user->idx = log_first_idx;
633 user->seq = log_first_seq;
640 static int devkmsg_release(
struct inode *inode,
struct file *file)
653 .open = devkmsg_open,
654 .read = devkmsg_read,
655 .aio_write = devkmsg_writev,
656 .llseek = devkmsg_llseek,
657 .poll = devkmsg_poll,
658 .release = devkmsg_release,
670 void log_buf_kexec_setup(
void)
672 VMCOREINFO_SYMBOL(log_buf);
673 VMCOREINFO_SYMBOL(log_buf_len);
674 VMCOREINFO_SYMBOL(log_first_idx);
675 VMCOREINFO_SYMBOL(log_next_idx);
680 VMCOREINFO_STRUCT_SIZE(
log);
681 VMCOREINFO_OFFSET(
log, ts_nsec);
682 VMCOREINFO_OFFSET(
log, len);
683 VMCOREINFO_OFFSET(
log, text_len);
684 VMCOREINFO_OFFSET(
log, dict_len);
689 static unsigned long __initdata new_log_buf_len;
692 static int __init log_buf_len_setup(
char *
str)
694 unsigned size =
memparse(str, &str);
698 if (size > log_buf_len)
699 new_log_buf_len =
size;
705 void __init setup_log_buf(
int early)
711 if (!new_log_buf_len)
720 new_log_buf =
__va(mem);
726 pr_err(
"log_buf_len: %ld bytes not available\n",
732 log_buf_len = new_log_buf_len;
733 log_buf = new_log_buf;
735 free = __LOG_BUF_LEN - log_next_idx;
736 memcpy(log_buf, __log_buf, __LOG_BUF_LEN);
739 pr_info(
"log_buf_len: %d\n", log_buf_len);
740 pr_info(
"early log buf free: %d(%d%%)\n",
741 free, (free * 100) / __LOG_BUF_LEN);
744 #ifdef CONFIG_BOOT_PRINTK_DELAY
746 static int boot_delay;
747 static unsigned long long loops_per_msec;
749 static int __init boot_delay_setup(
char *str)
754 loops_per_msec = (
unsigned long long)lpj / 1000 *
HZ;
757 if (boot_delay > 10 * 1000)
760 pr_debug(
"boot_delay: %u, preset_lpj: %ld, lpj: %lu, "
761 "HZ: %d, loops_per_msec: %llu\n",
765 __setup(
"boot_delay=", boot_delay_setup);
767 static void boot_delay_msec(
void)
769 unsigned long long k;
775 k = (
unsigned long long)loops_per_msec * boot_delay;
792 static inline void boot_delay_msec(
void)
797 #ifdef CONFIG_SECURITY_DMESG_RESTRICT
798 int dmesg_restrict = 1;
803 static int syslog_action_restricted(
int type)
811 static int check_syslog_permissions(
int type,
bool from_file)
820 if (syslog_action_restricted(type)) {
826 "Attempt to access syslog with CAP_SYS_ADMIN "
827 "but no CAP_SYSLOG (deprecated).\n",
836 #if defined(CONFIG_PRINTK_TIME)
837 static bool printk_time = 1;
839 static bool printk_time;
843 static size_t print_time(
u64 ts,
char *buf)
845 unsigned long rem_nsec;
853 rem_nsec =
do_div(ts, 1000000000);
854 return sprintf(buf,
"[%5lu.%06lu] ",
855 (
unsigned long)ts, rem_nsec / 1000);
858 static size_t print_prefix(
const struct log *msg,
bool syslog,
char *buf)
865 len +=
sprintf(buf,
"<%u>", prefix);
870 else if (prefix > 99)
877 len += print_time(msg->
ts_nsec, buf ? buf + len :
NULL);
882 bool syslog,
char *buf,
size_t size)
884 const char *text = log_text(msg);
893 if (msg->
flags & LOG_CONT) {
897 if (!(msg->
flags & LOG_NEWLINE))
902 const char *
next =
memchr(text,
'\n', text_size);
906 text_len = next -
text;
908 text_size -= next -
text;
910 text_len = text_size;
914 if (print_prefix(msg, syslog,
NULL) +
915 text_len + 1 >= size - len)
919 len += print_prefix(msg, syslog, buf + len);
920 memcpy(buf + len, text, text_len);
927 len += print_prefix(msg, syslog,
NULL);
940 static int syslog_print(
char __user *buf,
int size)
955 if (syslog_seq < log_first_seq) {
957 syslog_seq = log_first_seq;
958 syslog_idx = log_first_idx;
962 if (syslog_seq == log_next_seq) {
967 skip = syslog_partial;
968 msg = log_from_idx(syslog_idx);
969 n = msg_print_text(msg, syslog_prev,
true, text,
971 if (n - syslog_partial <= size) {
973 syslog_idx = log_next(syslog_idx);
975 syslog_prev = msg->
flags;
1004 static int syslog_print_all(
char __user *buf,
int size,
bool clear)
1020 if (clear_seq < log_first_seq) {
1022 clear_seq = log_first_seq;
1023 clear_idx = log_first_idx;
1033 while (seq < log_next_seq) {
1034 struct log *msg = log_from_idx(idx);
1036 len += msg_print_text(msg, prev,
true,
NULL, 0);
1038 idx = log_next(idx);
1046 while (len > size && seq < log_next_seq) {
1047 struct log *msg = log_from_idx(idx);
1049 len -= msg_print_text(msg, prev,
true,
NULL, 0);
1051 idx = log_next(idx);
1056 next_seq = log_next_seq;
1060 while (len >= 0 && seq < next_seq) {
1061 struct log *msg = log_from_idx(idx);
1064 textlen = msg_print_text(msg, prev,
true, text,
1070 idx = log_next(idx);
1081 if (seq < log_first_seq) {
1083 seq = log_first_seq;
1084 idx = log_first_idx;
1091 clear_seq = log_next_seq;
1092 clear_idx = log_next_idx;
1100 int do_syslog(
int type,
char __user *buf,
int len,
bool from_file)
1103 static int saved_console_loglevel = -1;
1106 error = check_syslog_permissions(type, from_file);
1121 if (!buf || len < 0)
1131 syslog_seq != log_next_seq);
1134 error = syslog_print(buf, len);
1143 if (!buf || len < 0)
1152 error = syslog_print_all(buf, len, clear);
1156 syslog_print_all(
NULL, 0,
true);
1160 if (saved_console_loglevel == -1)
1166 if (saved_console_loglevel != -1) {
1168 saved_console_loglevel = -1;
1174 if (len < 1 || len > 8)
1180 saved_console_loglevel = -1;
1186 if (syslog_seq < log_first_seq) {
1188 syslog_seq = log_first_seq;
1189 syslog_idx = log_first_idx;
1199 error = log_next_idx - syslog_idx;
1201 u64 seq = syslog_seq;
1202 u32 idx = syslog_idx;
1206 while (seq < log_next_seq) {
1207 struct log *msg = log_from_idx(idx);
1209 error += msg_print_text(msg, prev,
true,
NULL, 0);
1210 idx = log_next(idx);
1214 error -= syslog_partial;
1220 error = log_buf_len;
1237 static int __init ignore_loglevel_setup(
char *str)
1239 ignore_loglevel = 1;
1245 early_param(
"ignore_loglevel", ignore_loglevel_setup);
1248 "print all kernel messages to the console.");
1255 static void call_console_drivers(
int level,
const char *text,
size_t len)
1259 trace_console(text, 0, len, len);
1263 if (!console_drivers)
1267 if (exclusive_console && con != exclusive_console)
1276 con->
write(con, text, len);
1285 static void zap_locks(
void)
1287 static unsigned long oops_timestamp;
1299 sema_init(&console_sem, 1);
1303 static int have_callable_console(
void)
1322 static
inline int can_use_console(
unsigned int cpu)
1324 return cpu_online(cpu) || have_callable_console();
1337 static int console_trylock_for_printk(
unsigned int cpu)
1340 int retval = 0, wake = 0;
1351 if (!can_use_console(
cpu)) {
1366 static inline void printk_delay(
void)
1369 int m = printk_delay_msec;
1384 static struct cont {
1396 static void cont_flush(
enum log_flags flags)
1409 log_store(cont.facility, cont.level, flags |
LOG_NOCONS,
1410 cont.ts_nsec,
NULL, 0, cont.buf, cont.len);
1412 cont.flushed =
true;
1418 log_store(cont.facility, cont.level, flags, 0,
1419 NULL, 0, cont.buf, cont.len);
1424 static bool cont_add(
int facility,
int level,
const char *text,
size_t len)
1426 if (cont.len && cont.flushed)
1429 if (cont.len + len >
sizeof(cont.buf)) {
1431 cont_flush(LOG_CONT);
1436 cont.facility = facility;
1442 cont.flushed =
false;
1445 memcpy(cont.buf + cont.len, text, len);
1448 if (cont.len > (
sizeof(cont.buf) * 80) / 100)
1449 cont_flush(LOG_CONT);
1454 static size_t cont_print_text(
char *text,
size_t size)
1459 if (cont.cons == 0 && (console_prev & LOG_NEWLINE)) {
1460 textlen += print_time(cont.ts_nsec, text);
1464 len = cont.len - cont.cons;
1468 memcpy(text + textlen, cont.buf + cont.cons, len);
1470 cont.cons = cont.len;
1474 if (cont.flags & LOG_NEWLINE)
1475 text[textlen++] =
'\n';
1482 asmlinkage int vprintk_emit(
int facility,
int level,
1483 const char *dict,
size_t dictlen,
1486 static int recursion_bug;
1488 char *text = textbuf;
1491 unsigned long flags;
1493 int printed_len = 0;
1505 if (
unlikely(logbuf_cpu == this_cpu)) {
1515 goto out_restore_irqs;
1522 logbuf_cpu = this_cpu;
1524 if (recursion_bug) {
1525 static const char recursion_msg[] =
1526 "BUG: recent printk recursion!";
1529 printed_len +=
strlen(recursion_msg);
1532 NULL, 0, recursion_msg, printed_len);
1539 text_len =
vscnprintf(text,
sizeof(textbuf), fmt, args);
1542 if (text_len && text[text_len-1] ==
'\n') {
1548 if (facility == 0) {
1549 int kern_level = printk_get_level(text);
1552 const char *end_of_header = printk_skip_level(text);
1553 switch (kern_level) {
1556 level = kern_level -
'0';
1562 text_len -= end_of_header -
text;
1563 text = (
char *)end_of_header;
1573 if (!(lflags & LOG_NEWLINE)) {
1579 cont_flush(LOG_NEWLINE);
1582 if (!cont_add(facility, level, text, text_len))
1583 log_store(facility, level, lflags | LOG_CONT, 0,
1584 dict, dictlen, text, text_len);
1586 bool stored =
false;
1594 if (cont.len && cont.owner ==
current) {
1596 stored = cont_add(facility, level, text, text_len);
1597 cont_flush(LOG_NEWLINE);
1601 log_store(facility, level, lflags, 0,
1602 dict, dictlen, text, text_len);
1604 printed_len += text_len;
1614 if (console_trylock_for_printk(this_cpu))
1627 return vprintk_emit(0, -1,
NULL, 0, fmt, args);
1631 asmlinkage int printk_emit(
int facility,
int level,
1632 const char *dict,
size_t dictlen,
1633 const char *fmt, ...)
1639 r = vprintk_emit(facility, level, dict, dictlen, fmt, args);
1672 #ifdef CONFIG_KGDB_KDB
1681 r = vprintk_emit(0, -1,
NULL, 0, fmt, args);
1690 #define LOG_LINE_MAX 0
1691 #define PREFIX_MAX 0
1692 #define LOG_LINE_MAX 0
1693 static u64 syslog_seq;
1694 static u32 syslog_idx;
1695 static u64 console_seq;
1696 static u32 console_idx;
1698 static u64 log_first_seq;
1699 static u32 log_first_idx;
1700 static u64 log_next_seq;
1702 static struct cont {
1708 static struct log *log_from_idx(
u32 idx) {
return NULL; }
1709 static u32 log_next(
u32 idx) {
return 0; }
1710 static void call_console_drivers(
int level,
const char *text,
size_t len) {}
1711 static size_t msg_print_text(
const struct log *msg,
enum log_flags prev,
1712 bool syslog,
char *buf,
size_t size) {
return 0; }
1713 static size_t cont_print_text(
char *text,
size_t size) {
return 0; }
1717 static int __add_preferred_console(
char *
name,
int idx,
char *
options,
1731 selected_console =
i;
1737 selected_console =
i;
1741 #ifdef CONFIG_A11Y_BRAILLE_CONSOLE
1742 c->brl_options = brl_options;
1750 static int __init console_setup(
char *str)
1756 #ifdef CONFIG_A11Y_BRAILLE_CONSOLE
1757 if (!
memcmp(str,
"brl,", 4)) {
1760 }
else if (!
memcmp(str,
"brl=", 4)) {
1761 brl_options = str + 4;
1762 str =
strchr(brl_options,
',');
1774 if (str[0] >=
'0' && str[0] <=
'9') {
1776 strncpy(buf + 4, str,
sizeof(buf) - 5);
1778 strncpy(buf, str,
sizeof(buf) - 1);
1780 buf[
sizeof(
buf) - 1] = 0;
1784 if (!
strcmp(str,
"ttya"))
1786 if (!
strcmp(str,
"ttyb"))
1789 for (s = buf; *
s; s++)
1790 if ((*s >=
'0' && *s <=
'9') || *s ==
',')
1795 __add_preferred_console(buf, idx, options, brl_options);
1796 console_set_on_cmdline = 1;
1799 __setup(
"console=", console_setup);
1816 return __add_preferred_console(name, idx, options,
NULL);
1841 static int __init console_suspend_disable(
char *str)
1843 console_suspend_enabled = 0;
1846 __setup(
"no_console_suspend", console_suspend_disable);
1850 " and hibernate operations");
1859 if (!console_suspend_enabled)
1861 printk(
"Suspending console(s) (use no_console_suspend to debug)\n");
1863 console_suspended = 1;
1869 if (!console_suspend_enabled)
1872 console_suspended = 0;
1888 unsigned long action,
void *hcpu)
1913 if (console_suspended)
1916 console_may_schedule = 1;
1932 if (console_suspended) {
1937 console_may_schedule = 0;
1944 return console_locked;
1950 #define PRINTK_BUF_SIZE 512
1952 #define PRINTK_PENDING_WAKEUP 0x01
1953 #define PRINTK_PENDING_SCHED 0x02
1984 static void console_cont_flush(
char *text,
size_t size)
1986 unsigned long flags;
1999 if (console_seq < log_next_seq && !cont.cons)
2002 len = cont_print_text(text, size);
2005 call_console_drivers(cont.level, text, len);
2030 static u64 seen_seq;
2031 unsigned long flags;
2032 bool wake_klogd =
false;
2035 if (console_suspended) {
2040 console_may_schedule = 0;
2043 console_cont_flush(text,
sizeof(text));
2051 if (seen_seq != log_next_seq) {
2053 seen_seq = log_next_seq;
2056 if (console_seq < log_first_seq) {
2058 console_seq = log_first_seq;
2059 console_idx = log_first_idx;
2063 if (console_seq == log_next_seq)
2066 msg = log_from_idx(console_idx);
2072 console_idx = log_next(console_idx);
2080 console_prev = msg->
flags;
2085 len = msg_print_text(msg, console_prev,
false,
2086 text,
sizeof(text));
2087 console_idx = log_next(console_idx);
2089 console_prev = msg->
flags;
2093 call_console_drivers(level, text, len);
2101 exclusive_console =
NULL;
2114 retry = console_seq != log_next_seq;
2136 if (console_may_schedule)
2149 if (oops_in_progress) {
2156 console_may_schedule = 0;
2175 driver = c->
device(c, index);
2204 static int __read_mostly keep_bootcon;
2206 static int __init keep_bootcon_setup(
char *str)
2238 unsigned long flags;
2259 if (preferred_console < 0 || bcon || !console_drivers)
2260 preferred_console = selected_console;
2270 if (preferred_console < 0) {
2271 if (newcon->
index < 0)
2278 preferred_console = 0;
2291 if (newcon->
index >= 0 &&
2294 if (newcon->
index < 0)
2296 #ifdef CONFIG_A11Y_BRAILLE_CONSOLE
2306 if (newcon->
setup &&
2311 if (i == selected_console) {
2313 preferred_console = selected_console;
2337 console_drivers = newcon;
2341 newcon->
next = console_drivers->
next;
2342 console_drivers->
next = newcon;
2350 console_seq = syslog_seq;
2351 console_idx = syslog_idx;
2352 console_prev = syslog_prev;
2359 exclusive_console = newcon;
2392 struct console *
a, *
b;
2395 #ifdef CONFIG_A11Y_BRAILLE_CONSOLE
2401 if (console_drivers == console) {
2402 console_drivers=console->
next;
2404 }
else if (console_drivers) {
2405 for (a=console_drivers->
next, b=console_drivers ;
2406 a; b=a, a=b->
next) {
2428 static int __init printk_late_init(
void)
2444 #if defined CONFIG_PRINTK
2446 int printk_sched(
const char *fmt, ...)
2448 unsigned long flags;
2474 int __printk_ratelimit(
const char *
func)
2489 bool printk_timed_ratelimit(
unsigned long *caller_jiffies,
2490 unsigned int interval_msecs)
2492 if (*caller_jiffies == 0
2514 int kmsg_dump_register(
struct kmsg_dumper *dumper)
2516 unsigned long flags;
2527 list_add_tail_rcu(&dumper->
list, &dump_list);
2530 spin_unlock_irqrestore(&dump_list_lock, flags);
2543 int kmsg_dump_unregister(
struct kmsg_dumper *dumper)
2545 unsigned long flags;
2551 list_del_rcu(&dumper->
list);
2554 spin_unlock_irqrestore(&dump_list_lock, flags);
2561 static bool always_kmsg_dump;
2575 unsigned long flags;
2581 list_for_each_entry_rcu(dumper, &dump_list,
list) {
2596 dumper->
dump(dumper, reason);
2623 bool kmsg_dump_get_line_nolock(
struct kmsg_dumper *dumper,
bool syslog,
2624 char *line,
size_t size,
size_t *len)
2633 if (dumper->
cur_seq < log_first_seq) {
2635 dumper->
cur_seq = log_first_seq;
2636 dumper->
cur_idx = log_first_idx;
2640 if (dumper->
cur_seq >= log_next_seq)
2643 msg = log_from_idx(dumper->
cur_idx);
2644 l = msg_print_text(msg, 0, syslog, line, size);
2672 bool kmsg_dump_get_line(
struct kmsg_dumper *dumper,
bool syslog,
2673 char *line,
size_t size,
size_t *len)
2675 unsigned long flags;
2679 ret = kmsg_dump_get_line_nolock(dumper, syslog, line, size, len);
2705 bool kmsg_dump_get_buffer(
struct kmsg_dumper *dumper,
bool syslog,
2706 char *buf,
size_t size,
size_t *len)
2708 unsigned long flags;
2721 if (dumper->
cur_seq < log_first_seq) {
2723 dumper->
cur_seq = log_first_seq;
2724 dumper->
cur_idx = log_first_idx;
2737 while (seq < dumper->next_seq) {
2738 struct log *msg = log_from_idx(idx);
2740 l += msg_print_text(msg, prev,
true,
NULL, 0);
2741 idx = log_next(idx);
2750 while (l > size && seq < dumper->next_seq) {
2751 struct log *msg = log_from_idx(idx);
2753 l -= msg_print_text(msg, prev,
true,
NULL, 0);
2754 idx = log_next(idx);
2765 while (seq < dumper->next_seq) {
2766 struct log *msg = log_from_idx(idx);
2768 l += msg_print_text(msg, prev, syslog, buf + l, size - l);
2769 idx = log_next(idx);
2795 void kmsg_dump_rewind_nolock(
struct kmsg_dumper *dumper)
2813 unsigned long flags;
2816 kmsg_dump_rewind_nolock(dumper);