start applying warning fixes from Jan Blunck
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Fri, 12 Jun 2009 17:59:45 +0000 (13:59 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Fri, 12 Jun 2009 17:59:45 +0000 (13:59 -0400)
libust/marker.h
libust/relay.c
libust/serialize.c
libust/tracectl.c
libust/tracepoint.h
ust/ust.c

index 122fca72993b90f60d9c06e950baeddf909e21c1..3a86ac3732c4e5924aa6bd776c77fda8edcf6616 100644 (file)
@@ -65,7 +65,8 @@ struct marker {
        void *tp_cb;            /* Optional tracepoint callback */
 } __attribute__((aligned(8)));
 
-//ust// #ifdef CONFIG_MARKERS
+#define CONFIG_MARKERS
+#ifdef CONFIG_MARKERS
 
 #define _DEFINE_MARKER(channel, name, tp_name_str, tp_cb, format)      \
                static const char __mstrtab_##channel##_##name[]        \
@@ -133,24 +134,24 @@ extern void marker_update_probe_range(struct marker *begin,
 
 #define GET_MARKER(channel, name)      (__mark_##channel##_##name)
 
-//ust// #else /* !CONFIG_MARKERS */
-//ust// #define DEFINE_MARKER(channel, name, tp_name, tp_cb, format)
-//ust// #define __trace_mark(generic, channel, name, call_private, format, args...) \
-//ust//                __mark_check_format(format, ## args)
-//ust// #define __trace_mark_tp(channel, name, call_private, tp_name, tp_cb,   \
-//ust//                format, args...)                                        \
-//ust//        do {                                                            \
-//ust//                void __check_tp_type(void)                              \
-//ust//                {                                                       \
-//ust//                        register_trace_##tp_name(tp_cb);                \
-//ust//                }                                                       \
-//ust//                __mark_check_format(format, ## args);                   \
-//ust//        } while (0)
-//ust// static inline void marker_update_probe_range(struct marker *begin,
-//ust//        struct marker *end)
-//ust// { }
-//ust// #define GET_MARKER(channel, name)
-//ust// #endif /* CONFIG_MARKERS */
+#else /* !CONFIG_MARKERS */
+#define DEFINE_MARKER(channel, name, tp_name, tp_cb, format)
+#define __trace_mark(generic, channel, name, call_private, format, args...) \
+               __mark_check_format(format, ## args)
+#define __trace_mark_tp(channel, name, call_private, tp_name, tp_cb,   \
+               format, args...)                                        \
+       do {                                                            \
+               void __check_tp_type(void)                              \
+               {                                                       \
+                       register_trace_##tp_name(tp_cb);                \
+               }                                                       \
+               __mark_check_format(format, ## args);                   \
+       } while (0)
+static inline void marker_update_probe_range(struct marker *begin,
+       struct marker *end)
+{ }
+#define GET_MARKER(channel, name)
+#endif /* CONFIG_MARKERS */
 
 /**
  * trace_mark - Marker using code patching
@@ -282,10 +283,11 @@ struct lib {
        struct list_head list;
 };
 
-int marker_register_lib(struct marker *markers_start, int markers_count);
+extern int marker_register_lib(struct marker *markers_start,
+                              int markers_count);
 
-#define MARKER_LIB                                                                     \
-extern struct marker __start___markers[] __attribute__((visibility("hidden")));                \
+#define MARKER_LIB                                                     \
+extern struct marker __start___markers[] __attribute__((visibility("hidden")));        \
 extern struct marker __stop___markers[] __attribute__((visibility("hidden")));         \
                                                                                        \
 static void __attribute__((constructor)) __markers__init(void)                                 \
index 4c57424a5ba9392f14b0a93b0bf980c6fb712694..27794f9e5e2070358d2658b1ab0fa86336d56fc9 100644 (file)
@@ -1537,7 +1537,7 @@ static void ltt_chan_alloc_ltt_buf(struct ltt_channel_struct *ltt_chan)
        result = ltt_chan->buf_shmid = shmget(getpid(), size, IPC_CREAT | IPC_EXCL | 0700);
        if(ltt_chan->buf_shmid == -1) {
                PERROR("shmget");
-               return -1;
+               return;
        }
 
        ptr = shmat(ltt_chan->buf_shmid, NULL, 0);
@@ -1552,12 +1552,12 @@ static void ltt_chan_alloc_ltt_buf(struct ltt_channel_struct *ltt_chan)
        result = shmctl(ltt_chan->buf_shmid, IPC_RMID, NULL);
        if(result == -1) {
                perror("shmctl");
-               return -1;
+               return;
        }
 
        ltt_chan->buf = ptr;
 
-       return 0;
+       return;
 
        destroy_shmem:
        result = shmctl(ltt_chan->buf_shmid, IPC_RMID, NULL);
@@ -1565,7 +1565,7 @@ static void ltt_chan_alloc_ltt_buf(struct ltt_channel_struct *ltt_chan)
                perror("shmctl");
        }
 
-       return -1;
+       return;
 }
 
 /*
index 00ba4870821c084476a2f08c735d0aaded30e8d5..04ece912b056f34164663a10e09dd4e4909ebab0 100644 (file)
@@ -676,7 +676,7 @@ notrace void ltt_vtrace(const struct marker *mdata, void *probe_data,
                /* Out-of-order commit */
                ltt_commit_slot(channel, &transport_data, buf_offset,
                                data_size, slot_size);
-               printf("just commited event at offset %d and size %d\n", buf_offset, slot_size);
+               printf("just commited event at offset %ld and size %zd\n", buf_offset, slot_size);
        }
 //ust//        __get_cpu_var(ltt_nesting)--;
        ltt_nesting--;
index e9907fc4b52a93b4de6b70905dc2ebb6a3edb2c9..b32b501ea9683692bbe7fb82d36b1053790b4c61 100644 (file)
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
 #include <stdio.h>
 #include <stdint.h>
 #include <signal.h>
@@ -113,7 +114,7 @@ void notif_cb(void)
        }
 }
 
