@@ -43,6 +43,9 @@ enum {
RINGBUF_TYPE_TIME_STAMP = 31,
};
+/* Can be overridden */
+void tracecmd_debug(const char *fmt, ...);
+
void tracecmd_record_ref(struct tep_record *record);
void tracecmd_set_debug(bool set_debug);
@@ -31,17 +31,7 @@
typedef __u32 u32;
typedef __be32 be32;
-static inline void dprint(const char *fmt, ...)
-{
- va_list ap;
-
- if (!tracecmd_get_debug())
- return;
-
- va_start(ap, fmt);
- vprintf(fmt, ap);
- va_end(ap);
-}
+#define dprint(fmt, ...) tracecmd_debug(fmt, ##__VA_ARGS__)
/* Two (4k) pages is the max transfer for now */
#define MSG_MAX_LEN 8192
@@ -415,6 +415,18 @@ void __weak tracecmd_critical(const char *fmt, ...)
}
}
+void __weak tracecmd_debug(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (!tracecmd_get_debug())
+ return;
+
+ va_start(ap, fmt);
+ vprintf(fmt, ap);
+ va_end(ap);
+}
+
#define LOG_BUF_SIZE 1024
static void __plog(const char *prefix, const char *fmt, va_list ap, FILE *fp)
{