소스 검색

qcacmn: Add minidump support in QDF

Add QDF wrappers for minidump logging, which logs
memory locations to be collected as part of minidump.

Change-Id: I2c6b648d3fbb3aed9aaf7eb4872df5befcae971f
CRs-Fixed: 2444081
Karunakar Dasineni 6 년 전
부모
커밋
23d22c6d8a
2개의 변경된 파일29개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      qdf/inc/qdf_trace.h
  2. 17 0
      qdf/linux/src/i_qdf_trace.h

+ 12 - 0
qdf/inc/qdf_trace.h

@@ -1386,4 +1386,16 @@ void qdf_logging_exit(void);
  */
 int qdf_sprint_symbol(char *buffer, void *addr);
 
+/**
+ * qdf_minidump_log() - Log memory address to be included in minidump
+ * @start_addr: Start address of the memory to be dumped
+ * @size: Size in bytes
+ * @name: String to identify this entry
+ */
+static inline
+void qdf_minidump_log(void *start_addr, size_t size, const char *name)
+{
+	__qdf_minidump_log(start_addr, size, name);
+}
+
 #endif /* __QDF_TRACE_H */

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

@@ -29,6 +29,9 @@
 /* older kernels have a bug in kallsyms, so ensure module.h is included */
 #include <linux/module.h>
 #include <linux/kallsyms.h>
+#ifdef CONFIG_QCA_MINIDUMP
+#include <linux/minidump_tlv.h>
+#endif
 
 #if !defined(__printf)
 #define __printf(a, b)
@@ -337,4 +340,18 @@ static inline void __qdf_bug(void)
 #define __QDF_SYMBOL_LEN 1
 #endif
 
+#ifdef CONFIG_QCA_MINIDUMP
+static inline void
+__qdf_minidump_log(void *start_addr, size_t size, const char *name)
+{
+	if (fill_minidump_segments((uintptr_t)start_addr, size,
+	    QCA_WDT_LOG_DUMP_TYPE_WLAN_MOD, (char *)name) < 0)
+		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
+			"%s: failed to log %pK (%s)\n",
+			__func__, start_addr, name);
+}
+#else
+static inline void
+__qdf_minidump_log(void *start_addr, size_t size, const char *name) {}
+#endif
 #endif /* __I_QDF_TRACE_H */