From: Pierre-Marc Fournier Date: Mon, 15 Jun 2009 17:34:18 +0000 (-0400) Subject: fix warnings X-Git-Tag: v0.1~191 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9160b4e4541d3a6010e4e671ee5deb3ea89f4211;p=ust.git fix warnings --- diff --git a/libust/marker-control.h b/libust/marker-control.h index 0b602db..0a13980 100644 --- a/libust/marker-control.h +++ b/libust/marker-control.h @@ -1,7 +1,7 @@ #ifndef MARKER_CONTROL_H #define MARKER_CONTROL_H -int marker_control_init(void); +int init_marker_control(void); int ltt_probe_register(struct ltt_available_probe *pdata); #endif /* MARKER_CONTROL_H */ diff --git a/libust/marker.h b/libust/marker.h index 3a86ac3..25c27f6 100644 --- a/libust/marker.h +++ b/libust/marker.h @@ -297,4 +297,6 @@ static void __attribute__((constructor)) __markers__init(void) \ void marker_set_new_marker_cb(void (*cb)(struct marker *)); +void init_markers(void); + #endif diff --git a/libust/relay.h b/libust/relay.h index cb5c438..630c4ea 100644 --- a/libust/relay.h +++ b/libust/relay.h @@ -371,4 +371,6 @@ int ltt_do_get_subbuf(struct rchan_buf *buf, struct ltt_channel_buf_struct *ltt_ int ltt_do_put_subbuf(struct rchan_buf *buf, struct ltt_channel_buf_struct *ltt_buf, u32 uconsumed_old); +void init_ustrelay_transport(void); + #endif /* _LINUX_LTT_RELAY_H */ diff --git a/libust/tracectl.c b/libust/tracectl.c index abd7962..1ee3e45 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -14,6 +14,7 @@ #include "localerr.h" #include "ustcomm.h" #include "relay.h" /* FIXME: remove */ +#include "marker-control.h" //#define USE_CLONE @@ -208,9 +209,6 @@ void *listener_main(void *p) DBG("LISTENER"); for(;;) { - uint32_t size; - struct sockaddr_un addr; - socklen_t addrlen = sizeof(addr); char trace_name[] = "auto"; char trace_type[] = "ustrelay"; char *recvbuf; @@ -355,7 +353,6 @@ void *listener_main(void *p) struct rchan *rchan = trace->channels[i].trans_channel_data; struct rchan_buf *rbuf = rchan->buf; struct ltt_channel_struct *ltt_channel = (struct ltt_channel_struct *)rchan->private_data; - struct ltt_channel_buf_struct *ltt_buf = ltt_channel->buf; if(!strcmp(trace->channels[i].channel_name, channel_name)) { char *reply; @@ -500,9 +497,6 @@ void *listener_main(void *p) if(!strcmp(trace->channels[i].channel_name, channel_name)) { struct rchan_buf *rbuf = rchan->buf; struct ltt_channel_buf_struct *lttbuf = trace->channels[i].buf; - char *reply; - long consumed_old=0; - int fd; struct blocked_consumer *bc; bc = (struct blocked_consumer *) malloc(sizeof(struct blocked_consumer)); @@ -598,7 +592,6 @@ void *listener_main(void *p) char *channel_slash_name = nth_token(recvbuf, 1); char channel_name[256]=""; char marker_name[256]=""; - struct marker_iter iter; result = sscanf(channel_slash_name, "%255[^/]/%255s", channel_name, marker_name); @@ -617,7 +610,6 @@ void *listener_main(void *p) char *channel_slash_name = nth_token(recvbuf, 1); char *marker_name; char *channel_name; - struct marker_iter iter; result = sscanf(channel_slash_name, "%a[^/]/%as", &channel_name, &marker_name); @@ -688,13 +680,11 @@ void *listener_main(void *p) } } -static char listener_stack[16384]; - void create_listener(void) { - int result; +#ifdef USE_CLONE static char listener_stack[16384]; - //char *listener_stack = malloc(16384); +#endif #ifdef USE_CLONE result = clone(listener_main, listener_stack+sizeof(listener_stack)-1, CLONE_FS | CLONE_FILES | CLONE_VM | CLONE_SIGHAND | CLONE_THREAD, NULL); @@ -734,18 +724,22 @@ static int init_socket(void) return ustcomm_init_app(getpid(), &ustcomm_app); } +/* FIXME: reenable this to delete socket file. */ + +#if 0 static void destroy_socket(void) { -// int result; -// -// if(mysocketfile[0] == '\0') -// return; -// -// result = unlink(mysocketfile); -// if(result == -1) { -// PERROR("unlink"); -// } + int result; + + if(mysocketfile[0] == '\0') + return; + + result = unlink(mysocketfile); + if(result == -1) { + PERROR("unlink"); + } } +#endif static int init_signal_handler(void) { @@ -797,8 +791,6 @@ static void __attribute__((constructor(101))) init0() } } -static void fini(void); - static void __attribute__((constructor(1000))) init() { int result; diff --git a/libustcomm/ustcomm.h b/libustcomm/ustcomm.h index 052c896..d48a115 100644 --- a/libustcomm/ustcomm.h +++ b/libustcomm/ustcomm.h @@ -37,6 +37,7 @@ struct ustcomm_source { char *strdup_malloc(const char *s); //int send_message_pid(pid_t pid, const char *msg, char **reply); +int ustcomm_request_consumer(pid_t pid, const char *channel); int ustcomm_ustd_recv_message(struct ustcomm_ustd *ustd, char **msg, struct ustcomm_source *src, int timeout); int ustcomm_app_recv_message(struct ustcomm_app *app, char **msg, struct ustcomm_source *src, int timeout); @@ -47,6 +48,7 @@ int ustcomm_init_ustd(struct ustcomm_ustd *handle); int ustcomm_connect_app(pid_t pid, struct ustcomm_connection *conn); int ustcomm_send_request(struct ustcomm_connection *conn, char *req, char **reply); +int ustcomm_send_reply(struct ustcomm_server *server, char *msg, struct ustcomm_source *src); int nth_token_is(char *str, char *token, int tok_no);