Browse Source

qcacld-3.0: Do not log current->comm from hw/sw irq context

Interrupt handlers do not have valid process context and hence
current pointer is not valid for software/hardware interrupt
handlers. In WLAN log to user space API current process name is
logged using current->comm but hardware/software interrupts do not
have corresponding current pointer because they use current pointer
of interrupted process. Make changes to not to log process name when
log message is generated from hardware/software interrupt handlers.

Change-Id: I42420c501f9e7161112c5210909f83755ba4813e
CRs-Fixed: 1065898
Rajeev Kumar 8 năm trước cách đây
mục cha
commit
0fad1762fe
1 tập tin đã thay đổi với 14 bổ sung3 xóa
  1. 14 3
      core/utils/logging/src/wlan_logging_sock_svc.c

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

@@ -258,14 +258,19 @@ static int wlan_queue_logmsg_for_app(void)
  *
  * For discrete solution e.g rome use system tick and convert it into
  * seconds.milli seconds
+ *
+ * Return: number of characters written in target buffer not including
+ *		trailing '/0'
  */
 static int wlan_add_user_log_radio_time_stamp(char *tbuf, size_t tbuf_sz,
 					      uint64_t ts, int radio)
 {
 	int tlen;
 
-	tlen = scnprintf(tbuf, tbuf_sz, "R%d: [%s][%llu] ",
-			 radio, current->comm, ts);
+	tlen = scnprintf(tbuf, tbuf_sz, "R%d: [%s][%llu] ", radio,
+			((in_irq() ? "irq" : in_softirq() ?  "soft_irq" :
+			current->comm)),
+			ts);
 	return tlen;
 }
 #else
@@ -281,6 +286,9 @@ static int wlan_add_user_log_radio_time_stamp(char *tbuf, size_t tbuf_sz,
  *
  * For discrete solution e.g rome use system tick and convert it into
  * seconds.milli seconds
+ *
+ * Return: number of characters written in target buffer not including
+ *		trailing '/0'
  */
 static int wlan_add_user_log_radio_time_stamp(char *tbuf, size_t tbuf_sz,
 					      uint64_t ts, int radio)
@@ -290,7 +298,10 @@ static int wlan_add_user_log_radio_time_stamp(char *tbuf, size_t tbuf_sz,
 
 	rem = do_div(ts, QDF_MC_TIMER_TO_SEC_UNIT);
 	tlen = scnprintf(tbuf, tbuf_sz, "R%d: [%s][%lu.%06lu] ", radio,
-			 current->comm, (unsigned long) ts, (unsigned long)rem);
+			((in_irq() ? "irq" : in_softirq() ?  "soft_irq" :
+			current->comm)),
+			(unsigned long) ts,
+			(unsigned long)rem);
 	return tlen;
 }
 #endif