commit 077b8f35d5720b36f218ad66cf10899982db95fe
parent 4262629d5a888b0a84fb2cd8eadc77150fd20647
Author: Andreas Gruhler <agruhl@gmx.ch>
Date: Thu, 23 Jun 2022 08:55:13 +0200
LTTNG_UST_COMPAT_API_VERSION 0
Diffstat:
4 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/src/diary.c b/src/diary.c
@@ -298,7 +298,7 @@ bool read_config(const char* file_path) {
// check if config file is readable
if( access( config_file_path, R_OK ) != 0 ) {
- lttng_ust_tracepoint(diary, warning, "Config file missing or not readable, skipping", config_file_path);
+ tracepoint(diary, warning, "Config file missing or not readable, skipping", config_file_path);
return false;
}
diff --git a/src/diary.h b/src/diary.h
@@ -26,8 +26,8 @@
#include "export.h"
#include "caldav.h"
-#define LTTNG_UST_TRACEPOINT_DEFINE
-#define LTTNG_UST_TRACEPOINT_PROBE_DYNAMIC_LINKAGE
+#define TRACEPOINT_DEFINE
+#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE
#include "lttng/diary-tp.h"
#define XDG_CONFIG_HOME_FALLBACK "~/.config"
diff --git a/src/lttng/diary-tp.c b/src/lttng/diary-tp.c
@@ -1,4 +1,4 @@
-#define LTTNG_UST_TRACEPOINT_CREATE_PROBES
-#define LTTNG_UST_TRACEPOINT_DEFINE
+#define TRACEPOINT_CREATE_PROBES
+#define TRACEPOINT_DEFINE
#include "diary-tp.h"
diff --git a/src/lttng/diary-tp.h b/src/lttng/diary-tp.h
@@ -1,17 +1,21 @@
-#undef LTTNG_UST_TRACEPOINT_PROVIDER
-#define LTTNG_UST_TRACEPOINT_PROVIDER diary
+// LTTng 2.13 prepends the lttng_ust_ and LTTNG_UST_ prefix to all names
+// to offer a consistent API namespace. Prefer the pre 2.13 behavior (API v0).
+#define LTTNG_UST_COMPAT_API_VERSION 0
-#undef LTTNG_UST_TRACEPOINT_INCLUDE
-#define LTTNG_UST_TRACEPOINT_INCLUDE "diary-tp.h"
+#undef TRACEPOINT_PROVIDER
+#define TRACEPOINT_PROVIDER diary
-#if !defined(_DIARY_TP_H) || defined(LTTNG_UST_TRACEPOINT_HEADER_MULTI_READ)
+#undef TRACEPOINT_INCLUDE
+#define TRACEPOINT_INCLUDE "diary-tp.h"
+
+#if !defined(_DIARY_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
#define _DIARY_TP_H
#include <lttng/tracepoint.h>
// Instrument a C user application
// https://lttng.org/docs/v2.13/#doc-c-application
-LTTNG_UST_TRACEPOINT_EVENT(
+TRACEPOINT_EVENT(
/* Tracepoint provider name */
diary,
@@ -19,37 +23,35 @@ LTTNG_UST_TRACEPOINT_EVENT(
debug,
/* Input arguments */
- LTTNG_UST_TP_ARGS(
- //int, my_integer_arg,
+ TP_ARGS(
char *, msg_arg
),
/* Output event fields */
- LTTNG_UST_TP_FIELDS(
- lttng_ust_field_string(msg, msg_arg)
- //lttng_ust_field_integer(int, my_integer_field, my_integer_arg)
+ TP_FIELDS(
+ ctf_string(msg, msg_arg)
)
)
-LTTNG_UST_TRACEPOINT_EVENT(
+TRACEPOINT_EVENT(
diary,
warning,
- LTTNG_UST_TP_ARGS(
+ TP_ARGS(
char *, msg_arg,
char *, arg1
),
- LTTNG_UST_TP_FIELDS(
- lttng_ust_field_string(msg, msg_arg)
- lttng_ust_field_string(arg1, arg1)
+ TP_FIELDS(
+ ctf_string(msg, msg_arg)
+ ctf_string(arg1, arg1)
)
)
/* Log level assignment */
-// LTTNG_UST_TRACEPOINT_LOGLEVEL_ERR
-// LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING
-// LTTNG_UST_TRACEPOINT_LOGLEVEL_INFO
-// LTTNG_UST_TRACEPOINT_LOGLEVEL_DEBUG_LINE (default)
-LTTNG_UST_TRACEPOINT_LOGLEVEL(diary, warning, LTTNG_UST_TRACEPOINT_LOGLEVEL_WARNING)
+// TRACE_ERR
+// TRACE_WARNING
+// TRACE_INFO
+// TRACE_DEBUG_LINE (default)
+TRACEPOINT_LOGLEVEL(diary, warning, TRACE_WARNING)
#endif /* _DIARY_TP_H */