update usertrade to support g++
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 23 Aug 2006 18:01:50 +0000 (18:01 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 23 Aug 2006 18:01:50 +0000 (18:01 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2043 04897980-b3bd-0310-b5e0-8ef037075253

12 files changed:
ltt-usertrace/ltt/atomic-ppc.h
ltt-usertrace/ltt/atomic-ppc64.h
ltt-usertrace/ltt/kernelutils-i386.h
ltt-usertrace/ltt/kernelutils-x86_64.h
ltt-usertrace/ltt/ltt-facility-custom-user_generic.h
ltt-usertrace/ltt/ltt-facility-user_generic.h
ltt-usertrace/ltt/ltt-usertrace-fast.h
ltt-usertrace/ltt/ltt-usertrace.h
ltt-usertrace/ltt/ppc_asm-ppc.h
ltt-usertrace/ltt/system-ppc.h
ltt-usertrace/ltt/system-ppc64.h
ltt-usertrace/ltt/timex-ppc.h

index ecd1f7571226054c8f0aec7638d49902e9b55fa1..d72731b9d98130406e3a4a5b6942a86522b2d1e2 100644 (file)
@@ -5,6 +5,10 @@
 #ifndef _ASM_PPC_ATOMIC_H_
 #define _ASM_PPC_ATOMIC_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct { volatile int counter; } atomic_t;
 
 #define ATOMIC_INIT(i) { (i) }
@@ -208,4 +212,8 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
 #define smp_mb__before_atomic_inc()    __MB
 #define smp_mb__after_atomic_inc()     __MB
 
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
 #endif /* _ASM_PPC_ATOMIC_H_ */
index 0e5f25e83bc0f7445a829ab22126a1a672214bb4..5de019862803807f19e58fdab5460baaffdc5f33 100644 (file)
 
 #include <asm/memory.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct { volatile int counter; } atomic_t;
 
 #define ATOMIC_INIT(i) { (i) }
@@ -194,4 +198,8 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
 #define smp_mb__before_atomic_inc()     smp_mb()
 #define smp_mb__after_atomic_inc()      smp_mb()
 
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
 #endif /* _ASM_PPC64_ATOMIC_H_ */
index df7e695d21c9919fe3ca69976da4762fd47178db..6c13f12d06b9afee19812d282d2b99d6c2058ea4 100644 (file)
 #ifndef _KERNELUTILS_I386_H
 #define _KERNELUTILS_I386_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 // We are careful, so we assume a possibly SMP machine
 #define LOCK "lock ; "
 #define LOCK_PREFIX "lock ; "
 
 
-
-
 // From atomic.h
 
 
@@ -106,26 +108,26 @@ struct __xchg_dummy { unsigned long a[100]; };
                                        (unsigned long)(n),sizeof(*(ptr))))
 
 static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
-                                     unsigned long new, int size)
+                                     unsigned long newval, int size)
 {
        unsigned long prev;
        switch (size) {
        case 1:
                __asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
                                     : "=a"(prev)
-                                    : "q"(new), "m"(*__xg(ptr)), "0"(old)
+                                    : "q"(newval), "m"(*__xg(ptr)), "0"(old)
                                     : "memory");
                return prev;
        case 2:
                __asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
                                     : "=a"(prev)
-                                    : "r"(new), "m"(*__xg(ptr)), "0"(old)
+                                    : "r"(newval), "m"(*__xg(ptr)), "0"(old)
                                     : "memory");
                return prev;
        case 4:
                __asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
                                     : "=a"(prev)
-                                    : "r"(new), "m"(*__xg(ptr)), "0"(old)
+                                    : "r"(newval), "m"(*__xg(ptr)), "0"(old)
                                     : "memory");
                return prev;
        }
@@ -150,5 +152,8 @@ static inline cycles_t get_cycles (void)
        return ret;
 }
 
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
 
 #endif // _KERNELUTILS_I386_H
