summaryrefslogtreecommitdiff
path: root/kernel/trace
diff options
context:
space:
mode:
authorVignesh Radhakrishnan <vigneshr@codeaurora.org>2014-09-04 10:28:14 +0530
committerRohit Vaswani <rvaswani@codeaurora.org>2016-03-01 12:22:25 -0800
commit7cc3dac3536dfdc93b965a15ac737667ac236bbf (patch)
tree181b793a9423f5293581f75d53e1c1a6672ab393 /kernel/trace
parent6a0fccbd29ff07dca1a25d5ff1ee15be0e221bd2 (diff)
msm: rtb: Add timestamp to rtb logging
RTB logging currently doesn't log the time at which the logging was done. This can be useful to compare with dmesg during debug. The bytes for timestamp are taken by reducing the sentinel array size to three from eleven thus giving the extra 8 bytes to store time. This maintains the size of the layout at 32. Change-Id: Ifc7e4d2e89ed14d2a97467891ebefa9515983630 Signed-off-by: Vignesh Radhakrishnan <vigneshr@codeaurora.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/msm_rtb.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/kernel/trace/msm_rtb.c b/kernel/trace/msm_rtb.c
index 2bbb909a20d5..6b87df023640 100644
--- a/kernel/trace/msm_rtb.c
+++ b/kernel/trace/msm_rtb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -35,20 +35,22 @@
#define RTB_COMPAT_STR "qcom,msm-rtb"
/* Write
- * 1) 11 bytes sentinel
+ * 1) 3 bytes sentinel
* 2) 1 bytes of log type
* 3) 8 bytes of where the caller came from
* 4) 4 bytes index
* 4) 8 bytes extra data from the caller
+ * 5) 8 bytes of timestamp
*
* Total = 32 bytes.
*/
struct msm_rtb_layout {
- unsigned char sentinel[11];
+ unsigned char sentinel[3];
unsigned char log_type;
uint32_t idx;
uint64_t caller;
uint64_t data;
+ uint64_t timestamp;
} __attribute__ ((__packed__));
@@ -124,6 +126,11 @@ static void msm_rtb_write_data(uint64_t data, struct msm_rtb_layout *start)
start->data = data;
}
+static void msm_rtb_write_timestamp(struct msm_rtb_layout *start)
+{
+ start->timestamp = sched_clock();
+}
+
static void uncached_logk_pc_idx(enum logk_event_type log_type, uint64_t caller,
uint64_t data, int idx)
{
@@ -136,6 +143,7 @@ static void uncached_logk_pc_idx(enum logk_event_type log_type, uint64_t caller,
msm_rtb_write_caller(caller, start);
msm_rtb_write_idx(idx, start);
msm_rtb_write_data(data, start);
+ msm_rtb_write_timestamp(start);
mb();
return;