From 7f0aeeba637b9586e4657ca3b5fa1df38b8c150a Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 18 Nov 2011 12:16:11 -0500 Subject: [PATCH] Fix tracepoint event related build errors Signed-off-by: Mathieu Desnoyers --- include/lttng/share.h | 2 ++ include/lttng/tracepoint-event.h | 7 +++++-- include/lttng/tracepoint.h | 1 - liblttng-ust-fork/ustfork.c | 16 ++++++++-------- liblttng-ust/Makefile.am | 2 +- snprintf/Makefile.am | 5 +++-- tests/fork/ust_tests_fork.h | 4 +--- 7 files changed, 20 insertions(+), 17 deletions(-) diff --git a/include/lttng/share.h b/include/lttng/share.h index 776fc85f..19644f12 100644 --- a/include/lttng/share.h +++ b/include/lttng/share.h @@ -14,6 +14,8 @@ * modified is included with the above copyright notice. */ +#include + ssize_t patient_write(int fd, const void *buf, size_t count); ssize_t patient_send(int fd, const void *buf, size_t count, int flags); diff --git a/include/lttng/tracepoint-event.h b/include/lttng/tracepoint-event.h index 2cbe4475..176e7f3f 100644 --- a/include/lttng/tracepoint-event.h +++ b/include/lttng/tracepoint-event.h @@ -22,11 +22,14 @@ extern "C" { #undef TRACEPOINT_EVENT_INSTANCE #define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \ - _DEFINE_TRACEPOINT(provider, name) + _DEFINE_TRACEPOINT(_provider, _name) #undef TRACEPOINT_EVENT #define TRACEPOINT_EVENT(_provider, _name, _args, _fields) \ - TRACEPOINT_EVENT_INSTANCE(_provider, _name, _name, _TP_PARAMS(_args)) + TRACEPOINT_EVENT_CLASS(_provider, _name, _TP_PARAMS(_args), \ + _TP_PARAMS(_fields)) \ + TRACEPOINT_EVENT_INSTANCE(_provider, _name, _name, \ + _TP_PARAMS(_args)) #define TRACEPOINT_INCLUDE __tp_stringify(TRACEPOINT_INCLUDE_FILE) diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index e177b87d..2753d95a 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -272,7 +272,6 @@ static void __attribute__((destructor)) __tracepoints__destroy(void) * the provider:event identifier is limited to 127 characters. */ - #define TRACEPOINT_EVENT(provider, name, args, fields) \ _DECLARE_TRACEPOINT(provider, name, _TP_PARAMS(args)) diff --git a/liblttng-ust-fork/ustfork.c b/liblttng-ust-fork/ustfork.c index 5e6acba1..ac191971 100644 --- a/liblttng-ust-fork/ustfork.c +++ b/liblttng-ust-fork/ustfork.c @@ -33,7 +33,7 @@ struct user_desc; pid_t fork(void) { static pid_t (*plibc_func)(void) = NULL; - ust_fork_info_t fork_info; + sigset_t sigset; pid_t retval; if (plibc_func == NULL) { @@ -44,14 +44,14 @@ pid_t fork(void) } } - ust_before_fork(&fork_info); + ust_before_fork(&sigset); /* Do the real fork */ retval = plibc_func(); if (retval == 0) { /* child */ - ust_after_fork_child(&fork_info); + ust_after_fork_child(&sigset); } else { - ust_after_fork_parent(&fork_info); + ust_after_fork_parent(&sigset); } return retval; } @@ -59,7 +59,7 @@ pid_t fork(void) struct ustfork_clone_info { int (*fn)(void *); void *arg; - ust_fork_info_t fork_info; + sigset_t sigset; }; static int clone_fn(void *arg) @@ -67,7 +67,7 @@ static int clone_fn(void *arg) struct ustfork_clone_info *info = (struct ustfork_clone_info *) arg; /* clone is now done and we are in child */ - ust_after_fork_child(&info->fork_info); + ust_after_fork_child(&info->sigset); return info->fn(info->arg); } @@ -109,11 +109,11 @@ int clone(int (*fn)(void *), void *child_stack, int flags, void *arg, ...) /* Creating a real process, we need to intervene. */ struct ustfork_clone_info info = { fn: fn, arg: arg }; - ust_before_fork(&info.fork_info); + ust_before_fork(&info.sigset); retval = plibc_func(clone_fn, child_stack, flags, &info, ptid, tls, ctid); /* The child doesn't get here. */ - ust_after_fork_parent(&info.fork_info); + ust_after_fork_parent(&info.sigset); } return retval; } diff --git a/liblttng-ust/Makefile.am b/liblttng-ust/Makefile.am index fef43c24..336cf7bf 100644 --- a/liblttng-ust/Makefile.am +++ b/liblttng-ust/Makefile.am @@ -48,4 +48,4 @@ liblttng_ust_la_LIBADD = \ $(top_builddir)/liblttng-ust-comm/liblttng-ust-comm.la \ liblttng-ust-runtime.la liblttng-ust-support.la -liblttng_ust_la_CFLAGS = -DUST_COMPONENT="liblttng-ust" -fno-strict-aliasing +liblttng_ust_la_CFLAGS = -DUST_COMPONENT="liblttng_ust" -fno-strict-aliasing diff --git a/snprintf/Makefile.am b/snprintf/Makefile.am index f04846a2..a32ed4f0 100644 --- a/snprintf/Makefile.am +++ b/snprintf/Makefile.am @@ -15,7 +15,8 @@ libustsnprintf_la_SOURCES = \ vfprintf.c \ wcio.h \ wsetup.c \ - core.c + core.c \ + patient_write.c libustsnprintf_la_LDFLAGS = -no-undefined -static -libustsnprintf_la_CFLAGS = -DUST_COMPONENT="ust_snprintf" -fPIC -fno-strict-aliasing +libustsnprintf_la_CFLAGS = -DUST_COMPONENT="lttng_ust_snprintf" -fPIC -fno-strict-aliasing diff --git a/tests/fork/ust_tests_fork.h b/tests/fork/ust_tests_fork.h index 9b325131..3d7eb342 100644 --- a/tests/fork/ust_tests_fork.h +++ b/tests/fork/ust_tests_fork.h @@ -44,10 +44,8 @@ TRACEPOINT_EVENT(ust_tests_fork, after_exec, #endif /* _TRACEPOINT_UST_TESTS_FORK_H */ -#undef TRACEPOINT_INCLUDE_PATH -#define TRACEPOINT_INCLUDE_PATH . #undef TRACEPOINT_INCLUDE_FILE -#define TRACEPOINT_INCLUDE_FILE ust_tests_fork +#define TRACEPOINT_INCLUDE_FILE ./ust_tests_fork.h /* This part must be outside ifdef protection */ #include -- 2.34.1