-static int inform_consumer_daemon(void)
+static void inform_consumer_daemon(void)
 {
        ustcomm_request_consumer(getpid(), "metadata");
        ustcomm_request_consumer(getpid(), "ust");
@@ -148,7 +149,7 @@ void process_blocked_consumers(void)
        result = poll(fds, n_fds, 0);
        if(result == -1) {
                PERROR("poll");
-               return -1;
+               return;
        }
 
        list_for_each_entry(bc, &blocked_consumers, list) {
@@ -200,7 +201,7 @@ void process_blocked_consumers(void)
 
 }
 
-int listener_main(void *p)
+void *listener_main(void *p)
 {
        int result;
 
@@ -252,19 +253,19 @@ int listener_main(void *p)
                        result = ltt_trace_setup(trace_name);
                        if(result < 0) {
                                ERR("ltt_trace_setup failed");
-                               return;
+                               return (void *)1;
                        }
 
                        result = ltt_trace_set_type(trace_name, trace_type);
                        if(result < 0) {
                                ERR("ltt_trace_set_type failed");
-                               return;
+                               return (void *)1;
                        }
 
                        result = ltt_trace_alloc(trace_name);
                        if(result < 0) {
                                ERR("ltt_trace_alloc failed");
-                               return;
+                               return (void *)1;
                        }
 
                        inform_consumer_daemon();
@@ -281,13 +282,13 @@ int listener_main(void *p)
                        result = ltt_trace_setup(trace_name);
                        if(result < 0) {
                                ERR("ltt_trace_setup failed");
-                               return;
+                               return (void *)1;
                        }
 
                        result = ltt_trace_set_type(trace_name, trace_type);
                        if(result < 0) {
                                ERR("ltt_trace_set_type failed");
-                               return;
+                               return (void *)1;
                        }
                }
                else if(!strcmp(recvbuf, "trace_alloc")) {
@@ -296,7 +297,7 @@ int listener_main(void *p)
                        result = ltt_trace_alloc(trace_name);
                        if(result < 0) {
                                ERR("ltt_trace_alloc failed");
-                               return;
+                               return (void *)1;
                        }
                }
                else if(!strcmp(recvbuf, "trace_start")) {
@@ -314,7 +315,7 @@ int listener_main(void *p)
                        result = ltt_trace_stop(trace_name);
                        if(result < 0) {
                                ERR("ltt_trace_stop failed");
-                               return;
+                               return (void *)1;
                        }
                }
                else if(!strcmp(recvbuf, "trace_destroy")) {
@@ -324,7 +325,7 @@ int listener_main(void *p)
                        result = ltt_trace_destroy(trace_name);
                        if(result < 0) {
                                ERR("ltt_trace_destroy failed");
-                               return;
+                               return (void *)1;
                        }
                }
                else if(nth_token_is(recvbuf, "get_shmid", 0) == 1) {
@@ -347,7 +348,7 @@ int listener_main(void *p)
 
                        if(trace == NULL) {
                                CPRINTF("cannot find trace!");
-                               return 1;
+                               return (void *)1;
                        }
 
                        for(i=0; i<trace->nr_channels; i++) {
@@ -395,7 +396,7 @@ int listener_main(void *p)
 
                        if(trace == NULL) {
                                CPRINTF("cannot find trace!");
-                               return 1;
+                               return (void *)1;
                        }
 
                        for(i=0; i<trace->nr_channels; i++) {
@@ -404,8 +405,8 @@ int listener_main(void *p)
                                if(!strcmp(trace->channels[i].channel_name, channel_name)) {
                                        char *reply;
 
-                                       DBG("the n_subbufs for the requested channel is %d", rchan->n_subbufs);
-                                       asprintf(&reply, "%d", rchan->n_subbufs);
+                                       DBG("the n_subbufs for the requested channel is %zd", rchan->n_subbufs);
+                                       asprintf(&reply, "%zd", rchan->n_subbufs);
 
                                        result = ustcomm_send_reply(&ustcomm_app.server, reply, &src);
                                        if(result) {
@@ -439,7 +440,7 @@ int listener_main(void *p)
 
                        if(trace == NULL) {
                                CPRINTF("cannot find trace!");
-                               return 1;
+                               return (void *)1;
                        }
 
                        for(i=0; i<trace->nr_channels; i++) {
@@ -448,8 +449,8 @@ int listener_main(void *p)
                                if(!strcmp(trace->channels[i].channel_name, channel_name)) {
                                        char *reply;
 
-                                       DBG("the subbuf_size for the requested channel is %d", rchan->subbuf_size);
-                                       asprintf(&reply, "%d", rchan->subbuf_size);
+                                       DBG("the subbuf_size for the requested channel is %zd", rchan->subbuf_size);
+                                       asprintf(&reply, "%zd", rchan->subbuf_size);
 
                                        result = ustcomm_send_reply(&ustcomm_app.server, reply, &src);
                                        if(result) {
@@ -490,7 +491,7 @@ int listener_main(void *p)
 
                        if(trace == NULL) {
                                CPRINTF("cannot find trace!");
-                               return 1;
+                               return (void *)1;
                        }
 
                        for(i=0; i<trace->nr_channels; i++) {
@@ -556,7 +557,7 @@ int listener_main(void *p)
 
                        if(trace == NULL) {
                                CPRINTF("cannot find trace!");
-                               return 1;
+                               return (void *)1;
                        }
 
                        for(i=0; i<trace->nr_channels; i++) {
@@ -571,11 +572,11 @@ int listener_main(void *p)
                                        result = ltt_do_put_subbuf(rbuf, lttbuf, consumed_old);
                                        if(result < 0) {
                                                WARN("ltt_do_put_subbuf: error (subbuf=%s)", channel_name);
-                                               asprintf(&reply, "%s", "ERROR", consumed_old);
+                                               asprintf(&reply, "%s", "ERROR");
                                        }
                                        else {
                                                DBG("ltt_do_put_subbuf: success (subbuf=%s)", channel_name);
-                                               asprintf(&reply, "%s", "OK", consumed_old);
+                                               asprintf(&reply, "%s", "OK");
                                        }
 
                                        result = ustcomm_send_reply(&ustcomm_app.server, reply, &src);
@@ -649,7 +650,7 @@ int listener_main(void *p)
 //
 //                     if(trace == NULL) {
 //                             CPRINTF("cannot find trace!");
-//                             return 1;
+//                             return (void *)1;
 //                     }
 //
 //                     for(i=0; i<trace->nr_channels; i++) {
index 81eea625e662ebb1e226b1c44a54c02d8e2679e2..2bfb148e8251f5b1d49124b7ba8b8916c040c1aa 100644 (file)
@@ -28,7 +28,9 @@
 //#include <linux/types.h>
 //#include <linux/rcupdate.h>
 
-//#include "urcu.h"
+#define _LGPL_SOURCE
+#include <urcu.h>
+
 #include "immediate.h"
 #include "kernelcompat.h"
 
@@ -49,7 +51,8 @@ struct tracepoint {
 #define TPPROTO(args...)       args
 #define TPARGS(args...)                args
 
-//ust// #ifdef CONFIG_TRACEPOINTS
+#define CONFIG_TRACEPOINTS
+#ifdef CONFIG_TRACEPOINTS
 
 /*
  * it_func[0] is never NULL because there is at least one element in the array
@@ -126,29 +129,29 @@ struct tracepoint {
 extern void tracepoint_update_probe_range(struct tracepoint *begin,
        struct tracepoint *end);
 
-//ust// #else /* !CONFIG_TRACEPOINTS */
-//ust// #define DECLARE_TRACE(name, proto, args)                               \
-//ust//        static inline void trace_##name(proto)                          \
-//ust//        { }                                                             \
-//ust//        static inline void _trace_##name(proto)                         \
-//ust//        { }                                                             \
-//ust//        static inline int register_trace_##name(void (*probe)(proto))   \
-//ust//        {                                                               \
-//ust//                return -ENOSYS;                                         \
-//ust//        }                                                               \
-//ust//        static inline int unregister_trace_##name(void (*probe)(proto)) \
-//ust//        {                                                               \
-//ust//                return -ENOSYS;                                         \
-//ust//        }
-//ust// 
-//ust// #define DEFINE_TRACE(name)
-//ust// #define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
-//ust// #define EXPORT_TRACEPOINT_SYMBOL(name)
-//ust// 
-//ust// static inline void tracepoint_update_probe_range(struct tracepoint *begin,
-//ust//        struct tracepoint *end)
-//ust// { }
-//ust// #endif /* CONFIG_TRACEPOINTS */
+#else /* !CONFIG_TRACEPOINTS */
+#define DECLARE_TRACE(name, proto, args)                               \
+       static inline void trace_##name(proto)                          \
+       { }                                                             \
+       static inline void _trace_##name(proto)                         \
+       { }                                                             \
+       static inline int register_trace_##name(void (*probe)(proto))   \
+       {                                                               \
+               return -ENOSYS;                                         \
+       }                                                               \
+       static inline int unregister_trace_##name(void (*probe)(proto)) \
+       {                                                               \
+               return -ENOSYS;                                         \
+       }
+
+#define DEFINE_TRACE(name)
+#define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
+#define EXPORT_TRACEPOINT_SYMBOL(name)
+
+static inline void tracepoint_update_probe_range(struct tracepoint *begin,
+       struct tracepoint *end)
+{ }
+#endif /* CONFIG_TRACEPOINTS */
 
 /*
  * Connect a probe to a tracepoint.
@@ -195,12 +198,16 @@ struct tracepoint_lib {
        struct list_head list;
 };
 
-#define TRACEPOINT_LIB                                                                 \
-extern struct tracepoint __start___tracepoints[] __attribute__((visibility("hidden")));                \
-extern struct tracepoint __stop___tracepoints[] __attribute__((visibility("hidden")));         \
-                                                                                       \
-static void __attribute__((constructor)) __tracepoints__init(void)                             \
-{                                                                                      \
-       tracepoint_register_lib(__start___tracepoints, (((long)__stop___tracepoints)-((long)__start___tracepoints))/sizeof(struct tracepoint));\
-}
+extern int tracepoint_register_lib(struct tracepoint *tracepoints_start,
+                                  int tracepoints_count);
+
+#define TRACEPOINT_LIB                                                 \
+       extern struct tracepoint __start___tracepoints[] __attribute__((visibility("hidden"))); \
+       extern struct tracepoint __stop___tracepoints[] __attribute__((visibility("hidden"))); \
+       static void __attribute__((constructor)) __tracepoints__init(void) \
+       {                                                               \
+               tracepoint_register_lib(__start___tracepoints,          \
+                                       (((long)__stop___tracepoints)-((long)__start___tracepoints))/sizeof(struct tracepoint)); \
+       }
+
 #endif
index 79db4989a4ecac23ad25180339ffbe926b933611..b2f30f0a4c4d8f4ed912c9a2f34af2d07c843849 100644 (file)
--- a/ust/ust.c
+++ b/ust/ust.c
@@ -1,7 +1,8 @@
+#define _GNU_SOURCE
+#include <stdio.h>
 #include <unistd.h>
 #include <getopt.h>
 #include <stdlib.h>
-#include <stdio.h>
 #include <fcntl.h>
 
 #include "ustcomm.h"
This page took 0.033039 seconds and 4 git commands to generate.