printk: Log printk events

Log printk events to the uncached buffer. If a reset occurs
and printk data is still present in the cache, information will
be lost. This doesn't store the actual printk, but it at least
gives information on who the last caller was.

Change-Id: If1bd414a44b19b45c157d23a7ddde8f16b30e780
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Trevor Bourget <tbourget@codeaurora.org>
This commit is contained in:
Laura Abbott
2012-01-23 13:06:20 -08:00
parent 96a0760091
commit aa9b60bb87
3 changed files with 8 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ enum logk_event_type {
LOGK_NONE = 0, LOGK_NONE = 0,
LOGK_READL, LOGK_READL,
LOGK_WRITEL, LOGK_WRITEL,
LOGK_LOGBUF,
LOGK_OTHER, LOGK_OTHER,
}; };

View File

@@ -65,6 +65,7 @@ static atomic_t msm_rtb_idx;
struct msm_rtb_state msm_rtb = { struct msm_rtb_state msm_rtb = {
.size = SZ_1M, .size = SZ_1M,
.filter = 1 << LOGK_LOGBUF,
}; };
module_param_named(filter, msm_rtb.filter, uint, 0644); module_param_named(filter, msm_rtb.filter, uint, 0644);

View File

@@ -41,7 +41,7 @@
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/notifier.h> #include <linux/notifier.h>
#include <linux/rculist.h> #include <linux/rculist.h>
#include <mach/msm_rtb.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
/* /*
@@ -784,6 +784,11 @@ asmlinkage int printk(const char *fmt, ...)
{ {
va_list args; va_list args;
int r; int r;
#ifdef CONFIG_MSM_RTB
void *caller = __builtin_return_address(0);
uncached_logk_pc(LOGK_LOGBUF, caller, (void *)log_end);
#endif
#ifdef CONFIG_KGDB_KDB #ifdef CONFIG_KGDB_KDB
if (unlikely(kdb_trap_printk)) { if (unlikely(kdb_trap_printk)) {