summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimanshu Agarwal <himanaga@codeaurora.org>2017-01-04 16:03:02 +0530
committerAshish kumar goswami <agoswa@codeaurora.org>2017-01-09 15:03:24 +0530
commit1ea1514c4e009ecc464ddc03f2e53612eeda6c7f (patch)
treeb373f11cd5339b0867a18a69f1a087458f55136d
parent8d1d5b6e40784f13daab6d64c287dab0fc9b1b40 (diff)
qcacld-2.0: Reduce log level of DPTRACE prints
DPT prints were flooding kmesg and causing watchdog bark in stress testing cases. Reduce log level to info and only include the prints in the driver log. Change-Id: If6ba6786cfe9ff050a21673002ef273a670c3f68 CRS-Fixed: 1089051
-rw-r--r--CORE/SERVICES/COMMON/adf/adf_trace.c38
-rw-r--r--CORE/VOSS/inc/vos_trace.h7
-rw-r--r--CORE/VOSS/src/vos_trace.c6
3 files changed, 31 insertions, 20 deletions
diff --git a/CORE/SERVICES/COMMON/adf/adf_trace.c b/CORE/SERVICES/COMMON/adf/adf_trace.c
index 66c780ff6d80..1779360b2c00 100644
--- a/CORE/SERVICES/COMMON/adf/adf_trace.c
+++ b/CORE/SERVICES/COMMON/adf/adf_trace.c
@@ -185,6 +185,9 @@ void adf_dp_trace_set_track(adf_nbuf_t nbuf, enum adf_proto_dir dir)
spin_unlock_bh(&l_dp_trace_lock);
}
+#define DPTRACE_PRINT(args...) \
+ VOS_TRACE(VOS_MODULE_ID_ADF, VOS_TRACE_LEVEL_INFO, ## args)
+
/**
* dump_hex_trace() - Display the data in buffer
* @str: string to print
@@ -195,13 +198,20 @@ void adf_dp_trace_set_track(adf_nbuf_t nbuf, enum adf_proto_dir dir)
*/
static void dump_hex_trace(char *str, uint8_t *buf, uint8_t buf_len)
{
- uint8_t i;
+ unsigned char linebuf[BUFFER_SIZE];
+ const u8 *ptr = buf;
+ int i, linelen, remaining = buf_len;
/* Dump the bytes in the last line */
- adf_os_print("%s: ", str);
- for (i = 0; i < buf_len; i++)
- adf_os_print("%02x ", buf[i]);
- adf_os_print("\n");
+ for (i = 0; i < buf_len; i += ROW_SIZE) {
+ linelen = min(remaining, ROW_SIZE);
+ remaining -= ROW_SIZE;
+
+ hex_dump_to_buffer(ptr + i, linelen, ROW_SIZE, 1,
+ linebuf, sizeof(linebuf), false);
+
+ DPTRACE_PRINT("DPT: %s: %s", str, linebuf);
+ }
}
/**
@@ -589,10 +599,10 @@ void adf_dp_display_proto_pkt(struct adf_dp_trace_record_s *record,
struct adf_dp_trace_proto_buf *buf =
(struct adf_dp_trace_proto_buf *)record->data;
- adf_os_print("DPT: %04d: %012llu: %s vdev_id %d\n", index,
+ DPTRACE_PRINT("DPT: %04d: %012llu: %s vdev_id %d\n", index,
record->time, adf_dp_code_to_string(record->code),
buf->vdev_id);
- adf_os_print("DPT: SA: " MAC_ADDRESS_STR " %s DA: " MAC_ADDRESS_STR
+ DPTRACE_PRINT("DPT: SA: " MAC_ADDRESS_STR " %s DA: " MAC_ADDRESS_STR
" Type %s Subtype %s\n",
MAC_ADDR_ARRAY(buf->sa.bytes), adf_dp_dir_to_str(buf->dir),
MAC_ADDR_ARRAY(buf->da.bytes), adf_dp_type_to_str(buf->type),
@@ -639,10 +649,10 @@ void adf_dp_display_mgmt_pkt(struct adf_dp_trace_record_s *record,
struct adf_dp_trace_mgmt_buf *buf =
(struct adf_dp_trace_mgmt_buf *)record->data;
- adf_os_print("DPT: %04d: %012llu: %s vdev_id %d", index,
+ DPTRACE_PRINT("DPT: %04d: %012llu: %s vdev_id %d", index,
record->time, adf_dp_code_to_string(record->code),
buf->vdev_id);
- adf_os_print("DPT: Type %s Subtype %s", adf_dp_type_to_str(buf->type),
+ DPTRACE_PRINT("DPT: Type %s Subtype %s", adf_dp_type_to_str(buf->type),
adf_dp_subtype_to_str(buf->subtype));
}
@@ -670,10 +680,10 @@ void adf_dp_display_event_record(struct adf_dp_trace_record_s *record,
struct adf_dp_trace_event_buf *buf =
(struct adf_dp_trace_event_buf *)record->data;
- adf_os_print("DPT: %04d: %012llu: %s vdev_id %d", index,
+ DPTRACE_PRINT("DPT: %04d: %012llu: %s vdev_id %d", index,
record->time, adf_dp_code_to_string(record->code),
buf->vdev_id);
- adf_os_print("DPT: Type %s Subtype %s", adf_dp_type_to_str(buf->type),
+ DPTRACE_PRINT("DPT: Type %s Subtype %s", adf_dp_type_to_str(buf->type),
adf_dp_subtype_to_str(buf->subtype));
}
@@ -709,11 +719,11 @@ void adf_dp_display_ptr_record(struct adf_dp_trace_record_s *record,
(struct adf_dp_trace_ptr_buf *)record->data;
if (record->code == ADF_DP_TRACE_FREE_PACKET_PTR_RECORD)
- adf_os_print("%04d: %012llu: %s msdu_id: %d, status: %d\n", index,
+ DPTRACE_PRINT("DPT: %04d: %012llu: %s msdu_id: %d, status: %d\n", index,
record->time, adf_dp_code_to_string(record->code),
buf->msdu_id, buf->status);
else
- adf_os_print("%04d: %012llu: %s msdu_id: %d, vdev_id: %d\n", index,
+ DPTRACE_PRINT("DPT: %04d: %012llu: %s msdu_id: %d, vdev_id: %d\n", index,
record->time, adf_dp_code_to_string(record->code),
buf->msdu_id, buf->status);
@@ -763,7 +773,7 @@ void adf_dp_display_record(struct adf_dp_trace_record_s *pRecord,
if (rsize > ADF_DP_TRACE_RECORD_SIZE)
rsize = ADF_DP_TRACE_RECORD_SIZE;
- adf_os_print("DPT: %04d: %012llu: %s\n", recIndex,
+ DPTRACE_PRINT("DPT: %04d: %012llu: %s\n", recIndex,
pRecord->time, adf_dp_code_to_string(pRecord->code));
switch (pRecord->code) {
case ADF_DP_TRACE_HDD_TX_TIMEOUT:
diff --git a/CORE/VOSS/inc/vos_trace.h b/CORE/VOSS/inc/vos_trace.h
index 4461cd31eea2..f5bc981749e8 100644
--- a/CORE/VOSS/inc/vos_trace.h
+++ b/CORE/VOSS/inc/vos_trace.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2014, 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2014, 2016-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -111,6 +111,11 @@ typedef enum
#endif
+#define ROW_SIZE 16
+/* Buffer size = data bytes(2 hex chars plus space) + NULL */
+#define BUFFER_SIZE ((ROW_SIZE * 3) + 1)
+
+
/*--------------------------------------------------------------------------
Structure definition
------------------------------------------------------------------------*/
diff --git a/CORE/VOSS/src/vos_trace.c b/CORE/VOSS/src/vos_trace.c
index 11911d9577c0..b25ef46a6d2f 100644
--- a/CORE/VOSS/src/vos_trace.c
+++ b/CORE/VOSS/src/vos_trace.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2014, 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2014, 2016-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -335,10 +335,6 @@ void vos_trace_display(void)
}
}
-#define ROW_SIZE 16
-/* Buffer size = data bytes(2 hex chars plus space) + NULL */
-#define BUFFER_SIZE ((ROW_SIZE * 3) + 1)
-
/*----------------------------------------------------------------------------
\brief vos_trace_hex_dump() - Externally called hex dump function