diff options
| author | Dhaval Patel <pdhaval@codeaurora.org> | 2015-10-08 14:58:19 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:46:38 -0700 |
| commit | b4f8ec2c58bbad4599f22cd9f878466decfb01b2 (patch) | |
| tree | c25c8ed2b6ca0c54503c7dc84f14af5b2316ba86 /drivers/video/fbdev | |
| parent | 8a3c5c0b9912ccb960e5894244d3b1205baa3577 (diff) | |
msm: mdss: increase xlog entries for debug purpose
Print 256 xlog entries in kernel log but keep 1024
entries in memory. This will be helpful while debugging
issue where user needs larger xlog information.
Change-Id: Ic8b6143eef7afd1220ccf40f8ad7617b94017532
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_debug_xlog.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/video/fbdev/msm/mdss_debug_xlog.c b/drivers/video/fbdev/msm/mdss_debug_xlog.c index b03fc948ef5c..382ac3ebb789 100644 --- a/drivers/video/fbdev/msm/mdss_debug_xlog.c +++ b/drivers/video/fbdev/msm/mdss_debug_xlog.c @@ -33,7 +33,19 @@ #define XLOG_DEFAULT_DBGBUSDUMP 0x2 /* dump in RAM */ #define XLOG_DEFAULT_VBIF_DBGBUSDUMP 0x2 /* dump in RAM */ -#define MDSS_XLOG_ENTRY 256 +/* + * xlog will print this number of entries when it is called through + * sysfs node or panic. This prevents kernel log from xlog message + * flood. + */ +#define MDSS_XLOG_PRINT_ENTRY 256 + +/* + * xlog keeps this number of entries in memory for debug purpose. This + * number must be greater than print entry to prevent out of bound xlog + * entry array access. + */ +#define MDSS_XLOG_ENTRY (MDSS_XLOG_PRINT_ENTRY * 4) #define MDSS_XLOG_MAX_DATA 15 #define MDSS_XLOG_BUF_MAX 512 #define MDSS_XLOG_BUF_ALIGN 32 @@ -41,6 +53,7 @@ DEFINE_SPINLOCK(xlock); struct tlog { + u32 counter; s64 time; const char *name; int line; @@ -53,6 +66,7 @@ struct mdss_dbg_xlog { struct tlog logs[MDSS_XLOG_ENTRY]; u32 first; u32 last; + u32 curr; struct dentry *xlog; u32 xlog_enable; u32 panic_on_err; @@ -82,13 +96,11 @@ void mdss_xlog(const char *name, int line, int flag, ...) va_list args; struct tlog *log; - if (!mdss_xlog_is_enabled(flag)) return; spin_lock_irqsave(&xlock, flags); - - log = &mdss_dbg_xlog.logs[mdss_dbg_xlog.last % MDSS_XLOG_ENTRY]; + log = &mdss_dbg_xlog.logs[mdss_dbg_xlog.curr]; log->time = ktime_to_us(ktime_get()); log->name = name; log->line = line; @@ -106,7 +118,7 @@ void mdss_xlog(const char *name, int line, int flag, ...) } va_end(args); log->data_cnt = i; - + mdss_dbg_xlog.curr = (mdss_dbg_xlog.curr + 1) % MDSS_XLOG_ENTRY; mdss_dbg_xlog.last++; spin_unlock_irqrestore(&xlock, flags); @@ -135,12 +147,11 @@ static bool __mdss_xlog_dump_calc_range(void) xlog->last += MDSS_XLOG_ENTRY; } - if ((xlog->last - xlog->first) > MDSS_XLOG_ENTRY) { + if ((xlog->last - xlog->first) > MDSS_XLOG_PRINT_ENTRY) { pr_warn("xlog buffer overflow before dump: %d\n", xlog->last - xlog->first); - xlog->first = xlog->last - MDSS_XLOG_ENTRY; + xlog->first = xlog->last - MDSS_XLOG_PRINT_ENTRY; } - need_dump = true; next = xlog->first + 1; dump_exit: @@ -696,6 +707,8 @@ static const struct file_operations mdss_xlog_fops = { int mdss_create_xlog_debug(struct mdss_debug_data *mdd) { + int i; + mdss_dbg_xlog.xlog = debugfs_create_dir("xlog", mdd->root); if (IS_ERR_OR_NULL(mdss_dbg_xlog.xlog)) { pr_err("debugfs_create_dir fail, error %ld\n", @@ -707,6 +720,9 @@ int mdss_create_xlog_debug(struct mdss_debug_data *mdd) INIT_WORK(&mdss_dbg_xlog.xlog_dump_work, xlog_debug_work); mdss_dbg_xlog.work_panic = false; + for (i = 0; i < MDSS_XLOG_ENTRY; i++) + mdss_dbg_xlog.logs[i].counter = i; + debugfs_create_file("dump", 0644, mdss_dbg_xlog.xlog, NULL, &mdss_xlog_fops); debugfs_create_u32("enable", 0644, mdss_dbg_xlog.xlog, |
