]> git.wh0rd.org Git - patches.git/blob - printk-add-interfaces-for-external-access-to-the-log-buffer-dont-use-ring-buffer.patch
scummvm random work
[patches.git] / printk-add-interfaces-for-external-access-to-the-log-buffer-dont-use-ring-buffer.patch
1 Key off of the log buffer rather than the kernel ring buffer as the
2 latter is constantly cleared by userspace daemons.  Also, make sure
3 we index into the buffer properly as pointed out by Tim Bird.
4
5 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
6 ---
7 --- a/kernel/printk.c
8 +++ b/kernel/printk.c
9 @@ -168,7 +168,7 @@
10   */
11  int log_buf_get_len(void)
12  {
13 -       return log_end - log_start;
14 +       return logged_chars;
15  }
16  
17  /*
18 @@ -191,10 +191,9 @@
19                 if (len > max)
20                         len = max;
21                 ret = len;
22 -               while (len-- > 0) {
23 -                       *dest = LOG_BUF(idx++);
24 -                       ++dest;
25 -               }
26 +               idx += (log_end - max);
27 +               while (len-- > 0)
28 +                       dest[len] = LOG_BUF(idx + len);
29         }
30  
31         if (took_lock)