diff options
| author | Kapil Gupta <kapgupta@codeaurora.org> | 2016-08-22 21:20:43 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-08-23 12:38:07 +0530 |
| commit | 0abff79cda9c254ff7ab7e5419df6fe828090d7d (patch) | |
| tree | 9b2c40a2daebdce820c2aca2eb2b90445214e6ee | |
| parent | 3dbb68b6ee2c5b9f01336a317cc4801e56e104eb (diff) | |
qcacld-2.0: Optimize proto trace buff dumping
Add changes to optimize proto trace buffer dump.
Following are added as part of this:
1. Corrected condition to print proto trace buffer
2. Do not print slots which are already printed once
Change-Id: I550e13b88f14094cf91484d66eb16667b823df3f
CRs-Fixed: 1053314
| -rw-r--r-- | CORE/VOSS/src/vos_api.c | 4 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_packet.c | 16 |
2 files changed, 12 insertions, 8 deletions
diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c index ae5cb31d6688..037bc755fbd6 100644 --- a/CORE/VOSS/src/vos_api.c +++ b/CORE/VOSS/src/vos_api.c @@ -2947,11 +2947,11 @@ VOS_STATUS vos_flush_logs(uint32_t is_fatal, "%s: Triggering bug report: type:%d, indicator=%d reason_code=%d dump_trace=0x%x", __func__, is_fatal, indicator, reason_code, dump_trace); - if (dump_trace | DUMP_VOS_TRACE) + if (dump_trace & DUMP_VOS_TRACE) vosTraceDumpAll(vos_context->pMACContext, 0, 0, 500, 0); #ifdef QCA_PKT_PROTO_TRACE - if (dump_trace | DUMP_PACKET_TRACE) + if (dump_trace & DUMP_PACKET_TRACE) vos_pkt_trace_buf_dump(); #endif if (WLAN_LOG_INDICATOR_HOST_ONLY == indicator) { diff --git a/CORE/VOSS/src/vos_packet.c b/CORE/VOSS/src/vos_packet.c index 1795ecbfb8e1..9cdcc44dc55e 100644 --- a/CORE/VOSS/src/vos_packet.c +++ b/CORE/VOSS/src/vos_packet.c @@ -73,6 +73,7 @@ typedef struct vos_pkt_proto_trace_t *trace_buffer = NULL; unsigned int trace_buffer_order = 0; +unsigned int trace_dump_order = 0; spinlock_t trace_buffer_lock; #endif /* QCA_PKT_PROTO_TRACE */ @@ -337,12 +338,12 @@ void vos_pkt_trace_buf_update } /** - * vos_pkt_trace_buf_dump_1() - Helper function to dump pkt trace + * vos_pkt_trace_dump_slot_buf() - Helper function to dump pkt trace * @slot: index * * Return: none */ -void vos_pkt_trace_buf_dump_1(int slot) +void vos_pkt_trace_dump_slot_buf(int slot) { struct rtc_time tm; unsigned long local_time; @@ -383,20 +384,23 @@ void vos_pkt_trace_buf_dump(void) * Scenario: Number of trace records less than MAX, * Circular buffer not overwritten. */ - for (slot = latest_idx - 1; slot >= 0; slot--) - vos_pkt_trace_buf_dump_1(slot); + for (slot = latest_idx - 1; slot >= 0 && + slot > trace_dump_order; slot--) + vos_pkt_trace_dump_slot_buf(slot); } else { /* * Scenario: Number of trace records exceeded MAX, * Circular buffer is overwritten. */ - for (i = 0; i < VOS_PKT_TRAC_MAX_TRACE_BUF; i++) { + for (i = 0; (i < VOS_PKT_TRAC_MAX_TRACE_BUF) && + (latest_idx - i - 1 > trace_dump_order); i++) { slot = ((latest_idx - i - 1) % VOS_PKT_TRAC_MAX_TRACE_BUF); - vos_pkt_trace_buf_dump_1(slot); + vos_pkt_trace_dump_slot_buf(slot); } } + trace_dump_order = latest_idx - 1; VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "PACKET TRACE DUMP END"); |
