summaryrefslogtreecommitdiff
path: root/core/utils
diff options
context:
space:
mode:
authorRajeev Kumar <rajekuma@codeaurora.org>2016-09-12 14:49:54 -0700
committerqcabuildsw <qcabuildsw@localhost>2016-09-14 15:53:03 -0700
commit0fad1762fe0fce0ae920efac6c191d058267453d (patch)
tree692fb3120d57644b1e963169f5913c45564a17ef /core/utils
parentd198e81754bf940813e1ae9c99c4af5949f478c1 (diff)
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
Diffstat (limited to 'core/utils')
-rw-r--r--core/utils/logging/src/wlan_logging_sock_svc.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/core/utils/logging/src/wlan_logging_sock_svc.c b/core/utils/logging/src/wlan_logging_sock_svc.c
index 8afe7b5b1129..61cded5a3e5f 100644
--- a/core/utils/logging/src/wlan_logging_sock_svc.c
+++ b/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