fprintf(stderr, "Tracing... ");
for (i = 0; i < 5; i++) {
- tracef("This is a \"%s\" formatted %d event %lx",
+ lttng_ust_tracef("This is a \"%s\" formatted %d event %lx",
str, i, l);
}
fprintf(stderr, " done.\n");
va_list ap;
va_start(ap, msg);
- vtracef(msg, ap);
+ lttng_ust_vtracef(msg, ap);
va_end(ap);
}
#ifndef _LTTNG_UST_TRACEF_H
#define _LTTNG_UST_TRACEF_H
+#include <lttng/ust-api-compat.h>
#include <lttng/tp/lttng-ust-tracef.h>
#ifdef __cplusplus
#endif
extern
-void _lttng_ust_tracef(const char *fmt, ...)
+void lttng_ust__tracef(const char *fmt, ...)
__attribute__((format(printf, 1, 2)));
extern
-void _lttng_ust_vtracef(const char *fmt, va_list ap)
+void lttng_ust__vtracef(const char *fmt, va_list ap)
__attribute__((format(printf, 1, 0)));
-#define tracef(fmt, ...) \
+#define lttng_ust_tracef(fmt, ...) \
do { \
LTTNG_UST_STAP_PROBEV(tracepoint_lttng_ust_tracef, event, ## __VA_ARGS__); \
if (caa_unlikely(lttng_ust_tracepoint_lttng_ust_tracef___event.state)) \
- _lttng_ust_tracef(fmt, ## __VA_ARGS__); \
+ lttng_ust__tracef(fmt, ## __VA_ARGS__); \
} while (0)
-#define vtracef(fmt, ap) \
+#define lttng_ust_vtracef(fmt, ap) \
do { \
if (caa_unlikely(lttng_ust_tracepoint_lttng_ust_tracef___event.state)) \
- _lttng_ust_vtracef(fmt, ap); \
+ lttng_ust__vtracef(fmt, ap); \
} while (0)
+
+#if LTTNG_UST_COMPAT_API(0)
+#define tracef lttng_ust_tracef
+#define vtracef lttng_ust_vtracef
+#endif
+
#ifdef __cplusplus
}
#endif
#include "lttng-ust-tracef-provider.h"
static inline
-void __lttng_ust_vtracef(const char *fmt, va_list ap)
+void lttng_ust___vtracef(const char *fmt, va_list ap)
__attribute__((always_inline, format(printf, 1, 0)));
static inline
-void __lttng_ust_vtracef(const char *fmt, va_list ap)
+void lttng_ust___vtracef(const char *fmt, va_list ap)
{
char *msg;
const int len = vasprintf(&msg, fmt, ap);
return;
}
-/*
- * FIXME: We should include <lttng/tracef.h> for the declarations here, but it
- * fails with tracepoint magic above my paygrade.
- */
-
-void _lttng_ust_vtracef(const char *fmt, va_list ap)
+void lttng_ust__vtracef(const char *fmt, va_list ap)
__attribute__((format(printf, 1, 0)));
-void _lttng_ust_vtracef(const char *fmt, va_list ap)
+void lttng_ust__vtracef(const char *fmt, va_list ap)
{
- __lttng_ust_vtracef(fmt, ap);
+ lttng_ust___vtracef(fmt, ap);
}
-void _lttng_ust_tracef(const char *fmt, ...)
+void lttng_ust__tracef(const char *fmt, ...)
__attribute__((format(printf, 1, 2)));
-void _lttng_ust_tracef(const char *fmt, ...)
+void lttng_ust__tracef(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
- __lttng_ust_vtracef(fmt, ap);
+ lttng_ust___vtracef(fmt, ap);
va_end(ap);
}