qcacmn: Add support to invoke debug function before assert
qdf assert always, assert without debug information. Added support to dump needed information before assert. Change-Id: I19898ec11c1bade4340cf1737a760d9507012f12 CRs-Fixed: 3480596
This commit is contained in:

committed by
Madan Koyyalamudi

vanhempi
98787f1dc0
commit
fffa314bff
@@ -91,6 +91,14 @@ typedef __qdf_wait_queue_head_t qdf_wait_queue_head_t;
|
||||
*/
|
||||
#define qdf_assert_always(expr) __qdf_assert(expr)
|
||||
|
||||
/**
|
||||
* qdf_assert_with_debug - invoke function to dump needed info before assert
|
||||
* @expr: expression to test
|
||||
* @debug_fp: function pointer to be invoked for debugging
|
||||
*/
|
||||
#define qdf_assert_with_debug(expr, debug_fp, ...) \
|
||||
__qdf_assert_with_debug(expr, debug_fp, ...)
|
||||
|
||||
/**
|
||||
* qdf_target_assert_always - always target assert "expr" evaluates to false.
|
||||
* @expr: expression to test
|
||||
|
@@ -212,6 +212,18 @@ static inline bool __qdf_is_macaddr_equal(const struct qdf_mac_addr *mac_addr1,
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define __qdf_assert_with_debug(expr, debug_fp, ...) \
|
||||
do { \
|
||||
typeof(debug_fp) _debug_fp = debug_fp; \
|
||||
if (unlikely(!(expr))) { \
|
||||
pr_err("Assertion failed! %s:%s %s:%d\n", \
|
||||
# expr, __func__, __FILE__, __LINE__); \
|
||||
if (_debug_fp) \
|
||||
_debug_fp(__VA_ARGS__); \
|
||||
QDF_BUG_ON_ASSERT(0); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define __qdf_target_assert(expr) do { \
|
||||
if (unlikely(!(expr))) { \
|
||||
qdf_err("Assertion failed! %s:%s %s:%d", \
|
||||
|
Viittaa uudesa ongelmassa
Block a user