ACLOCAL_AMFLAGS = -I m4
SUBDIRS = libust tests libmallocwrap ustd ustctl libinterfork include
-EXTRA_DIST = doc share/kernelcompat.h share/share.h share/usterr.h
+EXTRA_DIST = doc
dist_bin_SCRIPTS = usttrace
-
-include_HEADERS = share/kernelcompat.h share/usterr.h
-nobase_include_HEADERS = ust/immediate.h ust/marker.h ust/tracepoint.h
+nobase_include_HEADERS = ust/immediate.h ust/kernelcompat.h ust/marker.h \
+ ust/tracepoint.h
+
+noinst_HEADERS = share.h usterr.h
--- /dev/null
+#ifndef UST_SHARE_H
+#define UST_SHARE_H
+
+#include <unistd.h>
+#include <errno.h>
+
+/* This write is patient because it restarts if it was incomplete.
+ */
+
+static inline ssize_t patient_write(int fd, const void *buf, size_t count)
+{
+ const char *bufc = (const char *) buf;
+ int result;
+
+ for(;;) {
+ result = write(fd, bufc, count);
+ if(result == -1 && errno == EINTR) {
+ continue;
+ }
+ if(result <= 0) {
+ return result;
+ }
+ count -= result;
+ bufc += result;
+
+ if(count == 0) {
+ break;
+ }
+ }
+
+ return bufc-(const char *)buf;
+}
+
+#endif /* UST_SHARE_H */
--- /dev/null
+#ifndef KERNELCOMPAT_H
+#define KERNELCOMPAT_H
+
+#include <kcompat.h>
+
+#include <string.h>
+#include <sys/time.h>
+
+/* FIXME: libkcompat must not define arch-specific local ops, as ust *must*
+ * fallback to the normal atomic ops. Fix things so we don't add them and
+ * break things accidentally.
+ */
+
+#define container_of(ptr, type, member) ({ \
+ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+ (type *)( (char *)__mptr - offsetof(type,member) );})
+
+#define KERN_DEBUG ""
+#define KERN_NOTICE ""
+#define KERN_INFO ""
+#define KERN_ERR ""
+#define KERN_ALERT ""
+#define KERN_WARNING ""
+
+/* ERROR OPS */
+
+#define MAX_ERRNO 4095
+
+#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
+
+static inline void *ERR_PTR(long error)
+{
+ return (void *) error;
+}
+
+static inline long PTR_ERR(const void *ptr)
+{
+ return (long) ptr;
+}
+
+static inline long IS_ERR(const void *ptr)
+{
+ return IS_ERR_VALUE((unsigned long)ptr);
+}
+
+
+/* Min / Max */
+
+#define min_t(type, x, y) ({ \
+ type __min1 = (x); \
+ type __min2 = (y); \
+ __min1 < __min2 ? __min1: __min2; })
+
+#define max_t(type, x, y) ({ \
+ type __max1 = (x); \
+ type __max2 = (y); \
+ __max1 > __max2 ? __max1: __max2; })
+
+
+/* MUTEXES */
+
+#include <pthread.h>
+
+#define DEFINE_MUTEX(m) pthread_mutex_t (m) = PTHREAD_MUTEX_INITIALIZER;
+#define DECLARE_MUTEX(m) extern pthread_mutex_t (m);
+
+#define mutex_lock(m) pthread_mutex_lock(m)
+
+#define mutex_unlock(m) pthread_mutex_unlock(m)
+
+
+/* MALLOCATION */
+
+#include <stdlib.h>
+
+#define kmalloc(s, t) malloc(s)
+#define kzalloc(s, t) zmalloc(s)
+#define kfree(p) free((void *)p)
+#define kstrdup(s, t) strdup(s)
+
+#define zmalloc(s) calloc(1, s)
+
+#define GFP_KERNEL
+
+/* PRINTK */
+
+#include <stdio.h>
+#define printk(fmt, args...) printf(fmt, ## args)
+
+
+/* ATTRIBUTES */
+
+#define ____cacheline_aligned
+
+/* MATH */
+
+static inline unsigned int hweight32(unsigned int w)
+{
+ unsigned int res = w - ((w >> 1) & 0x55555555);
+ res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
+ res = (res + (res >> 4)) & 0x0F0F0F0F;
+ res = res + (res >> 8);
+ return (res + (res >> 16)) & 0x000000FF;
+}
+
+static inline int fls(int x)
+{
+ int r;
+//ust// #ifdef CONFIG_X86_CMOV
+ asm("bsrl %1,%0\n\t"
+ "cmovzl %2,%0"
+ : "=&r" (r) : "rm" (x), "rm" (-1));
+//ust// #else
+//ust// asm("bsrl %1,%0\n\t"
+//ust// "jnz 1f\n\t"
+//ust// "movl $-1,%0\n"
+//ust// "1:" : "=r" (r) : "rm" (x));
+//ust// #endif
+ return r + 1;
+}
+
+static __inline__ int get_count_order(unsigned int count)
+{
+ int order;
+
+ order = fls(count) - 1;
+ if (count & (count - 1))
+ order++;
+ return order;
+}
+
+
+
+
+#include <unistd.h>
+
+#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
+#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
+#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)
+#define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
+#define PAGE_MASK (~(PAGE_SIZE-1))
+
+
+
+
+/* ARRAYS */
+
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+
+/* TRACE CLOCK */
+
+/* There are two types of clocks that can be used.
+ - TSC based clock
+ - gettimeofday() clock
+
+ Microbenchmarks on Linux 2.6.30 on Core2 Duo 3GHz (functions are inlined):
+ Calls (100000000) to tsc(): 4004035641 cycles or 40 cycles/call
+ Calls (100000000) to gettimeofday(): 9723158352 cycles or 97 cycles/call
+
+ For merging traces with the kernel, a time source compatible with that of
+ the kernel is necessary.
+
+*/
+
+#if 0
+/* WARNING: Make sure to set frequency and scaling functions that will not
+ * result in lttv timestamps (sec.nsec) with seconds greater than 2**32-1.
+ */
+static inline u64 trace_clock_read64(void)
+{
+ uint32_t low;
+ uint32_t high;
+ uint64_t retval;
+ __asm__ volatile ("rdtsc\n" : "=a" (low), "=d" (high));
+
+ retval = high;
+ retval <<= 32;
+ return retval | low;
+}
+#endif
+
+static inline u64 trace_clock_read64(void)
+{
+ struct timeval tv;
+ u64 retval;
+
+ gettimeofday(&tv, NULL);
+ retval = tv.tv_sec;
+ retval *= 1000000;
+ retval += tv.tv_usec;
+
+ return retval;
+}
+
+static inline u64 trace_clock_frequency(void)
+{
+ return 1000000LL;
+}
+
+static inline u32 trace_clock_freq_scale(void)
+{
+ return 1;
+}
+
+
+#endif /* KERNELCOMPAT_H */
//ust// #include <linux/types.h>
#include <ust/immediate.h>
//ust// #include <linux/ltt-channels.h>
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
#include <kcompat/list.h>
-#include "usterr.h"
//ust// struct module;
//ust// struct task_struct;
\
static void __attribute__((constructor)) __markers__init(void) \
{ \
- DBG("next registration in "__FILE__"\n");\
marker_register_lib(__start___markers, (((long)__stop___markers)-((long)__start___markers))/sizeof(struct marker));\
}
#include <urcu-bp.h>
#include <ust/immediate.h>
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
struct module;
struct tracepoint;
--- /dev/null
+#ifndef USTERR_H
+#define USTERR_H
+
+#include <string.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <errno.h>
+#include <stdarg.h>
+
+#include "share.h"
+
+#ifndef UST_COMPONENT
+//#error UST_COMPONENT is undefined
+#define UST_COMPONENT libust
+#endif
+
+/* To stringify the expansion of a define */
+#define XSTR(d) STR(d)
+#define STR(s) #s
+
+/* We sometimes print in the tracing path, and tracing can occur in
+ * signal handlers, so we must use a print method which is signal safe.
+ */
+
+#define sigsafe_print_err(fmt, args...) \
+{ \
+ /* Can't use dynamic allocation. Limit ourselves to 250 chars. */ \
+ char ____buf[250]; \
+ int ____saved_errno; \
+\
+ /* Save the errno. */ \
+ ____saved_errno = errno; \
+\
+ snprintf(____buf, sizeof(____buf), fmt, ## args); \
+\
+ /* Add end of string in case of buffer overflow. */ \
+ ____buf[sizeof(____buf)-1] = 0; \
+\
+ patient_write(STDERR_FILENO, ____buf, strlen(____buf)); \
+ /* Can't print errors because we are in the error printing code path. */ \
+\
+ /* Restore errno, in order to be async-signal safe. */ \
+ errno = ____saved_errno; \
+}
+
+#define UST_STR_COMPONENT XSTR(UST_COMPONENT)
+
+#define ERRMSG(fmt, args...) do { sigsafe_print_err(UST_STR_COMPONENT "[%ld/%ld]: " fmt " (" __FILE__ ":" XSTR(__LINE__) ")\n", (long) getpid(), (long) syscall(SYS_gettid), ## args); fflush(stderr); } while(0)
+
+#define DEBUG
+#ifdef DEBUG
+# define DBG(fmt, args...) ERRMSG(fmt, ## args)
+#else
+# define DBG(fmt, args...) do {} while(0)
+#endif
+#define WARN(fmt, args...) ERRMSG("Warning: " fmt, ## args)
+#define ERR(fmt, args...) ERRMSG("Error: " fmt, ## args)
+#define BUG(fmt, args...) ERRMSG("BUG: " fmt, ## args)
+
+#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)
+#define PERROR(call, args...)\
+ do { \
+ char buf[200] = "Error in strerror_r()"; \
+ strerror_r(errno, buf, sizeof(buf)); \
+ ERRMSG("Error: " call ": %s", ## args, buf); \
+ } while(0);
+#else
+#define PERROR(call, args...)\
+ do { \
+ char *buf; \
+ char tmp[200]; \
+ buf = strerror_r(errno, tmp, sizeof(tmp)); \
+ ERRMSG("Error: " call ": %s", ## args, buf); \
+ } while(0);
+#endif
+
+#define BUG_ON(condition) do { if (unlikely(condition)) ERR("condition not respected (BUG)"); } while(0)
+#define WARN_ON(condition) do { if (unlikely(condition)) WARN("condition not respected on line %s:%d", __FILE__, __LINE__); } while(0)
+
+#endif /* USTERR_H */
-INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_builddir)/libust
lib_LTLIBRARIES = libustjava.la
libustjava_la_SOURCES = UST.c UST.h
+AM_CPPFLAGS = -I$(top_builddir)/include
+
lib_LTLIBRARIES = libinterfork.la
libinterfork_la_SOURCES = interfork.c
libinterfork_la_LIBADD = -ldl
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
-#include "share/usterr.h"
+#include "usterr.h"
extern void ust_fork(void);
extern void ust_potential_exec(void);
-INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(top_builddir)/include
lib_LTLIBRARIES = libmallocwrap.la
libmallocwrap_la_SOURCES = mallocwrap.c
-AM_CPPFLAGS = -I$(top_builddir)/share -I$(top_builddir)/libustcomm -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_builddir)/libustcomm
lib_LTLIBRARIES = libust.la
-libust_la_SOURCES = buffer.h marker.c tracepoint.c channels.c channels.h marker-control.c marker-control.h relay.c relay.h tracer.c tracer.h tracercore.c tracercore.h serialize.c tracectl.c $(top_builddir)/libustcomm/ustcomm.c $(top_builddir)/share/usterr.h
+libust_la_SOURCES = buffer.h marker.c tracepoint.c channels.c channels.h marker-control.c marker-control.h relay.c relay.h tracer.c tracer.h tracercore.c tracercore.h serialize.c tracectl.c $(top_builddir)/libustcomm/ustcomm.c
libust_la_LDFLAGS = -no-undefined -version-info 0:0:0
libust_la_LIBADD = -lpthread
libust_la_CFLAGS = -DUST_COMPONENT="libust"
//ust// #include <linux/mutex.h>
//ust// #include <linux/vmalloc.h>
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
#include "channels.h"
#include "usterr.h"
#include <ust/marker.h>
//ust// #include <linux/list.h>
#include <errno.h>
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
#include <kcompat/kref.h>
#define EVENTS_PER_CHANNEL 65536
//ust// #include <linux/slab.h>
#include <ctype.h>
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
//#include "list.h"
#include "tracer.h"
#include "usterr.h"
#define _LGPL_SOURCE
#include <urcu-bp.h>
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
#include <ust/marker.h>
#include "usterr.h"
//ust// #include <linux/cpu.h>
//ust// #include <linux/splice.h>
//ust// #include <linux/bitops.h>
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
#include <sys/mman.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <string.h>
#include <stdint.h>
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
#define _LGPL_SOURCE
#include <urcu-bp.h>
#include <urcu/rculist.h>
#include <errno.h>
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
#include <ust/tracepoint.h>
#include "usterr.h"
//#include "list.h"
//ust// #include <asm/atomic.h>
#include <urcu/rculist.h>
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
#include "tracercore.h"
#include "tracer.h"
#include "usterr.h"
#include <sys/types.h>
#include <stdarg.h>
//#include "list.h"
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
#include "buffer.h"
#include "relay.h"
#include "channels.h"
//ust// #include <linux/percpu.h>
//ust// #include <linux/module.h>
//ust// #include <linux/debugfs.h>
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
#include "tracercore.h"
/* Traces structures */
#ifndef LTT_CORE_H
#define LTT_CORE_H
-#include "kernelcompat.h"
+#include <ust/kernelcompat.h>
//ust// #include <linux/percpu.h>
/* ltt's root dir in debugfs */
+++ /dev/null
-#ifndef KERNELCOMPAT_H
-#define KERNELCOMPAT_H
-
-#include <kcompat.h>
-
-#include <string.h>
-#include <sys/time.h>
-
-/* FIXME: libkcompat must not define arch-specific local ops, as ust *must*
- * fallback to the normal atomic ops. Fix things so we don't add them and
- * break things accidentally.
- */
-
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
-
-#define KERN_DEBUG ""
-#define KERN_NOTICE ""
-#define KERN_INFO ""
-#define KERN_ERR ""
-#define KERN_ALERT ""
-#define KERN_WARNING ""
-
-/* ERROR OPS */
-
-#define MAX_ERRNO 4095
-
-#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
-
-static inline void *ERR_PTR(long error)
-{
- return (void *) error;
-}
-
-static inline long PTR_ERR(const void *ptr)
-{
- return (long) ptr;
-}
-
-static inline long IS_ERR(const void *ptr)
-{
- return IS_ERR_VALUE((unsigned long)ptr);
-}
-
-
-/* Min / Max */
-
-#define min_t(type, x, y) ({ \
- type __min1 = (x); \
- type __min2 = (y); \
- __min1 < __min2 ? __min1: __min2; })
-
-#define max_t(type, x, y) ({ \
- type __max1 = (x); \
- type __max2 = (y); \
- __max1 > __max2 ? __max1: __max2; })
-
-
-/* MUTEXES */
-
-#include <pthread.h>
-
-#define DEFINE_MUTEX(m) pthread_mutex_t (m) = PTHREAD_MUTEX_INITIALIZER;
-#define DECLARE_MUTEX(m) extern pthread_mutex_t (m);
-
-#define mutex_lock(m) pthread_mutex_lock(m)
-
-#define mutex_unlock(m) pthread_mutex_unlock(m)
-
-
-/* MALLOCATION */
-
-#include <stdlib.h>
-
-#define kmalloc(s, t) malloc(s)
-#define kzalloc(s, t) zmalloc(s)
-#define kfree(p) free((void *)p)
-#define kstrdup(s, t) strdup(s)
-
-#define zmalloc(s) calloc(1, s)
-
-#define GFP_KERNEL
-
-/* PRINTK */
-
-#include <stdio.h>
-#define printk(fmt, args...) printf(fmt, ## args)
-
-
-/* ATTRIBUTES */
-
-#define ____cacheline_aligned
-
-/* MATH */
-
-static inline unsigned int hweight32(unsigned int w)
-{
- unsigned int res = w - ((w >> 1) & 0x55555555);
- res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
- res = (res + (res >> 4)) & 0x0F0F0F0F;
- res = res + (res >> 8);
- return (res + (res >> 16)) & 0x000000FF;
-}
-
-static inline int fls(int x)
-{
- int r;
-//ust// #ifdef CONFIG_X86_CMOV
- asm("bsrl %1,%0\n\t"
- "cmovzl %2,%0"
- : "=&r" (r) : "rm" (x), "rm" (-1));
-//ust// #else
-//ust// asm("bsrl %1,%0\n\t"
-//ust// "jnz 1f\n\t"
-//ust// "movl $-1,%0\n"
-//ust// "1:" : "=r" (r) : "rm" (x));
-//ust// #endif
- return r + 1;
-}
-
-static __inline__ int get_count_order(unsigned int count)
-{
- int order;
-
- order = fls(count) - 1;
- if (count & (count - 1))
- order++;
- return order;
-}
-
-
-
-
-#include <unistd.h>
-
-#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
-#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
-#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)
-#define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
-#define PAGE_MASK (~(PAGE_SIZE-1))
-
-
-
-
-/* ARRAYS */
-
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
-
-/* TRACE CLOCK */
-
-/* There are two types of clocks that can be used.
- - TSC based clock
- - gettimeofday() clock
-
- Microbenchmarks on Linux 2.6.30 on Core2 Duo 3GHz (functions are inlined):
- Calls (100000000) to tsc(): 4004035641 cycles or 40 cycles/call
- Calls (100000000) to gettimeofday(): 9723158352 cycles or 97 cycles/call
-
- For merging traces with the kernel, a time source compatible with that of
- the kernel is necessary.
-
-*/
-
-#if 0
-/* WARNING: Make sure to set frequency and scaling functions that will not
- * result in lttv timestamps (sec.nsec) with seconds greater than 2**32-1.
- */
-static inline u64 trace_clock_read64(void)
-{
- uint32_t low;
- uint32_t high;
- uint64_t retval;
- __asm__ volatile ("rdtsc\n" : "=a" (low), "=d" (high));
-
- retval = high;
- retval <<= 32;
- return retval | low;
-}
-#endif
-
-static inline u64 trace_clock_read64(void)
-{
- struct timeval tv;
- u64 retval;
-
- gettimeofday(&tv, NULL);
- retval = tv.tv_sec;
- retval *= 1000000;
- retval += tv.tv_usec;
-
- return retval;
-}
-
-static inline u64 trace_clock_frequency(void)
-{
- return 1000000LL;
-}
-
-static inline u32 trace_clock_freq_scale(void)
-{
- return 1;
-}
-
-
-#endif /* KERNELCOMPAT_H */
+++ /dev/null
-#ifndef UST_SHARE_H
-#define UST_SHARE_H
-
-#include <unistd.h>
-#include <errno.h>
-
-/* This write is patient because it restarts if it was incomplete.
- */
-
-static inline ssize_t patient_write(int fd, const void *buf, size_t count)
-{
- const char *bufc = (const char *) buf;
- int result;
-
- for(;;) {
- result = write(fd, bufc, count);
- if(result == -1 && errno == EINTR) {
- continue;
- }
- if(result <= 0) {
- return result;
- }
- count -= result;
- bufc += result;
-
- if(count == 0) {
- break;
- }
- }
-
- return bufc-(const char *)buf;
-}
-
-#endif /* UST_SHARE_H */
+++ /dev/null
-#ifndef USTERR_H
-#define USTERR_H
-
-#include <string.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <errno.h>
-#include <stdarg.h>
-
-#include "share.h"
-
-#ifndef UST_COMPONENT
-//#error UST_COMPONENT is undefined
-#define UST_COMPONENT libust
-#endif
-
-/* To stringify the expansion of a define */
-#define XSTR(d) STR(d)
-#define STR(s) #s
-
-/* We sometimes print in the tracing path, and tracing can occur in
- * signal handlers, so we must use a print method which is signal safe.
- */
-
-#define sigsafe_print_err(fmt, args...) \
-{ \
- /* Can't use dynamic allocation. Limit ourselves to 250 chars. */ \
- char ____buf[250]; \
- int ____saved_errno; \
-\
- /* Save the errno. */ \
- ____saved_errno = errno; \
-\
- snprintf(____buf, sizeof(____buf), fmt, ## args); \
-\
- /* Add end of string in case of buffer overflow. */ \
- ____buf[sizeof(____buf)-1] = 0; \
-\
- patient_write(STDERR_FILENO, ____buf, strlen(____buf)); \
- /* Can't print errors because we are in the error printing code path. */ \
-\
- /* Restore errno, in order to be async-signal safe. */ \
- errno = ____saved_errno; \
-}
-
-#define UST_STR_COMPONENT XSTR(UST_COMPONENT)
-
-#define ERRMSG(fmt, args...) do { sigsafe_print_err(UST_STR_COMPONENT "[%ld/%ld]: " fmt " (" __FILE__ ":" XSTR(__LINE__) ")\n", (long) getpid(), (long) syscall(SYS_gettid), ## args); fflush(stderr); } while(0)
-
-#define DEBUG
-#ifdef DEBUG
-# define DBG(fmt, args...) ERRMSG(fmt, ## args)
-#else
-# define DBG(fmt, args...) do {} while(0)
-#endif
-#define WARN(fmt, args...) ERRMSG("Warning: " fmt, ## args)
-#define ERR(fmt, args...) ERRMSG("Error: " fmt, ## args)
-#define BUG(fmt, args...) ERRMSG("BUG: " fmt, ## args)
-
-#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)
-#define PERROR(call, args...)\
- do { \
- char buf[200] = "Error in strerror_r()"; \
- strerror_r(errno, buf, sizeof(buf)); \
- ERRMSG("Error: " call ": %s", ## args, buf); \
- } while(0);
-#else
-#define PERROR(call, args...)\
- do { \
- char *buf; \
- char tmp[200]; \
- buf = strerror_r(errno, tmp, sizeof(tmp)); \
- ERRMSG("Error: " call ": %s", ## args, buf); \
- } while(0);
-#endif
-
-#define BUG_ON(condition) do { if (unlikely(condition)) ERR("condition not respected (BUG)"); } while(0)
-#define WARN_ON(condition) do { if (unlikely(condition)) WARN("condition not respected on line %s:%d", __FILE__, __LINE__); } while(0)
-
-#endif /* USTERR_H */
-INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(top_builddir)/include
noinst_PROGRAMS = basic
basic_SOURCES = basic.c
-INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(top_builddir)/include
noinst_PROGRAMS = basic_long
basic_long_SOURCES = basic_long.c
-INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(top_builddir)/include
noinst_PROGRAMS = fork fork2
fork_SOURCES = fork.c
-INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(top_builddir)/include
noinst_PROGRAMS = hello
hello_SOURCES = hello.c tp.c tp.h
#include <signal.h>
#include <ust/marker.h>
+#include "usterr.h"
#include "tp.h"
-INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(top_builddir)/include
noinst_PROGRAMS = hello2
hello2_SOURCES = hello2.c
+AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_builddir)/libustcomm \
+ -I$(top_builddir)/libustcmd $(KCOMPAT_CFLAGS)
+
bin_PROGRAMS = ustctl
-ustctl_SOURCES = ustctl.c $(top_builddir)/libustcomm/ustcomm.c $(top_builddir)/libustcomm/ustcomm.h $(top_builddir)/libustcmd/ustcmd.c $(top_builddir)/libustcmd/ustcmd.h $(top_builddir)/share/usterr.h
+ustctl_SOURCES = ustctl.c $(top_builddir)/libustcomm/ustcomm.c $(top_builddir)/libustcomm/ustcomm.h $(top_builddir)/libustcmd/ustcmd.c $(top_builddir)/libustcmd/ustcmd.h
ustctl_CFLAGS = -DUST_COMPONENT=ustctl
-INCLUDES = $(KCOMPAT_CFLAGS)
-INCLUDES += -I$(top_builddir)/libustcomm
-INCLUDES += -I$(top_builddir)/libustcmd
-INCLUDES += -I$(top_builddir)/share
-AM_CPPFLAGS = -I$(top_builddir)/share -I$(top_builddir)/libust \
- -I$(top_builddir)/libustcomm -I$(top_builddir)/include
+AM_CPPFLAGS = -I$(top_builddir)/libust -I$(top_builddir)/libustcomm \
+ -I$(top_builddir)/include
bin_PROGRAMS = ustd
-ustd_SOURCES = lowlevel.c ustd.c ustd.h $(top_builddir)/libustcomm/ustcomm.c $(top_builddir)/libustcomm/ustcomm.h $(top_builddir)/share/usterr.h
+ustd_SOURCES = lowlevel.c ustd.c ustd.h $(top_builddir)/libustcomm/ustcomm.c $(top_builddir)/libustcomm/ustcomm.h
ustd_LDFLAGS = -lpthread
ustd_CFLAGS = -DUST_COMPONENT=ustd
#include "ustd.h"
#include "usterr.h"
#include "ustcomm.h"
-#include "share.h"
/* return value: 0 = subbuffer is finished, it won't produce data anymore
* 1 = got subbuffer successfully