compound_literal_on_heap = True
expected_events = [
- {"name": "tp_so:constructor_c_provider_shared_library", "msg": None, "count": 0},
+ {"name": "tp_so_c:constructor_c_provider_shared_library", "msg": None, "count": 0},
{
"name": "tp_a:constructor_c_provider_static_archive",
"msg": None,
"count": 0,
"may_fail": compound_literal_on_heap,
},
- {"name": "tp_so:destructor_c_provider_shared_library", "msg": None, "count": 0},
+ {"name": "tp_so_c:destructor_c_provider_shared_library", "msg": None, "count": 0},
]
num_tests = 7 + len(expected_events)
endif
noinst_LTLIBRARIES = libtp-so-provider.la libtp-so-define.la \
+ libtp-so_c-provider.la libtp-so_c-define.la \
libtp-a-provider.la libtp-a-define.la \
libtp-a_c-provider.la libtp-a_c-define.la
libtp_so_define_la_LDFLAGS = \
$(FORCE_SHARED_LIB_OPTIONS)
+libtp_so_c_provider_la_SOURCES = \
+ tp-so_c-provider.c \
+ tp-so_c.h
+libtp_so_c_provider_la_LDFLAGS = $(FORCE_SHARED_LIB_OPTIONS)
+
+libtp_so_c_define_la_SOURCES = \
+ tp-so_c-define.c \
+ tp-so_c.h
+libtp_so_c_define_la_LDFLAGS = $(FORCE_SHARED_LIB_OPTIONS)
+
# static archives
libtp_a_provider_la_SOURCES = \
tp-a-provider.cpp \
gen_ust_events_constructor_LDADD = $(UST_LIBS) \
$(builddir)/libtp-so-define.la \
$(builddir)/libtp-so-provider.la \
+ $(builddir)/libtp-so_c-define.la \
+ $(builddir)/libtp-so_c-provider.la \
$(builddir)/libtp-a-define.la \
$(builddir)/libtp-a-provider.la \
$(builddir)/libtp-a_c-define.la \
#include "obj.h"
#include "tp-a.h"
#include "tp-a_c.h"
+#include "tp-so_c.h"
#include "tp-so.h"
#include "tp.h"
void test_constructor_so(void) __attribute__((constructor));
void test_constructor_so(void)
{
- tracepoint(tp_so, constructor_c_provider_shared_library);
+ tracepoint(tp_so_c, constructor_c_provider_shared_library);
}
void test_destructor_so(void) __attribute__((destructor));
void test_destructor_so(void)
{
- tracepoint(tp_so, destructor_c_provider_shared_library);
+ tracepoint(tp_so_c, destructor_c_provider_shared_library);
}
Objso g_objso_shared_library("global - shared library define and provider");
#include <stdint.h>
-TRACEPOINT_EVENT(tp_so, constructor_c_provider_shared_library, TP_ARGS(), TP_FIELDS())
-
-TRACEPOINT_EVENT(tp_so, destructor_c_provider_shared_library, TP_ARGS(), TP_FIELDS())
-
TRACEPOINT_EVENT(tp_so,
constructor_cplusplus_provider_shared_library,
TP_ARGS(const char *, msg),
--- /dev/null
+/*
+ * Copyright (C) 2024 Kienan Stewart <kstewart@efficios.com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-only
+ */
+#define TRACEPOINT_DEFINE
+#include "tp-so_c.h"
--- /dev/null
+/*
+ * Copyright (C) 2024 Kienan Stewart <kstewart@efficios.com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-only
+ */
+
+#define TRACEPOINT_CREATE_PROBES
+#include "tp-so_c.h"
--- /dev/null
+/*
+ * Copyright (C) 2024 Kienan Stewart <kstewart@efficios.com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-only
+ */
+
+#ifdef _cplusplus
+extern "C" {
+#endif
+
+#undef TRACEPOINT_PROVIDER
+#define TRACEPOINT_PROVIDER tp_so_c
+
+#if !defined(_TRACEPOINT_TP_SO_C_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
+#define _TRACEPOINT_TP_SO_C_H
+
+#include <lttng/tracepoint.h>
+
+TRACEPOINT_EVENT(tp_so_c, constructor_c_provider_shared_library, TP_ARGS(), TP_FIELDS())
+
+TRACEPOINT_EVENT(tp_so_c, destructor_c_provider_shared_library, TP_ARGS(), TP_FIELDS())
+
+#endif /* _TRACEPOINT_TP_SO_C_H */
+
+#undef TRACEPOINT_INCLUDE
+#define TRACEPOINT_INCLUDE "./tp-so_c.h"
+
+/* This part must be outside ifdef protection */
+#include <lttng/tracepoint-event.h>
+
+#ifdef _cplusplus
+}
+#endif