Bläddra i källkod

qcacmn: Add nbuf history to SSR dump

Add nbuf history to SSR dump

Change-Id: I3a4b14ccf0c10007107b9a802b29a89fa7ac36fa
CRs-Fixed: 3604907
Amit Mehta 1 år sedan
förälder
incheckning
4d62f37743
2 ändrade filer med 43 tillägg och 0 borttagningar
  1. 26 0
      qdf/inc/qdf_nbuf.h
  2. 17 0
      qdf/linux/src/qdf_nbuf.c

+ 26 - 0
qdf/inc/qdf_nbuf.h

@@ -2441,8 +2441,34 @@ qdf_nbuf_t
 qdf_nbuf_page_frag_alloc_debug(qdf_device_t osdev, qdf_size_t size, int reserve,
 qdf_nbuf_page_frag_alloc_debug(qdf_device_t osdev, qdf_size_t size, int reserve,
 			       int align, qdf_frag_cache_t *pf_cache,
 			       int align, qdf_frag_cache_t *pf_cache,
 			       const char *func, uint32_t line);
 			       const char *func, uint32_t line);
+
+/**
+ * qdf_nbuf_ssr_register_region() - Register nbuf history with SSR dump
+ *
+ * Return: None
+ */
+void qdf_nbuf_ssr_register_region(void);
+
+/**
+ * qdf_nbuf_ssr_unregister_region() - Unregister nbuf history with SSR dump
+ *
+ * Return: None
+ */
+
+void qdf_nbuf_ssr_unregister_region(void);
+
 #else /* NBUF_MEMORY_DEBUG */
 #else /* NBUF_MEMORY_DEBUG */
 
 
+static inline
+void qdf_nbuf_ssr_register_region(void)
+{
+}
+
+static inline
+void qdf_nbuf_ssr_unregister_region(void)
+{
+}
+
 static inline void qdf_net_buf_debug_init(void) {}
 static inline void qdf_net_buf_debug_init(void) {}
 static inline void qdf_net_buf_debug_exit(void) {}
 static inline void qdf_net_buf_debug_exit(void) {}
 
 

+ 17 - 0
qdf/linux/src/qdf_nbuf.c

@@ -56,6 +56,7 @@
 #ifdef IPA_OFFLOAD
 #ifdef IPA_OFFLOAD
 #include <i_qdf_ipa_wdi3.h>
 #include <i_qdf_ipa_wdi3.h>
 #endif /* IPA_OFFLOAD */
 #endif /* IPA_OFFLOAD */
+#include "qdf_ssr_driver_dump.h"
 
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0)
 
 
@@ -828,6 +829,22 @@ struct qdf_nbuf_event {
 static qdf_atomic_t qdf_nbuf_history_index;
 static qdf_atomic_t qdf_nbuf_history_index;
 static struct qdf_nbuf_event qdf_nbuf_history[QDF_NBUF_HISTORY_SIZE];
 static struct qdf_nbuf_event qdf_nbuf_history[QDF_NBUF_HISTORY_SIZE];
 
 
+void qdf_nbuf_ssr_register_region(void)
+{
+	qdf_ssr_driver_dump_register_region("qdf_nbuf_history",
+					    qdf_nbuf_history,
+					    sizeof(qdf_nbuf_history));
+}
+
+qdf_export_symbol(qdf_nbuf_ssr_register_region);
+
+void qdf_nbuf_ssr_unregister_region(void)
+{
+	qdf_ssr_driver_dump_unregister_region("qdf_nbuf_history");
+}
+
+qdf_export_symbol(qdf_nbuf_ssr_unregister_region);
+
 static int32_t qdf_nbuf_circular_index_next(qdf_atomic_t *index, int size)
 static int32_t qdf_nbuf_circular_index_next(qdf_atomic_t *index, int size)
 {
 {
 	int32_t next = qdf_atomic_inc_return(index);
 	int32_t next = qdf_atomic_inc_return(index);