Author: davidcs
Date: Wed Sep 17 22:49:29 2014
New Revision: 271728
URL: http://svnweb.freebsd.org/changeset/base/271728

Log:
  For ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() check bxe_debug flag 
before
  printing error message.
  
  MFC after:5 days

Modified:
  head/sys/dev/bxe/ecore_sp.h

Modified: head/sys/dev/bxe/ecore_sp.h
==============================================================================
--- head/sys/dev/bxe/ecore_sp.h Wed Sep 17 22:26:01 2014        (r271727)
+++ head/sys/dev/bxe/ecore_sp.h Wed Sep 17 22:49:29 2014        (r271728)
@@ -246,14 +246,23 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m
 
 #else
 
+extern unsigned long bxe_debug;
+
+#define BXE_DEBUG_ECORE_DBG_BREAK_IF   0x01
+#define BXE_DEBUG_ECORE_BUG            0x02
+#define BXE_DEBUG_ECORE_BUG_ON         0x04
+
 #define ECORE_DBG_BREAK_IF(exp)     \
-    printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+    if (bxe_debug & BXE_DEBUG_ECORE_DBG_BREAK_IF) \
+        printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
 
 #define ECORE_BUG(exp)     \
-    printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+    if (bxe_debug & BXE_DEBUG_ECORE_BUG) \
+        printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
 
 #define ECORE_BUG_ON(exp)     \
-    printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
+    if (bxe_debug & BXE_DEBUG_ECORE_BUG_ON) \
+        printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__);
 
 
 #endif /* #ifdef ECORE_STOP_ON_ERROR */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to