+#define _GNU_SOURCE
#include <stdio.h>
#include <stdint.h>
#include <signal.h>
}
}
-static int inform_consumer_daemon(void)
+static void inform_consumer_daemon(void)
{
ustcomm_request_consumer(getpid(), "metadata");
ustcomm_request_consumer(getpid(), "ust");
result = poll(fds, n_fds, 0);
if(result == -1) {
PERROR("poll");
- return -1;
+ return;
}
list_for_each_entry(bc, &blocked_consumers, list) {
}
-int listener_main(void *p)
+void *listener_main(void *p)
{
int result;
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();
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")) {
result = ltt_trace_alloc(trace_name);
if(result < 0) {
ERR("ltt_trace_alloc failed");
- return;
+ return (void *)1;
}
}
else if(!strcmp(recvbuf, "trace_start")) {
result = ltt_trace_stop(trace_name);
if(result < 0) {
ERR("ltt_trace_stop failed");
- return;
+ return (void *)1;
}
}
else if(!strcmp(recvbuf, "trace_destroy")) {
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) {
if(trace == NULL) {
CPRINTF("cannot find trace!");
- return 1;
+ return (void *)1;
}
for(i=0; i<trace->nr_channels; i++) {
if(trace == NULL) {
CPRINTF("cannot find trace!");
- return 1;
+ return (void *)1;
}
for(i=0; i<trace->nr_channels; i++) {
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) {
if(trace == NULL) {
CPRINTF("cannot find trace!");
- return 1;
+ return (void *)1;
}
for(i=0; i<trace->nr_channels; i++) {
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) {
if(trace == NULL) {
CPRINTF("cannot find trace!");
- return 1;
+ return (void *)1;
}
for(i=0; i<trace->nr_channels; i++) {
if(trace == NULL) {
CPRINTF("cannot find trace!");
- return 1;
+ return (void *)1;
}
for(i=0; i<trace->nr_channels; i++) {
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);
//
// if(trace == NULL) {
// CPRINTF("cannot find trace!");
-// return 1;
+// return (void *)1;
// }
//
// for(i=0; i<trace->nr_channels; i++) {