Browse Source

qcacld-3.0: Add hr:min:sec:usec timeformat along with QTIMER

Driver logs prints QTIMER ticks and it's difficult to co-relate with
logcat timestamp.

Add logcat timestamp so that driver and logcat logs can be co-related.

Change-Id: If770d4a9b48301adc3deb8f4c1d16099dfa8dd8d
CRs-Fixed: 1095195
Prakash Dhavali 8 years ago
parent
commit
2f02ea1541
1 changed files with 9 additions and 3 deletions
  1. 9 3
      core/utils/logging/src/wlan_logging_sock_svc.c

+ 9 - 3
core/utils/logging/src/wlan_logging_sock_svc.c

@@ -313,7 +313,8 @@ static int wlan_queue_logmsg_for_app(void)
 
 #ifdef QCA_WIFI_3_0_ADRASTEA
 /**
- * wlan_add_user_log_radio_time_stamp() - add radio and time stamp in log buffer
+ * wlan_add_user_log_radio_time_stamp() - add radio, firmware timestamp and
+ * time stamp in log buffer
  * @tbuf: Pointer to time stamp buffer
  * @tbuf_sz: Time buffer size
  * @ts: Time stamp value
@@ -323,6 +324,8 @@ static int wlan_queue_logmsg_for_app(void)
  * to convert it into user visible time stamp. In adrstea FW also uses QTIMER
  * raw ticks which is needed to synchronize host and fw log time stamps
  *
+ * Also add logcat timestamp so that driver logs and
+ * logcat logs can be co-related
  *
  * For discrete solution e.g rome use system tick and convert it into
  * seconds.milli seconds
@@ -334,11 +337,14 @@ static int wlan_add_user_log_radio_time_stamp(char *tbuf, size_t tbuf_sz,
 					      uint64_t ts, int radio)
 {
 	int tlen;
+	char time_buf[20];
+
+	qdf_get_time_of_the_day_in_hr_min_sec_usec(time_buf, sizeof(time_buf));
 
-	tlen = scnprintf(tbuf, tbuf_sz, "R%d: [%s][%llu] ", radio,
+	tlen = scnprintf(tbuf, tbuf_sz, "R%d: [%.6s][%llu] %s ", radio,
 			((in_irq() ? "irq" : in_softirq() ?  "soft_irq" :
 			current->comm)),
-			ts);
+			ts, time_buf);
 	return tlen;
 }
 #else