aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2007-10-17 02:26:43 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:42:50 -0400
commit0b15d04af3dd996035d8fa81fc849d049171f9c3 (patch)
treecb0dc973b6485edb6fdf0bcdf4a2eeef9a48adad /include/linux/kernel.h
parentd823e3e7541c39b4dfe9c79dbf052b4c39da2965 (diff)
printk: add interfaces for external access to the log buffer
Add two new functions for reading the kernel log buffer. The intention is for them to be used by recovery/dump/debug code so the kernel log can be easily retrieved/parsed in a crash scenario, but they are generic enough for other people to dream up other fun uses. [akpm@linux-foundation.org: buncha fixes] Signed-off-by: Mike Frysinger <vapier@gentoo.org> Cc: Robin Getz <rgetz@blackfin.uclinux.org> Cc: Greg Ungerer <gerg@snapgear.com> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Paul Mundt <lethal@linux-sh.org> Acked-by: Tim Bird <tim.bird@am.sony.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 5fdbc814c2eb..c680e1e6e9a3 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -172,6 +172,9 @@ asmlinkage int vprintk(const char *fmt, va_list args)
172 __attribute__ ((format (printf, 1, 0))); 172 __attribute__ ((format (printf, 1, 0)));
173asmlinkage int printk(const char * fmt, ...) 173asmlinkage int printk(const char * fmt, ...)
174 __attribute__ ((format (printf, 1, 2))) __cold; 174 __attribute__ ((format (printf, 1, 2))) __cold;
175extern int log_buf_get_len(void);
176extern int log_buf_read(int idx);
177extern int log_buf_copy(char *dest, int idx, int len);
175#else 178#else
176static inline int vprintk(const char *s, va_list args) 179static inline int vprintk(const char *s, va_list args)
177 __attribute__ ((format (printf, 1, 0))); 180 __attribute__ ((format (printf, 1, 0)));
@@ -179,6 +182,9 @@ static inline int vprintk(const char *s, va_list args) { return 0; }
179static inline int printk(const char *s, ...) 182static inline int printk(const char *s, ...)
180 __attribute__ ((format (printf, 1, 2))); 183 __attribute__ ((format (printf, 1, 2)));
181static inline int __cold printk(const char *s, ...) { return 0; } 184static inline int __cold printk(const char *s, ...) { return 0; }
185static inline int log_buf_get_len(void) { return 0; }
186static inline int log_buf_read(int idx) { return 0; }
187static inline int log_buf_copy(char *dest, int idx, int len) { return 0; }
182#endif 188#endif
183 189
184unsigned long int_sqrt(unsigned long); 190unsigned long int_sqrt(unsigned long);