index 4f2ec2f7e2444352afa780f7d63df42a00a36b80..4141bd11f54009f84429482fd1297d8082ecb08f 100644 (file)
 #ifndef _KERNELUTILS_X86_64_H
 #define _KERNELUTILS_X86_64_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 // We are careful, so we assume a possibly SMP machine
 #define LOCK "lock ; "
 #define LOCK_PREFIX "lock ; "
@@ -164,5 +168,8 @@ static inline cycles_t get_cycles (void)
        return ret;
 }
 
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
 
 #endif // _KERNELUTILS_X86_64_H
index c819e3aa597564077b509a7f5f31a4fd28156fec..a958d4bc0b7dbfe772479404ba19a613d72ac3de 100644 (file)
@@ -8,6 +8,10 @@
 #include <stdlib.h>
 #include <stdarg.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 static int trace_user_generic_slow_printf(
                const char *fmt, ...)
 #ifndef LTT_TRACE
@@ -50,4 +54,8 @@ static int trace_user_generic_slow_printf(
 }
 #endif //LTT_TRACE
 
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
 #endif //_LTT_FACILITY_CUSTOM_USER_GENERIC_H_
index d94ace9adebc920f95cf40bcb18c60260655854e..40e58b85a0d06b5eeb01dc4d696c2555403532ef 100644 (file)
@@ -5,14 +5,18 @@
 #include <ltt/ltt-facility-id-user_generic.h>
 #include <ltt/ltt-usertrace.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Named types */
 
 /* Event string structures */
 static inline void lttng_write_string_user_generic_string_data(
-               void *buffer,
+               char *buffer,
                size_t *to_base,
                size_t *to,
-               const void **from,
+               const char **from,
                size_t *len,
                const char * obj)
 {
@@ -53,6 +57,9 @@ static inline void lttng_write_string_user_generic_string_data(
 
 
 /* Event string logging function */
+static inline int trace_user_generic_string(
+               const char * lttng_param_data);
+
 #ifndef LTT_TRACE_FAST
 static inline int trace_user_generic_string(
                const char * lttng_param_data)
@@ -62,7 +69,7 @@ static inline int trace_user_generic_string(
 #else
 {
        int ret = 0;
-       void *buffer = NULL;
+       char *buffer = NULL;
        size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
        size_t *to_base = &real_to_base;
        size_t real_to = 0;
@@ -71,14 +78,14 @@ static inline int trace_user_generic_string(
        size_t *len = &real_len;
        size_t reserve_size;
        size_t slot_size;
-       const void *real_from;
-       const void **from = &real_from;
+       const char *real_from;
+       const char **from = &real_from;
                /* For each field, calculate the field size. */
        /* size = *to_base + *to + *len */
        /* Assume that the padding for alignment starts at a
         * sizeof(void *) address. */
 
-       *from = lttng_param_data;
+       *from = (const char*)lttng_param_data;
        lttng_write_string_user_generic_string_data(buffer, to_base, to, from, len, lttng_param_data);
 
        reserve_size = *to_base + *to + *len;
@@ -88,7 +95,7 @@ static inline int trace_user_generic_string(
 
                *to_base = *to = *len = 0;
 
-               *from = lttng_param_data;
+               *from = (const char*)lttng_param_data;
                lttng_write_string_user_generic_string_data(buffer, to_base, to, from, len, lttng_param_data);
 
                /* Flush pending memcpy */
@@ -118,7 +125,7 @@ static inline int trace_user_generic_string(
        unsigned int index;
        struct ltt_trace_info *trace = thread_trace_info;
        struct ltt_buf *ltt_buf;
-       void *buffer = NULL;
+       char *buffer = NULL;
        size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
        size_t *to_base = &real_to_base;
        size_t real_to = 0;
@@ -127,8 +134,8 @@ static inline int trace_user_generic_string(
        size_t *len = &real_len;
        size_t reserve_size;
        size_t slot_size;
-       const void *real_from;
-       const void **from = &real_from;
+       const char *real_from;
+       const char **from = &real_from;
        uint64_t tsc;
        size_t before_hdr_pad, after_hdr_pad, header_size;
 
@@ -143,7 +150,7 @@ static inline int trace_user_generic_string(
        /* Assume that the padding for alignment starts at a
         * sizeof(void *) address. */
 
-       *from = lttng_param_data;
+       *from = (const char*)lttng_param_data;
        lttng_write_string_user_generic_string_data(buffer, to_base, to, from, len, lttng_param_data);
 
        reserve_size = *to_base + *to + *len;
@@ -166,7 +173,7 @@ static inline int trace_user_generic_string(
                        reserve_size, before_hdr_pad, tsc);
                *to_base += before_hdr_pad + after_hdr_pad + header_size;
 
-               *from = lttng_param_data;
+               *from = (const char*)lttng_param_data;
                lttng_write_string_user_generic_string_data(buffer, to_base, to, from, len, lttng_param_data);
 
                /* Flush pending memcpy */
@@ -188,10 +195,10 @@ end:
 
 /* Event string_pointer structures */
 static inline void lttng_write_string_user_generic_string_pointer_string(
-               void *buffer,
+               char *buffer,
                size_t *to_base,
                size_t *to,
-               const void **from,
+               const char **from,
                size_t *len,
                const char * obj)
 {
@@ -232,6 +239,10 @@ static inline void lttng_write_string_user_generic_string_pointer_string(
 
 
 /* Event string_pointer logging function */
+static inline int trace_user_generic_string_pointer(
+               const char * lttng_param_string,
+               const void * lttng_param_pointer);
+
 #ifndef LTT_TRACE_FAST
 static inline int trace_user_generic_string_pointer(
                const char * lttng_param_string,
@@ -242,7 +253,7 @@ static inline int trace_user_generic_string_pointer(
 #else
 {
        int ret = 0;
-       void *buffer = NULL;
+       char *buffer = NULL;
        size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
        size_t *to_base = &real_to_base;
        size_t real_to = 0;
@@ -252,17 +263,17 @@ static inline int trace_user_generic_string_pointer(
        size_t reserve_size;
        size_t slot_size;
        size_t align;
-       const void *real_from;
-       const void **from = &real_from;
+       const char *real_from;
+       const char **from = &real_from;
                /* For each field, calculate the field size. */
        /* size = *to_base + *to + *len */
        /* Assume that the padding for alignment starts at a
         * sizeof(void *) address. */
 
-       *from = lttng_param_string;
+       *from = (const char*)lttng_param_string;
        lttng_write_string_user_generic_string_pointer_string(buffer, to_base, to, from, len, lttng_param_string);
 
-       *from = &lttng_param_pointer;
+       *from = (const char*)&lttng_param_pointer;
        align = sizeof(const void *);
 
        if(*len == 0) {
@@ -280,7 +291,7 @@ static inline int trace_user_generic_string_pointer(
 
                *to_base = *to = *len = 0;
 
-               *from = lttng_param_string;
+               *from = (const char*)lttng_param_string;
                lttng_write_string_user_generic_string_pointer_string(buffer, to_base, to, from, len, lttng_param_string);
 
                /* Flush pending memcpy */
@@ -290,7 +301,7 @@ static inline int trace_user_generic_string_pointer(
                        *len = 0;
                }
 
-               *from = &lttng_param_pointer;
+               *from = (const char*)&lttng_param_pointer;
                align = sizeof(const void *);
 
                if(*len == 0) {
@@ -329,7 +340,7 @@ static inline int trace_user_generic_string_pointer(
        unsigned int index;
        struct ltt_trace_info *trace = thread_trace_info;
        struct ltt_buf *ltt_buf;
-       void *buffer = NULL;
+       char *buffer = NULL;
        size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
        size_t *to_base = &real_to_base;
        size_t real_to = 0;
@@ -339,8 +350,8 @@ static inline int trace_user_generic_string_pointer(
        size_t reserve_size;
        size_t slot_size;
        size_t align;
-       const void *real_from;
-       const void **from = &real_from;
+       const char *real_from;
+       const char **from = &real_from;
        uint64_t tsc;
        size_t before_hdr_pad, after_hdr_pad, header_size;
 
@@ -355,10 +366,10 @@ static inline int trace_user_generic_string_pointer(
        /* Assume that the padding for alignment starts at a
         * sizeof(void *) address. */
 
-       *from = lttng_param_string;
+       *from = (const char*)lttng_param_string;
        lttng_write_string_user_generic_string_pointer_string(buffer, to_base, to, from, len, lttng_param_string);
 
-       *from = &lttng_param_pointer;
+       *from = (const char*)&lttng_param_pointer;
        align = sizeof(const void *);
 
        if(*len == 0) {
@@ -389,7 +400,7 @@ static inline int trace_user_generic_string_pointer(
                        reserve_size, before_hdr_pad, tsc);
                *to_base += before_hdr_pad + after_hdr_pad + header_size;
 
-               *from = lttng_param_string;
+               *from = (const char*)lttng_param_string;
                lttng_write_string_user_generic_string_pointer_string(buffer, to_base, to, from, len, lttng_param_string);
 
                /* Flush pending memcpy */
@@ -399,7 +410,7 @@ static inline int trace_user_generic_string_pointer(
                        *len = 0;
                }
 
-               *from = &lttng_param_pointer;
+               *from = (const char*)&lttng_param_pointer;
                align = sizeof(const void *);
 
                if(*len == 0) {
@@ -429,10 +440,10 @@ end:
 
 /* Event slow_printf structures */
 static inline void lttng_write_string_user_generic_slow_printf_string(
-               void *buffer,
+               char *buffer,
                size_t *to_base,
                size_t *to,
-               const void **from,
+               const char **from,
                size_t *len,
                const char * obj)
 {
@@ -473,9 +484,13 @@ static inline void lttng_write_string_user_generic_slow_printf_string(
 
 
 /* Event slow_printf logging function */
+static inline int trace_user_generic_slow_printf_param_buffer(
+               char *buffer,
+               size_t reserve_size);
+
 #ifndef LTT_TRACE_FAST
 static inline int trace_user_generic_slow_printf_param_buffer(
-               void *buffer,
+               char *buffer,
                size_t reserve_size)
 #ifndef LTT_TRACE
 {
@@ -505,7 +520,7 @@ static inline int trace_user_generic_slow_printf(
        unsigned int index;
        struct ltt_trace_info *trace = thread_trace_info;
        struct ltt_buf *ltt_buf;
-       void *buffer = NULL;
+       char *buffer = NULL;
        size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
        size_t *to_base = &real_to_base;
        size_t real_to = 0;
@@ -514,8 +529,8 @@ static inline int trace_user_generic_slow_printf(
        size_t *len = &real_len;
        size_t reserve_size;
        size_t slot_size;
-       const void *real_from;
-       const void **from = &real_from;
+       const char *real_from;
+       const char **from = &real_from;
        uint64_t tsc;
        size_t before_hdr_pad, after_hdr_pad, header_size;
 
@@ -530,7 +545,7 @@ static inline int trace_user_generic_slow_printf(
        /* Assume that the padding for alignment starts at a
         * sizeof(void *) address. */
 
-       *from = lttng_param_string;
+       *from = (const char*)lttng_param_string;
        lttng_write_string_user_generic_slow_printf_string(buffer, to_base, to, from, len, lttng_param_string);
 
        reserve_size = *to_base + *to + *len;
@@ -553,7 +568,7 @@ static inline int trace_user_generic_slow_printf(
                        reserve_size, before_hdr_pad, tsc);
                *to_base += before_hdr_pad + after_hdr_pad + header_size;
 
-               *from = lttng_param_string;
+               *from = (const char*)lttng_param_string;
                lttng_write_string_user_generic_slow_printf_string(buffer, to_base, to, from, len, lttng_param_string);
 
                /* Flush pending memcpy */
@@ -576,8 +591,12 @@ end:
 /* Event function_entry structures */
 
 /* Event function_entry logging function */
-#ifndef LTT_TRACE_FAST
 static inline __attribute__((no_instrument_function)) int trace_user_generic_function_entry(
+               const void * lttng_param_this_fn,
+               const void * lttng_param_call_site);
+
+#ifndef LTT_TRACE_FAST
+static inline int trace_user_generic_function_entry(
                const void * lttng_param_this_fn,
                const void * lttng_param_call_site)
 #ifndef LTT_TRACE
@@ -586,7 +605,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
 #else
 {
        int ret = 0;
-       void *buffer = NULL;
+       char *buffer = NULL;
        size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
        size_t *to_base = &real_to_base;
        size_t real_to = 0;
@@ -596,14 +615,14 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
        size_t reserve_size;
        size_t slot_size;
        size_t align;
-       const void *real_from;
-       const void **from = &real_from;
+       const char *real_from;
+       const char **from = &real_from;
                /* For each field, calculate the field size. */
        /* size = *to_base + *to + *len */
        /* Assume that the padding for alignment starts at a
         * sizeof(void *) address. */
 
-       *from = &lttng_param_this_fn;
+       *from = (const char*)&lttng_param_this_fn;
        align = sizeof(const void *);
 
        if(*len == 0) {
@@ -614,7 +633,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
 
        *len += sizeof(const void *);
 
-       *from = &lttng_param_call_site;
+       *from = (const char*)&lttng_param_call_site;
        align = sizeof(const void *);
 
        if(*len == 0) {
@@ -632,7 +651,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
 
                *to_base = *to = *len = 0;
 
-               *from = &lttng_param_this_fn;
+               *from = (const char*)&lttng_param_this_fn;
                align = sizeof(const void *);
 
                if(*len == 0) {
@@ -650,7 +669,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
                        *len = 0;
                }
 
-               *from = &lttng_param_call_site;
+               *from = (const char*)&lttng_param_call_site;
                align = sizeof(const void *);
 
                if(*len == 0) {
@@ -689,7 +708,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
        unsigned int index;
        struct ltt_trace_info *trace = thread_trace_info;
        struct ltt_buf *ltt_buf;
-       void *buffer = NULL;
+       char *buffer = NULL;
        size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
        size_t *to_base = &real_to_base;
        size_t real_to = 0;
@@ -699,8 +718,8 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
        size_t reserve_size;
        size_t slot_size;
        size_t align;
-       const void *real_from;
-       const void **from = &real_from;
+       const char *real_from;
+       const char **from = &real_from;
        uint64_t tsc;
        size_t before_hdr_pad, after_hdr_pad, header_size;
 
@@ -715,7 +734,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
        /* Assume that the padding for alignment starts at a
         * sizeof(void *) address. */
 
-       *from = &lttng_param_this_fn;
+       *from = (const char*)&lttng_param_this_fn;
        align = sizeof(const void *);
 
        if(*len == 0) {
@@ -726,7 +745,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
 
        *len += sizeof(const void *);
 
-       *from = &lttng_param_call_site;
+       *from = (const char*)&lttng_param_call_site;
        align = sizeof(const void *);
 
        if(*len == 0) {
@@ -757,7 +776,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
                        reserve_size, before_hdr_pad, tsc);
                *to_base += before_hdr_pad + after_hdr_pad + header_size;
 
-               *from = &lttng_param_this_fn;
+               *from = (const char*)&lttng_param_this_fn;
                align = sizeof(const void *);
 
                if(*len == 0) {
@@ -775,7 +794,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
                        *len = 0;
                }
 
-               *from = &lttng_param_call_site;
+               *from = (const char*)&lttng_param_call_site;
                align = sizeof(const void *);
 
                if(*len == 0) {
@@ -806,8 +825,12 @@ end:
 /* Event function_exit structures */
 
 /* Event function_exit logging function */
-#ifndef LTT_TRACE_FAST
 static inline __attribute__((no_instrument_function)) int trace_user_generic_function_exit(
+               const void * lttng_param_this_fn,
+               const void * lttng_param_call_site);
+
+#ifndef LTT_TRACE_FAST
+static inline int trace_user_generic_function_exit(
                const void * lttng_param_this_fn,
                const void * lttng_param_call_site)
 #ifndef LTT_TRACE
@@ -816,7 +839,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
 #else
 {
        int ret = 0;
-       void *buffer = NULL;
+       char *buffer = NULL;
        size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
        size_t *to_base = &real_to_base;
        size_t real_to = 0;
@@ -826,14 +849,14 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
        size_t reserve_size;
        size_t slot_size;
        size_t align;
-       const void *real_from;
-       const void **from = &real_from;
+       const char *real_from;
+       const char **from = &real_from;
                /* For each field, calculate the field size. */
        /* size = *to_base + *to + *len */
        /* Assume that the padding for alignment starts at a
         * sizeof(void *) address. */
 
-       *from = &lttng_param_this_fn;
+       *from = (const char*)&lttng_param_this_fn;
        align = sizeof(const void *);
 
        if(*len == 0) {
@@ -844,7 +867,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
 
        *len += sizeof(const void *);
 
-       *from = &lttng_param_call_site;
+       *from = (const char*)&lttng_param_call_site;
        align = sizeof(const void *);
 
        if(*len == 0) {
@@ -862,7 +885,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
 
                *to_base = *to = *len = 0;
 
-               *from = &lttng_param_this_fn;
+               *from = (const char*)&lttng_param_this_fn;
                align = sizeof(const void *);
 
                if(*len == 0) {
@@ -880,7 +903,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
                        *len = 0;
                }
 
-               *from = &lttng_param_call_site;
+               *from = (const char*)&lttng_param_call_site;
                align = sizeof(const void *);
 
                if(*len == 0) {
@@ -919,7 +942,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
        unsigned int index;
        struct ltt_trace_info *trace = thread_trace_info;
        struct ltt_buf *ltt_buf;
-       void *buffer = NULL;
+       char *buffer = NULL;
        size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
        size_t *to_base = &real_to_base;
        size_t real_to = 0;
@@ -929,8 +952,8 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
        size_t reserve_size;
        size_t slot_size;
        size_t align;
-       const void *real_from;
-       const void **from = &real_from;
+       const char *real_from;
+       const char **from = &real_from;
        uint64_t tsc;
        size_t before_hdr_pad, after_hdr_pad, header_size;
 
@@ -945,7 +968,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
        /* Assume that the padding for alignment starts at a
         * sizeof(void *) address. */
 
-       *from = &lttng_param_this_fn;
+       *from = (const char*)&lttng_param_this_fn;
        align = sizeof(const void *);
 
        if(*len == 0) {
@@ -956,7 +979,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
 
        *len += sizeof(const void *);
 
-       *from = &lttng_param_call_site;
+       *from = (const char*)&lttng_param_call_site;
        align = sizeof(const void *);
 
        if(*len == 0) {
@@ -987,7 +1010,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
                        reserve_size, before_hdr_pad, tsc);
                *to_base += before_hdr_pad + after_hdr_pad + header_size;
 
-               *from = &lttng_param_this_fn;
+               *from = (const char*)&lttng_param_this_fn;
                align = sizeof(const void *);
 
                if(*len == 0) {
@@ -1005,7 +1028,7 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun
                        *len = 0;
                }
 
-               *from = &lttng_param_call_site;
+               *from = (const char*)&lttng_param_call_site;
                align = sizeof(const void *);
 
                if(*len == 0) {
@@ -1035,10 +1058,10 @@ end:
 
 /* Event thread_brand structures */
 static inline void lttng_write_string_user_generic_thread_brand_name(
-               void *buffer,
+               char *buffer,
                size_t *to_base,
                size_t *to,
-               const void **from,
+               const char **from,
                size_t *len,
                const char * obj)
 {
@@ -1079,6 +1102,9 @@ static inline void lttng_write_string_user_generic_thread_brand_name(
 
 
 /* Event thread_brand logging function */
+static inline int trace_user_generic_thread_brand(
+               const char * lttng_param_name);
+
 #ifndef LTT_TRACE_FAST
 static inline int trace_user_generic_thread_brand(
                const char * lttng_param_name)
@@ -1088,7 +1114,7 @@ static inline int trace_user_generic_thread_brand(
 #else
 {
        int ret = 0;
-       void *buffer = NULL;
+       char *buffer = NULL;
        size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
        size_t *to_base = &real_to_base;
        size_t real_to = 0;
@@ -1097,14 +1123,14 @@ static inline int trace_user_generic_thread_brand(
        size_t *len = &real_len;
        size_t reserve_size;
        size_t slot_size;
-       const void *real_from;
-       const void **from = &real_from;
+       const char *real_from;
+       const char **from = &real_from;
                /* For each field, calculate the field size. */
        /* size = *to_base + *to + *len */
        /* Assume that the padding for alignment starts at a
         * sizeof(void *) address. */
 
-       *from = lttng_param_name;
+       *from = (const char*)lttng_param_name;
        lttng_write_string_user_generic_thread_brand_name(buffer, to_base, to, from, len, lttng_param_name);
 
        reserve_size = *to_base + *to + *len;
@@ -1114,7 +1140,7 @@ static inline int trace_user_generic_thread_brand(
 
                *to_base = *to = *len = 0;
 
-               *from = lttng_param_name;
+               *from = (const char*)lttng_param_name;
                lttng_write_string_user_generic_thread_brand_name(buffer, to_base, to, from, len, lttng_param_name);
 
                /* Flush pending memcpy */
@@ -1144,7 +1170,7 @@ static inline int trace_user_generic_thread_brand(
        unsigned int index;
        struct ltt_trace_info *trace = thread_trace_info;
        struct ltt_buf *ltt_buf;
-       void *buffer = NULL;
+       char *buffer = NULL;
        size_t real_to_base = 0; /* The buffer is allocated on arch_size alignment */
        size_t *to_base = &real_to_base;
        size_t real_to = 0;
@@ -1153,8 +1179,8 @@ static inline int trace_user_generic_thread_brand(
        size_t *len = &real_len;
        size_t reserve_size;
        size_t slot_size;
-       const void *real_from;
-       const void **from = &real_from;
+       const char *real_from;
+       const char **from = &real_from;
        uint64_t tsc;
        size_t before_hdr_pad, after_hdr_pad, header_size;
 
@@ -1169,7 +1195,7 @@ static inline int trace_user_generic_thread_brand(
        /* Assume that the padding for alignment starts at a
         * sizeof(void *) address. */
 
-       *from = lttng_param_name;
+       *from = (const char*)lttng_param_name;
        lttng_write_string_user_generic_thread_brand_name(buffer, to_base, to, from, len, lttng_param_name);
 
        reserve_size = *to_base + *to + *len;
@@ -1192,7 +1218,7 @@ static inline int trace_user_generic_thread_brand(
                        reserve_size, before_hdr_pad, tsc);
                *to_base += before_hdr_pad + after_hdr_pad + header_size;
 
-               *from = lttng_param_name;
+               *from = (const char*)lttng_param_name;
                lttng_write_string_user_generic_thread_brand_name(buffer, to_base, to, from, len, lttng_param_name);
 
                /* Flush pending memcpy */
@@ -1212,4 +1238,8 @@ end:
 #endif //LTT_TRACE
 #endif //LTT_TRACE_FAST
 
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
 #endif //_LTT_FACILITY_USER_GENERIC_H_
index bfca0c10d5b994b4df5292bb02c7481e8ea1a865..b90a100629b43d221f156cb1ef061a1eaeaaad23 100644 (file)
 
 #include <ltt/ltt-facility-id-user_generic.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifndef        LTT_N_SUBBUFS
 #define LTT_N_SUBBUFS 2
 #endif //LTT_N_SUBBUFS
@@ -622,7 +626,10 @@ static inline void __attribute__((no_instrument_function)) ltt_commit_slot(
                ltt_deliver_callback(ltt_buf, SUBBUF_INDEX(offset_begin, ltt_buf), NULL);
        }
 }
-       
+
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
 
 #endif //LTT_TRACE_FAST
 #endif //LTT_TRACE
index d4d8861322dc3cc1d873e3e2ab420d0241d8ccde..4416da45fe9290f7b204f5d82d44c3d59ab23feb 100644 (file)
 #include <stdint.h>
 #include <sys/types.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 #define inline inline __attribute__((always_inline))
 
 #if defined(__powerpc__) || defined(__powerpc64__)
@@ -110,9 +115,12 @@ _syscall2(int, ltt_register_generic, unsigned int *, facility_id,
 #define ltt_register_generic(...)  syscall(__NR_ltt_register_generic, __VA_ARGS__)
 #define ltt_trace_generic(...)  syscall(__NR_ltt_trace_generic, __VA_ARGS__)
 
+static inline unsigned int __attribute__((no_instrument_function)) 
+       ltt_align(size_t align_drift, size_t size_of_type);
+
 #ifndef LTT_PACK
 /* Calculate the offset needed to align the type */
-static inline unsigned int __attribute__((no_instrument_function))
+static inline unsigned int
        ltt_align(size_t align_drift, size_t size_of_type)
 {
   size_t alignment = min(sizeof(void*), size_of_type);
@@ -121,19 +129,19 @@ static inline unsigned int __attribute__((no_instrument_function))
 }
 #define LTT_ALIGN
 #else
-static inline unsigned int __attribute__((no_instrument_function))
-                                                                                                               ltt_align(size_t align_drift,
-                                      size_t size_of_type)
+static inline unsigned int ltt_align(size_t align_drift, size_t size_of_type)
 {
   return 0;
 }
 #define LTT_ALIGN __attribute__((packed))
 #endif //LTT_PACK
 
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
 #ifdef LTT_TRACE_FAST
 #include <ltt/ltt-usertrace-fast.h>
 #endif //LTT_TRACE_FAST
 
 #endif //_LTT_USERTRACE_H
-
-
index e625aed0a3f2b45deb03d415d57cd7d38a8ded30..f83252aedf570319fbb76368357043300cd20ceb 100644 (file)
  *  2 of the License, or (at your option) any later version.
  */
 
+#ifndef _PPC_ASM_PPC_H
+#define _PPC_ASM_PPC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Macros for storing registers into and loading registers from
  * exception frames.
@@ -340,3 +347,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
 #define N_RSYM 64
 #define N_SLINE        68
 #define N_SO   100
+
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
+#endif //_PPC_ASM_PPC_H
index a4498e758938aa0bb32b5f5b75fea8edf73b18e2..bb842f1a1ceec8af1c13dab5835d926b7b438d12 100644 (file)
@@ -7,6 +7,10 @@
 #include <asm/atomic.h>
 #include <asm/hw_irq.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * Memory barrier.
  * The sync instruction guarantees that all memory accesses initiated
@@ -147,4 +151,8 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
 
 #define arch_align_stack(x) (x)
 
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
 #endif /* __PPC_SYSTEM_H */
index 0d28bc9cb7b0194c8f56c588ee16f226341085e9..022ef9206af4c013b3f1e481f3af401c363dc204 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef __PPC64_SYSTEM_H
 #define __PPC64_SYSTEM_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -211,4 +215,8 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
 
 #define arch_align_stack(x) (x)
 
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
 #endif
index 2449907a989ac1f63d1093248428c3af0fe3fabf..37eda9dbb4a64de6bfcbad86096aab816878c0e9 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef __TIMEX_PPC_H
 #define __TIMEX_PPC_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define CPU_FTR_601                    0x00000100
 
 #define CLOCK_TICK_RATE        1193180 /* Underlying HZ */
@@ -50,4 +54,8 @@ static inline cycles_t get_cycles(void)
        return get_tb();
 }
 
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
 #endif //__TIMEX_PPC_H
This page took 0.03938 seconds and 4 git commands to generate.