LASSERT() declares a msgdata which can be passed to lbug_with_loc()
instead of calling LBUG() thereby saving /millions/ of bytes. Also
remove unused libcfs_assertion_failed().
Signed-off-by: John L. Hammond <jhammond@tacc.utexas.edu>
Change-Id: Iac267c7804b5e18f687f47b2eea585c655e7bb21
Reviewed-on: http://review.whamcloud.com/4844
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
*
* requires -Wall. Unfortunately this rules out use of likely/unlikely.
*/
*
* requires -Wall. Unfortunately this rules out use of likely/unlikely.
*/
-#define LASSERTF(cond, fmt, ...) \
-do { \
- if (cond) \
- ; \
- else { \
- LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_EMERG, NULL); \
- libcfs_debug_msg(&msgdata, \
- "ASSERTION( %s ) failed: " fmt, #cond, \
- ## __VA_ARGS__); \
- LBUG(); \
- } \
-} while(0)
+#define LASSERTF(cond, fmt, ...) \
+do { \
+ if (cond) \
+ ; \
+ else { \
+ LIBCFS_DEBUG_MSG_DATA_DECL(__msg_data, D_EMERG, NULL); \
+ libcfs_debug_msg(&__msg_data, \
+ "ASSERTION( %s ) failed: " fmt, #cond, \
+ ## __VA_ARGS__); \
+ lbug_with_loc(&__msg_data); \
+ } \
+} while (0)
#define LASSERT(cond) LASSERTF(cond, "\n")
#else /* !LASSERT_CHECKED */
#define LASSERT(cond) LASSERTF(cond, "\n")
#else /* !LASSERT_CHECKED */
-#define LASSERTF(cond, fmt, ...) \
-do { \
- if (unlikely(!(cond))) { \
- LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_EMERG, NULL); \
- libcfs_debug_msg(&msgdata, \
- "ASSERTION( %s ) failed: " fmt, #cond, \
- ## __VA_ARGS__ ); \
- LBUG(); \
- } \
-} while(0)
+#define LASSERTF(cond, fmt, ...) \
+do { \
+ if (unlikely(!(cond))) { \
+ LIBCFS_DEBUG_MSG_DATA_DECL(__msg_data, D_EMERG, NULL); \
+ libcfs_debug_msg(&__msg_data, \
+ "ASSERTION( %s ) failed: " fmt, #cond, \
+ ## __VA_ARGS__); \
+ lbug_with_loc(&__msg_data); \
+ } \
+} while (0)
#define LASSERT(cond) LASSERTF(cond, "\n")
#endif /* !LASSERT_CHECKED */
#define LASSERT(cond) LASSERTF(cond, "\n")
#endif /* !LASSERT_CHECKED */
-void
-libcfs_assertion_failed(const char *expr, struct libcfs_debug_msg_data *msgdata)
-{
- libcfs_debug_msg(msgdata, "ASSERTION(%s) failed\n", expr);
- abort();
-}
-
/*
* a helper function for RETURN(): the sole purpose is to save 8-16 bytes
* on the stack - function calling RETURN() doesn't need to allocate two
/*
* a helper function for RETURN(): the sole purpose is to save 8-16 bytes
* on the stack - function calling RETURN() doesn't need to allocate two
EXPORT_SYMBOL(libcfs_debug_vmsg2);
void
EXPORT_SYMBOL(libcfs_debug_vmsg2);
void
-libcfs_assertion_failed(const char *expr, struct libcfs_debug_msg_data *msgdata)
-{
- libcfs_debug_msg(msgdata, "ASSERTION(%s) failed\n", expr);
- /* cfs_enter_debugger(); */
- lbug_with_loc(msgdata);
-}
-EXPORT_SYMBOL(libcfs_assertion_failed);
-
-void
cfs_trace_assertion_failed(const char *str,
struct libcfs_debug_msg_data *msgdata)
{
cfs_trace_assertion_failed(const char *str,
struct libcfs_debug_msg_data *msgdata)
{