AC_FUNC_MALLOC
AC_CHECK_FUNCS([gettimeofday munmap socket strerror strtol])
+CFLAGS="-Wall $CFLAGS"
+
# URCU
# urcu - check if we just find the headers it out of the box.
}; \
static void __attribute__((constructor)) init_##name() \
{ \
- void *dummy; \
+ void *dummy = NULL; \
register_trace_##name(trace_printf_##name, dummy); \
}
void dummy_libust_initializer_func(void)
{
- int i;
trace_mark(ust, dummymark, MARK_NOARGS);
- trace_ust_dummytp(i);
- trace_ust_dummy_event(i);
+ trace_ust_dummytp(0);
+ trace_ust_dummy_event(0);
}
MARKER_LIB;
PERROR("shmdt");
}
}
+ return 0;
}
/*
#include <assert.h>
#include <ust/core.h>
+#include <ust/clock.h>
#include "usterr.h"
#include "channels.h"
#include <ust/core.h>
#include <ust/marker.h>
+#include <ust/tracepoint.h>
#include "usterr.h"
#include "channels.h"
}
channel->subbuf_size = power;
- DBG("the set_subbuf_size for the requested channel is %u", channel->subbuf_size);
+ DBG("the set_subbuf_size for the requested channel is %zu", channel->subbuf_size);
unlock_traces:
ltt_unlock_traces();
}
channel->subbuf_cnt = num;
- DBG("the set_subbuf_cnt for the requested channel is %zd", channel->subbuf_cnt);
+ DBG("the set_subbuf_cnt for the requested channel is %u", channel->subbuf_cnt);
unlock_traces:
ltt_unlock_traces();
if (peek_header.size && data) {
if (peek_header.size < 0 ||
peek_header.size > USTCOMM_DATA_SIZE) {
- ERR("big peek header! %d", peek_header.size);
+ ERR("big peek header! %ld", peek_header.size);
return 0;
}
/* Skip the first subbuffer. We are not sure it is trustable
* because the put_subbuffer() did not complete.
*/
+ /* TODO: check on_put_error return value */
if(instance->callbacks->on_put_error)
instance->callbacks->on_put_error(instance->callbacks, buf);
args->channel_cpu = channel_cpu;
args->instance = instance;
DBG("beginning2 of start_consuming_buffer: args: pid %d trace %s"
- " bufname %s_%d", args->pid, args->channel, args->channel_cpu);
+ " bufname %s_%d", args->pid, args->trace, args->channel, args->channel_cpu);
result = pthread_create(&thr, NULL, consumer_thread, args);
if(result == -1) {
return -1;
}
DBG("end of start_consuming_buffer: args: pid %d trace %s "
- "bufname %s_%d", args->pid, args->channel, args->channel_cpu);
+ "bufname %s_%d", args->pid, args->channel, args->trace, args->channel_cpu);
return 0;
}
/* If it was, we only check the data_size. This is the amount of valid data at
* the beginning of the subbuffer. */
valid_length = header->data_size;
- DBG("writing full subbuffer (%d) with valid_length = %ld", i_subbuf, valid_length);
+ DBG("writing full subbuffer (%ld) with valid_length = %ld", i_subbuf, valid_length);
}
else {
/* If the subbuffer was not fully written, then we don't check data_size because
*/
valid_length = commit_seq & (buf->subbuf_size-1);
- DBG("writing unfull subbuffer (%d) with valid_length = %ld", i_subbuf, valid_length);
+ DBG("writing unfull subbuffer (%ld) with valid_length = %ld", i_subbuf, valid_length);
header->data_size = valid_length;
header->sb_size = PAGE_ALIGN(valid_length);
assert(i_subbuf == (last_subbuf % buf->n_subbufs));
}
+ /* TODO: check on_read_partial_subbuffer return value */
if(callbacks->on_read_partial_subbuffer)
callbacks->on_read_partial_subbuffer(callbacks, buf, i_subbuf, valid_length);
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
+#include <sys/wait.h>
#include <ust/marker.h>
#include <ust/ustctl.h>
}
-
-int main()
+int main(int argc, char **argv)
{
- int i, status, pipefd[2];
+ int i, status;
pid_t parent_pid, child_pid;
- FILE *pipe_file;
tap_plan(27);
}
printf("Unregistered all\n");
}
+ return NULL;
}
-int main()
+int main(int argc, char **argv)
{
pthread_t register_thread;
int i;
#include <stdarg.h>
#include <stdio.h>
#include <unistd.h>
+#include <string.h>
static int tap_planned = -1;
static int tap_count = 1;
time=trace_clock_read64();
trace_test(time, i);
}
+ return 0;
}
#include <getopt.h>
#include "ust/ustconsumer.h"
+#include "../libustconsumer/lowlevel.h"
#include "usterr.h"
char *sock_path=NULL;
result = patient_write(buf_local->file_fd, buf->mem + subbuf_index * buf->subbuf_size, valid_length);
if(result == -1) {
ERR("Error writing to buffer file");
- return;
+ return result;
}
/* pad with empty bytes */
result = patient_write(buf_local->file_fd, tmp, pad_size);
if(result == -1) {
ERR("Error writing to buffer file");
- return;
+ return result;
}
free(tmp);
}
-
+ return result;
}
int on_open_buffer(struct ustconsumer_callbacks *data, struct buffer_info *buf)
int on_put_error(struct ustconsumer_callbacks *data, struct buffer_info *buf)
{
- unwrite_last_subbuffer(buf);
+ return unwrite_last_subbuffer(buf);
}
struct ustconsumer_callbacks *new_callbacks()