Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | 26cd647 | 2014-02-11 23:30:06 -0800 | [diff] [blame^] | 2 | * Copyright (c) 2012-2013 Qualcomm Atheros, Inc. |
| 3 | * All Rights Reserved. |
| 4 | * Qualcomm Atheros Confidential and Proprietary. |
| 5 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6 | #if !defined( __WLAN_QCT_OS_TRACE_H ) |
| 7 | #define __WLAN_QCT_OS_TRACE_H |
| 8 | |
Madan Mohan Koyyalamudi | 6ed07b7 | 2013-08-20 19:15:47 +0530 | [diff] [blame] | 9 | #include <vos_trace.h> |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 10 | |
Jeff Johnson | 48a8f3e | 2013-11-11 12:10:25 -0800 | [diff] [blame] | 11 | #if !defined(__printf) |
| 12 | #define __printf(a,b) |
| 13 | #endif |
| 14 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 15 | #ifdef WLAN_DEBUG |
| 16 | |
| 17 | /**---------------------------------------------------------------------------- |
| 18 | |
| 19 | \brief WPAL_TRACE() / wpalTrace() - Trace / logging API |
| 20 | |
| 21 | Users wishing to add tracing information to their code should use |
| 22 | WPAL_TRACE. WPAL_TRACE() will compile into a call to wpalTrace() when |
| 23 | tracing is enabled. |
| 24 | |
| 25 | \param module - module identifier. A member of the wpt_moduleid |
| 26 | enumeration that identifies the module issuing the trace message. |
| 27 | |
| 28 | \param level - trace level. A member of the wpt_tracelevel |
| 29 | enumeration indicating the severity of the condition causing the |
| 30 | trace message to be issued. More severe conditions are more |
| 31 | likely to be logged. |
| 32 | |
| 33 | \param strFormat - format string. The message to be logged. This format |
| 34 | string contains printf-like replacement parameters, which follow |
| 35 | this parameter in the variable argument list. |
| 36 | |
| 37 | \return nothing |
| 38 | |
| 39 | --------------------------------------------------------------------------*/ |
Jeff Johnson | 48a8f3e | 2013-11-11 12:10:25 -0800 | [diff] [blame] | 40 | void __printf(3,4) wpalTrace( wpt_moduleid module, wpt_tracelevel level, |
| 41 | char *strFormat, ... ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 42 | |
| 43 | /**---------------------------------------------------------------------------- |
| 44 | |
| 45 | \brief WPAL_DUMP() / wpalDump() - Trace / logging API |
| 46 | |
| 47 | Users wishing to add tracing memory dumps to their code should use |
| 48 | WPAL_DUMP. WPAL_DUMP() will compile into a call to wpalDump() when |
| 49 | tracing is enabled. |
| 50 | |
| 51 | \param module - module identifier. A member of the wpt_moduleid |
| 52 | enumeration that identifies the module performing the dump |
| 53 | |
| 54 | \param level - trace level. A member of the wpt_tracelevel |
| 55 | enumeration indicating the severity of the condition causing the |
| 56 | memory to be dumped. More severe conditions are more |
| 57 | likely to be logged. |
| 58 | |
| 59 | \param pMemory - memory. A pointer to the memory to be dumped |
| 60 | |
| 61 | \param length - length. How many bytes of memory to be dumped |
| 62 | |
| 63 | \return nothing |
| 64 | |
| 65 | --------------------------------------------------------------------------*/ |
| 66 | void wpalDump( wpt_moduleid module, wpt_tracelevel level, |
| 67 | wpt_uint8 *memory, wpt_uint32 length); |
| 68 | |
Madan Mohan Koyyalamudi | a53c4dc | 2012-11-13 10:35:42 -0800 | [diff] [blame] | 69 | #define WPAL_ASSERT( _condition ) do { \ |
| 70 | if ( ! ( _condition ) ) \ |
| 71 | { \ |
| 72 | printk(KERN_CRIT "VOS ASSERT in %s Line %d\n", __func__, __LINE__); \ |
| 73 | WARN_ON(1); \ |
| 74 | } \ |
| 75 | } while (0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 76 | #else //WLAN_DEBUG |
| 77 | |
Gopichand Nakkala | 9846ac4 | 2013-06-20 19:03:52 +0530 | [diff] [blame] | 78 | static inline void wpalTrace( wpt_moduleid module, wpt_tracelevel level, |
| 79 | char *strFormat, ... ){}; |
| 80 | static inline void wpalDump( wpt_moduleid module, wpt_tracelevel level, |
| 81 | wpt_uint8 *memory, wpt_uint32 length) {}; |
| 82 | static inline void wpalTraceSetLevel( wpt_moduleid module, |
| 83 | wpt_tracelevel level, wpt_boolean on ) {}; |
| 84 | static inline void wpalTraceDisplay(void) {}; |
| 85 | #define WPAL_ASSERT(x) do {} while (0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 86 | |
| 87 | #endif //WLAN_DEBUG |
| 88 | |
Gopichand Nakkala | 9846ac4 | 2013-06-20 19:03:52 +0530 | [diff] [blame] | 89 | #define WPAL_TRACE wpalTrace |
| 90 | #define WPAL_DUMP wpalDump |
| 91 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 92 | #endif // __WLAN_QCT_OS_TRACE_H |