summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMahesh A Saptasagar <c_msapta@qti.qualcomm.com>2015-11-25 20:05:28 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-01-12 13:20:18 +0530
commit7c809474277dd0424ea90a4b1c0c4ffed2103bfd (patch)
treef9efcc165f4e2dc1cf40233a764029903b8d9b2b
parent9d04cd95127f54073f1f909a99b3d1af03f6527c (diff)
qcacld-2.0: modify the timestamp format for the logs
prima to qcacld-2.0 propagation Modify the timestamp format for the logs from [Secondselapsedinaday.microseconds] to [hour:min:sec.msec]. This will help in correlating the logcat logs and the Logging infra logs. Change-Id: Ib0f72bc0e48c1f2e02816da24fca4fb10e7b26fe CRs-Fixed: 771157
-rw-r--r--CORE/SVC/src/logging/wlan_logging_sock_svc.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/CORE/SVC/src/logging/wlan_logging_sock_svc.c b/CORE/SVC/src/logging/wlan_logging_sock_svc.c
index 2c01af76a508..81ee5a882c61 100644
--- a/CORE/SVC/src/logging/wlan_logging_sock_svc.c
+++ b/CORE/SVC/src/logging/wlan_logging_sock_svc.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -42,7 +42,7 @@
#include <kthread.h>
#include <adf_os_time.h>
#include "pktlog_ac.h"
-
+#include <linux/rtc.h>
#define LOGGING_TRACE(level, args...) \
VOS_TRACE(VOS_MODULE_ID_HDD, level, ## args)
@@ -273,8 +273,9 @@ int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length)
unsigned int *pfilled_length;
bool wake_up_thread = false;
unsigned long flags;
- uint64_t ts;
- uint32_t rem;
+ struct timeval tv;
+ struct rtc_time tm;
+ unsigned long local_time;
if (!vos_is_multicast_logging()) {
/*
@@ -288,12 +289,15 @@ int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length)
pr_info("%s\n", to_be_sent);
} else {
- /* Format the Log time [Seconds.microseconds] */
- ts = adf_get_boottime();
- rem = do_div(ts, VOS_TIMER_TO_SEC_UNIT);
- tlen = snprintf(tbuf, sizeof(tbuf), "[%s][%lu.%06lu] ",
- current->comm,
- (unsigned long) ts, (unsigned long)rem);
+ /* Format the Log time [hr:min:sec.microsec] */
+ do_gettimeofday(&tv);
+ /* Convert rtc to local time */
+ local_time = (u32)(tv.tv_sec - (sys_tz.tz_minuteswest * 60));
+ rtc_time_to_tm(local_time, &tm);
+ tlen = snprintf(tbuf, sizeof(tbuf),
+ "[%s][%02d:%02d:%02d.%06lu] ",
+ current->comm, tm.tm_hour, tm.tm_min, tm.tm_sec,
+ tv.tv_usec);
/* 1+1 indicate '\n'+'\0' */
total_log_len = length + tlen + 1 + 1;