diff options
| author | Evan Wilson <evan@oliodevices.com> | 2016-01-21 02:10:08 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit2@ip-172-31-25-77.us-west-1.compute.internal> | 2015-04-16 10:08:13 +0000 |
| commit | 7889f21e6e3df3d0962fdae0a81e7a43216c98ae (patch) | |
| tree | b9fc95731df8931a0dfefa7924f5bf4aaf7f304a | |
| parent | 7bdf9fd7e2337b3d75bfa1d1d7a5b1372d50fc04 (diff) | |
| parent | 76b2d51f406aebaac61329a7f0831ee69ea6d7a0 (diff) | |
| download | olio-linux-3.10-7889f21e6e3df3d0962fdae0a81e7a43216c98ae.tar.xz olio-linux-3.10-7889f21e6e3df3d0962fdae0a81e7a43216c98ae.zip | |
Merge "Patch to use local_clock for kernel messages" into android-3.10-bringup
| -rw-r--r-- | kernel/printk.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index bf785e0ce73..c247ad5df09 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -258,7 +258,17 @@ static u32 clear_idx; static char __log_buf[__LOG_BUF_LEN] __aligned(LOG_ALIGN); static char *log_buf = __log_buf; static u32 log_buf_len = __LOG_BUF_LEN; +static u64 print_clock(void) +{ + struct timespec ts; + u64 ts_nsec = local_clock(); + + ts = ns_to_timespec(ts_nsec); + monotonic_to_bootbased(&ts); + ts_nsec = timespec_to_ns(&ts); + return ts_nsec; +} /* cpu currently holding logbuf_lock */ static volatile unsigned int logbuf_cpu = UINT_MAX; @@ -358,7 +368,7 @@ static void log_store(int facility, int level, if (ts_nsec > 0) msg->ts_nsec = ts_nsec; else - msg->ts_nsec = local_clock(); + msg->ts_nsec = print_clock(); //local_clock(); memset(log_dict(msg) + dict_len, 0, pad_len); msg->len = sizeof(struct log) + text_len + dict_len + pad_len; @@ -1454,7 +1464,7 @@ static bool cont_add(int facility, int level, const char *text, size_t len) cont.facility = facility; cont.level = level; cont.owner = current; - cont.ts_nsec = local_clock(); + cont.ts_nsec = print_clock(); //local_clock(); cont.flags = 0; cont.cons = 0; cont.flushed = false; |