Make sure that all non-static functions have a declaration.
Change-Id: I4057795631c53c4281127457a1ee5a538ee7fcce
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
return "Coarse monotonic clock at 1KHz";
}
+/*
+ * Entry-point called by liblttng-ust through dlsym();
+ */
+void lttng_ust_clock_plugin_init(void);
void lttng_ust_clock_plugin_init(void)
{
int ret;
return 0;
}
+/*
+ * Entry-point called by liblttng-ust through dlsym();
+ */
+void lttng_ust_getcpu_plugin_init(void);
void lttng_ust_getcpu_plugin_init(void)
{
int ret;
#define TRACEPOINT_DEFINE
#include "ust_tests_hello.h"
+static
void inthandler(int sig)
{
printf("in SIGUSR1 handler\n");
tracepoint(ust_tests_hello, tptest_sighandler);
}
+static
int init_int_handler(void)
{
int result;
#include <usterr-signal-safe.h>
#include "../liblttng-ust/compat.h"
+#include "../liblttng-ust/lttng-tracer-core.h"
/* Operations on the fd set. */
#define IS_FD_VALID(fd) ((fd) >= 0 && (fd) < lttng_ust_max_fd)
#include <sys/types.h>
#include <stdio.h>
#include <assert.h>
+#include <malloc.h>
+
#include <urcu/system.h>
#include <urcu/uatomic.h>
#include <urcu/compiler.h>
#include <urcu/tls-compat.h>
#include <urcu/arch.h>
+
+#include <lttng/ust-libc-wrapper.h>
+
#include <ust-helper.h>
#include "ust-compat.h"
* The tracepoint fired by the agent.
*/
+void py_tracepoint(const char *asctime, const char *msg,
+ const char *logger_name, const char *funcName, unsigned int lineno,
+ unsigned int int_loglevel, unsigned int thread, const char *threadName);
void py_tracepoint(const char *asctime, const char *msg,
const char *logger_name, const char *funcName, unsigned int lineno,
unsigned int int_loglevel, unsigned int thread, const char *threadName)
#include <usterr-signal-safe.h>
#include <urcu/rculist.h>
+#include "lttng-tracer-core.h"
#include "ust-events-internal.h"
#include "../libmsgpack/msgpack.h"
#include "lttng-bytecode.h"
}
}
-/*
- * We own the bytecode if we return success.
- */
-int lttng_filter_enabler_attach_bytecode(struct lttng_enabler *enabler,
- struct lttng_ust_bytecode_node *bytecode)
-{
- cds_list_add(&bytecode->node, &enabler->filter_bytecode_head);
- return 0;
-}
-
static
void free_filter_runtime(struct cds_list_head *bytecode_runtime_head)
{
#include <urcu/tls-compat.h>
#include <assert.h>
#include "compat.h"
+#include "lttng-tracer-core.h"
#include "context-internal.h"
#include "../libcounter/counter.h"
#include "jhash.h"
#include <lttng/ust-abi.h>
+#include "context-provider-internal.h"
/*
* All operations within this file are called by the communication
#define _LGPL_SOURCE
#include "lttng-tracer.h"
+#include "lttng-rb-clients.h"
#define RING_BUFFER_MODE_TEMPLATE RING_BUFFER_DISCARD
#define RING_BUFFER_MODE_TEMPLATE_STRING "discard-rt"
#define _LGPL_SOURCE
#include "lttng-tracer.h"
+#include "lttng-rb-clients.h"
#define RING_BUFFER_MODE_TEMPLATE RING_BUFFER_DISCARD
#define RING_BUFFER_MODE_TEMPLATE_STRING "discard"
#define _LGPL_SOURCE
#include "lttng-tracer.h"
+#include "lttng-rb-clients.h"
#define RING_BUFFER_MODE_TEMPLATE RING_BUFFER_OVERWRITE
#define RING_BUFFER_MODE_TEMPLATE_STRING "overwrite-rt"
#define _LGPL_SOURCE
#include "lttng-tracer.h"
+#include "lttng-rb-clients.h"
#define RING_BUFFER_MODE_TEMPLATE RING_BUFFER_OVERWRITE
#define RING_BUFFER_MODE_TEMPLATE_STRING "overwrite"
#include <lttng/ust-error.h>
#include <lttng/ust-ctl.h>
#include <lttng/ust-libc-wrapper.h>
+#include <lttng/ust-thread.h>
#include <lttng/ust-tracer.h>
#include <urcu/tls-compat.h>
#include <ust-comm.h>
*
* Returns 0 on success, -1 if an error occurred.
*/
+static
int lttng_ust_elf_get_debug_link_from_section(struct lttng_ust_elf *elf,
char **filename, uint32_t *crc,
struct lttng_ust_elf_shdr *shdr)
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)
__attribute__((format(printf, 1, 0)));
void _lttng_ust_vtracef(const char *fmt, va_list ap)
const char *fmt, va_list ap) \
__attribute__ ((format(printf, 4, 0))); \
\
+ void _lttng_ust_vtracelog_##level(const char *file, \
+ int line, const char *func, \
+ const char *fmt, va_list ap); \
void _lttng_ust_vtracelog_##level(const char *file, \
int line, const char *func, \
const char *fmt, va_list ap) \
const char *fmt, ...) \
__attribute__ ((format(printf, 4, 5))); \
\
+ void _lttng_ust_tracelog_##level(const char *file, \
+ int line, const char *func, \
+ const char *fmt, ...); \
void _lttng_ust_tracelog_##level(const char *file, \
int line, const char *func, \
const char *fmt, ...) \
* Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*/
+#include "tracepoint-internal.h"
+
/* Test compiler support for weak symbols with hidden visibility. */
int __tracepoint_test_symbol1 __attribute__((weak, visibility("hidden")));
void *__tracepoint_test_symbol2 __attribute__((weak, visibility("hidden")));
pthread_mutex_unlock(&tracepoint_mutex);
}
-void tracepoint_set_new_tracepoint_cb(void (*cb)(struct lttng_ust_tracepoint *))
-{
- new_tracepoint_cb = cb;
-}
-
static void new_tracepoints(struct lttng_ust_tracepoint * const *start,
struct lttng_ust_tracepoint * const *end)
{
* against recent liblttng-ust headers require a recent liblttng-ust
* runtime for those tracepoints to be taken into account.
*/
+int tracepoint_register_lib(struct lttng_ust_tracepoint * const *tracepoints_start,
+ int tracepoints_count);
int tracepoint_register_lib(struct lttng_ust_tracepoint * const *tracepoints_start,
int tracepoints_count)
{
return 0;
}
+int tracepoint_unregister_lib(struct lttng_ust_tracepoint * const *tracepoints_start);
int tracepoint_unregister_lib(struct lttng_ust_tracepoint * const *tracepoints_start)
{
struct tracepoint_lib *lib;
#undef tp_rcu_read_unlock
#undef tp_rcu_dereference
+void tp_rcu_read_lock(void);
void tp_rcu_read_lock(void)
{
lttng_ust_urcu_read_lock();
}
+void tp_rcu_read_unlock(void);
void tp_rcu_read_unlock(void)
{
lttng_ust_urcu_read_unlock();
}
+void *tp_rcu_dereference_sym(void *p);
void *tp_rcu_dereference_sym(void *p)
{
return lttng_ust_rcu_dereference(p);
* dlopen(3) and dlsym(3) to get an handle on the
* tp_disable_destructors and tp_get_destructors_state symbols below.
*/
+void tp_disable_destructors(void);
void tp_disable_destructors(void)
{
uatomic_set(&tracepoint_destructors_state, 0);
* Returns 1 if the destructors are enabled and should be executed.
* Returns 0 if the destructors are disabled.
*/
+int tp_get_destructors_state(void);
int tp_get_destructors_state(void)
{
return uatomic_read(&tracepoint_destructors_state);
#include <stdlib.h>
#include <wchar.h>
+#include "various.h"
+
/*ARGSUSED*/
size_t
ust_safe_mbrtowc(wchar_t *pwc, const char *s, size_t n,
#include "local.h"
#include "fvwrite.h"
+#include "various.h"
union arg {
int intarg;
static volatile int test_go, test_stop;
+static
void do_stuff(void)
{
int i;
#endif
}
+
+static
void *function(void *arg)
{
unsigned long long nr_loops = 0;
return NULL;
}
+static
void usage(char **argv) {
printf("Usage: %s nr_threads duration(s) <OPTIONS>\n", argv[0]);
printf("OPTIONS:\n");
#define TRACEPOINT_DEFINE
#include "ust_tests_hello.h"
+static
void inthandler(int sig)
{
printf("in SIGUSR1 handler\n");
tracepoint(ust_tests_hello, tptest_sighandler);
}
+static
int init_int_handler(void)
{
int result;
#define TRACEPOINT_DEFINE
#include "ust_tests_hello.h"
+static
void inthandler(int sig)
{
printf("in SIGUSR1 handler\n");
tracepoint(ust_tests_hello, tptest_sighandler);
}
+static
int init_int_handler(void)
{
int result;
return 0;
}
-void test_inc_count(void);
-
int main(int argc, char **argv)
{
int i, netint;
#define TRACEPOINT_CREATE_PROBES
#include "ust_tests_sameline.h"
-int main()
+int main(void)
{
tracepoint(ust_tests_sameline, event1); tracepoint(ust_tests_sameline, event2);
return 0;
static __thread unsigned int test_count;
+static
void test_inc_count(void)
{
test_count++;
.get_value = test_get_value,
};
+static
void inthandler(int sig)
{
printf("in SIGUSR1 handler\n");
tracepoint(ust_tests_hello, tptest_sighandler);
}
+static
int init_int_handler(void)
{
int result;
return 0;
}
-void test_inc_count(void);
-
int main(int argc, char **argv)
{
int i, netint;
AM_CPPFLAGS += -I$(top_srcdir)/tests/utils
noinst_LTLIBRARIES = libgcc-wh.la
-libgcc_wh_la_SOURCES = c.c d.c
+libgcc_wh_la_SOURCES = libgcc-wh1.c libgcc-wh2.c libgcc-wh.h
noinst_PROGRAMS = test_gcc_weak_hidden
-test_gcc_weak_hidden_SOURCES = main.c b.c
+test_gcc_weak_hidden_SOURCES = main.c b.c b.h
test_gcc_weak_hidden_LDADD = $(top_builddir)/tests/utils/libtap.a \
$(builddir)/libgcc-wh.la
* SPDX-License-Identifier: LGPL-2.1-only
*/
+#include "b.h"
+
int testint __attribute__((weak, visibility("hidden")));
void *testptr __attribute__((weak, visibility("hidden")));
struct {
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ */
+
+#ifndef _UST_TEST_WEAK_B_H
+#define _UST_TEST_WEAK_B_H
+
+void *testfct_int(void);
+void *testfct_ptr(void);
+void *testfct_24_bytes(void);
+
+#endif
+++ /dev/null
-/*
- * SPDX-License-Identifier: LGPL-2.1-only
- */
-
-int testint __attribute__((weak, visibility("hidden")));
-void *testptr __attribute__((weak, visibility("hidden")));
-struct {
- char a[24];
-} testsym_24_bytes __attribute__((weak, visibility("hidden")));
-
-void *testlibfct1_int(void)
-{
- return &testint;
-}
-
-void *testlibfct1_ptr(void)
-{
- return &testptr;
-}
-
-void *testlibfct1_24_bytes(void)
-{
- return &testsym_24_bytes;
-}
+++ /dev/null
-/*
- * SPDX-License-Identifier: LGPL-2.1-only
- */
-
-int testint __attribute__((weak, visibility("hidden")));
-void *testptr __attribute__((weak, visibility("hidden")));
-struct {
- char a[24];
-} testsym_24_bytes __attribute__((weak, visibility("hidden")));
-
-void *testlibfct2_int(void)
-{
- return &testint;
-}
-
-void *testlibfct2_ptr(void)
-{
- return &testptr;
-}
-
-void *testlibfct2_24_bytes(void)
-{
- return &testsym_24_bytes;
-}
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ */
+
+#ifndef _UST_TEST_WEAK_LIBGCC_H
+#define _UST_TEST_WEAK_LIBGCC_H
+
+void *testlibfct1_int(void);
+void *testlibfct1_ptr(void);
+void *testlibfct1_24_bytes(void);
+
+void *testlibfct2_int(void);
+void *testlibfct2_ptr(void);
+void *testlibfct2_24_bytes(void);
+
+#endif
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ */
+
+#include "libgcc-wh.h"
+
+int testint __attribute__((weak, visibility("hidden")));
+void *testptr __attribute__((weak, visibility("hidden")));
+struct {
+ char a[24];
+} testsym_24_bytes __attribute__((weak, visibility("hidden")));
+
+void *testlibfct1_int(void)
+{
+ return &testint;
+}
+
+void *testlibfct1_ptr(void)
+{
+ return &testptr;
+}
+
+void *testlibfct1_24_bytes(void)
+{
+ return &testsym_24_bytes;
+}
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-only
+ */
+
+#include "libgcc-wh.h"
+
+int testint __attribute__((weak, visibility("hidden")));
+void *testptr __attribute__((weak, visibility("hidden")));
+struct {
+ char a[24];
+} testsym_24_bytes __attribute__((weak, visibility("hidden")));
+
+void *testlibfct2_int(void)
+{
+ return &testint;
+}
+
+void *testlibfct2_ptr(void)
+{
+ return &testptr;
+}
+
+void *testlibfct2_24_bytes(void)
+{
+ return &testsym_24_bytes;
+}
*/
#include <stdbool.h>
+#include "b.h"
#include "tap.h"
#define NUM_TESTS 2
static bool match_matrix[NR_MATCH];
-int main()
+int main(void)
{
plan_tests(NUM_TESTS);
#define SHM_PATH "/ust-shm-test"
-int main()
+int main(void)
{
int shmfd;
size_t shmsize = LTTNG_UST_PAGE_SIZE * 10;
#define TEST_NAME_PROPER_LEN 16
-int main()
+int main(void)
{
int ret;
char name1[TEST_NAME_PROPER_LEN];
#include "tap.h"
-int main()
+int main(void)
{
char buf[100];
const char expected_str[] = "header 9999, hello, 005, ' 9'";