- if (assertion)
- fprintf(stderr,
- "%s:%d: %s: Warning: assertion `%s` failed, value %d\n",
- filename, line, func, assertion, val);
- else
- fprintf(stderr,
- "%s:%d: %s: Warning: assertion failed, value %d.\n",
- filename, line, func, val);
- if (trace)
- print_trace();
-}
-
-#define BUG() assert_trace(NULL, __FILE__, __func__, __LINE__, 0)
-#else
-#define BUG() assert(0)
+ fprintf(stderr,
+ "%s:%d: %s: BUG_ON `%s` triggered, value %ld\n",
+ filename, line, func, assertion, val);
+#ifndef BTRFS_DISABLE_BACKTRACE
+ print_trace();