Browse Source

qcacmn: Add QDF rate limit logging API

Add QDF rate limit logging API such that logs are rate limited
on need basis.

Change-Id: I40949155a1938998bc73830929db5c2a07bc380d
CRs-Fixed: 2083921
Rajeev Kumar 7 years ago
parent
commit
7f679457e1
1 changed files with 10 additions and 0 deletions
  1. 10 0
      qdf/linux/src/i_qdf_trace.h

+ 10 - 0
qdf/linux/src/i_qdf_trace.h

@@ -57,9 +57,19 @@
 #if defined(WLAN_DEBUG) || defined(DEBUG)
 #define QDF_TRACE qdf_trace_msg
 #define QDF_TRACE_HEX_DUMP qdf_trace_hex_dump
+#define QDF_TRACE_RATE_LIMITED(rate, module, level, format, ...)\
+	do {\
+		static int rate_limit;\
+		rate_limit++;\
+		if (rate)\
+			if (0 == (rate_limit % rate))\
+				qdf_trace_msg(module, level, format,\
+						##__VA_ARGS__);\
+	} while (0)
 #else
 #define QDF_TRACE(arg ...)
 #define QDF_TRACE_HEX_DUMP(arg ...)
+#define QDF_TRACE_RATE_LIMITED(arg ...)
 #endif
 #else /* CONFIG_MCL */