From e17571a59eef2b054c7432f6cba10c2cb467a182 Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Mon, 8 Feb 2010 16:50:41 -0500 Subject: [PATCH] fix some errors and warnings in the porting --- include/ust/kernelcompat.h | 2 ++ libust/buffers.c | 42 +++++++++++++++++++------------------- libust/serialize.c | 2 +- libust/tracectl.c | 5 +++++ 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/include/ust/kernelcompat.h b/include/ust/kernelcompat.h index da23261..4b43b7e 100644 --- a/include/ust/kernelcompat.h +++ b/include/ust/kernelcompat.h @@ -22,6 +22,8 @@ #define KERN_ALERT "" #define KERN_WARNING "" +#define WARN_ON_ONCE(msg) WARN_ON(msg) + /* ERROR OPS */ #define MAX_ERRNO 4095 diff --git a/libust/buffers.c b/libust/buffers.c index 708575a..c644cfb 100644 --- a/libust/buffers.c +++ b/libust/buffers.c @@ -346,10 +346,10 @@ static notrace void ltt_buf_unfull(struct ust_buffer *buf, * architecture does not reorder writes. This should eventually be provided by * a separate architecture-specific infrastructure. */ -static void remote_mb(void *info) -{ - smp_mb(); -} +//ust// static void remote_mb(void *info) +//ust// { +//ust// smp_mb(); +//ust// } int ust_buffers_get_subbuf(struct ust_buffer *buf, long *consumed) { @@ -545,20 +545,20 @@ int ust_buffers_put_subbuf(struct ust_buffer *buf, unsigned long uconsumed_old) //ust// } //ust// } -static void ust_buffers_print_written(struct ust_channel *chan, - long cons_off, unsigned int cpu) -{ - struct ust_buffer *buf = chan->buf[cpu]; - long cons_idx, events_count; - - cons_idx = SUBBUF_INDEX(cons_off, chan); - events_count = local_read(&buf->commit_count[cons_idx].events); - - if (events_count) - printk(KERN_INFO - "channel %s: %lu events written (cpu %u, index %lu)\n", - chan->channel_name, events_count, cpu, cons_idx); -} +//ust// static void ust_buffers_print_written(struct ust_channel *chan, +//ust// long cons_off, unsigned int cpu) +//ust// { +//ust// struct ust_buffer *buf = chan->buf[cpu]; +//ust// long cons_idx, events_count; +//ust// +//ust// cons_idx = SUBBUF_INDEX(cons_off, chan); +//ust// events_count = local_read(&buf->commit_count[cons_idx].events); +//ust// +//ust// if (events_count) +//ust// printk(KERN_INFO +//ust// "channel %s: %lu events written (cpu %u, index %lu)\n", +//ust// chan->channel_name, events_count, cpu, cons_idx); +//ust// } static void ltt_relay_print_subbuffer_errors( struct ust_channel *channel, @@ -604,9 +604,9 @@ static void ltt_relay_print_errors(struct ust_trace *trace, if (!channel) return; - for (cons_off = 0; cons_off < rchan->alloc_size; - cons_off = SUBBUF_ALIGN(cons_off, rchan)) - ust_buffers_print_written(ltt_chan, cons_off, cpu); +//ust// for (cons_off = 0; cons_off < rchan->alloc_size; +//ust// cons_off = SUBBUF_ALIGN(cons_off, rchan)) +//ust// ust_buffers_print_written(ltt_chan, cons_off, cpu); for (cons_off = atomic_long_read(<t_buf->consumed); (SUBBUF_TRUNC(local_read(<t_buf->offset), channel) diff --git a/libust/serialize.c b/libust/serialize.c index 7f9ce5a..6a86884 100644 --- a/libust/serialize.c +++ b/libust/serialize.c @@ -537,7 +537,7 @@ notrace size_t ltt_serialize_data(struct ust_buffer *buf, size_t buf_offset, ++fmt; /* skip first '%' */ if (*fmt == '%') /* Escaped %% */ break; - fmt = parse_c_type(fmt, &c_size, &c_type); + fmt = parse_c_type(fmt, &c_size, &c_type, NULL); /* * Output c types if no trace types has been * specified. diff --git a/libust/tracectl.c b/libust/tracectl.c index 0a8fc8e..c0bf6d2 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -1117,6 +1117,11 @@ static void __attribute__((constructor)) init() /* Ensure markers are initialized */ init_markers(); + /* Ensure buffers are initialized, for the transport to be available. + * We are about to set a trace type and it will fail without this. + */ + init_ustrelay_transport(); + /* FIXME: When starting early tracing (here), depending on the * order of constructors, it is very well possible some marker * sections are not yet registered. Because of this, some -- 2.34.1