X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libust%2Fbuffers.h;h=ca78796fbc9aa7e2aa28f2c4a0fcb9db73cbc7c7;hb=12e81b07455a1aef2e2bcc73004f14a7b73596fa;hp=90ca5d92f99f7b0166393701d5c7d6233e74e8ae;hpb=b102c2b0b07a155285716d9f7fd788662cecd54b;p=ust.git diff --git a/libust/buffers.h b/libust/buffers.h index 90ca5d9..ca78796 100644 --- a/libust/buffers.h +++ b/libust/buffers.h @@ -1,23 +1,37 @@ /* * buffers.h + * LTTng userspace tracer buffering system * * Copyright (C) 2009 - Pierre-Marc Fournier (pierre-marc dot fournier at polymtl dot ca) * Copyright (C) 2008 - Mathieu Desnoyers (mathieu.desnoyers@polymtl.ca) * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _UST_BUFFERS_H #define _UST_BUFFERS_H -#include #include +#include +#include "usterr.h" #include "channels.h" #include "tracerconst.h" #include "tracercore.h" #include "header-inline.h" -#include -/***** SHOULD BE REMOVED ***** */ +/***** FIXME: SHOULD BE REMOVED ***** */ /* * BUFFER_TRUNC zeroes the subbuffer offset and the subbuffer number parts of @@ -90,10 +104,12 @@ struct ust_buffer { */ enum force_switch_mode { FORCE_ACTIVE, FORCE_FLUSH }; -extern int ltt_reserve_slot_lockless_slow(struct ust_trace *trace, - struct ust_channel *ltt_channel, void **transport_data, - size_t data_size, size_t *slot_size, long *buf_offset, u64 *tsc, - unsigned int *rflags, int largest_align, int cpu); +extern int ltt_reserve_slot_lockless_slow(struct ust_channel *chan, + struct ust_trace *trace, size_t data_size, + int largest_align, int cpu, + struct ust_buffer **ret_buf, + size_t *slot_size, long *buf_offset, + u64 *tsc, unsigned int *rflags); extern void ltt_force_switch_lockless_slow(struct ust_buffer *buf, enum force_switch_mode mode); @@ -337,12 +353,14 @@ static __inline__ int ltt_relay_try_reserve( return 0; } -static __inline__ int ltt_reserve_slot(struct ust_trace *trace, - struct ust_channel *chan, void **transport_data, - size_t data_size, size_t *slot_size, long *buf_offset, u64 *tsc, - unsigned int *rflags, int largest_align, int cpu) +static __inline__ int ltt_reserve_slot(struct ust_channel *chan, + struct ust_trace *trace, size_t data_size, + int largest_align, int cpu, + struct ust_buffer **ret_buf, + size_t *slot_size, long *buf_offset, u64 *tsc, + unsigned int *rflags) { - struct ust_buffer *buf = chan->buf[cpu]; + struct ust_buffer *buf = *ret_buf = chan->buf[cpu]; long o_begin, o_end, o_old; size_t before_hdr_pad; @@ -386,9 +404,10 @@ static __inline__ int ltt_reserve_slot(struct ust_trace *trace, *buf_offset = o_begin + before_hdr_pad; return 0; slow_path: - return ltt_reserve_slot_lockless_slow(trace, chan, - transport_data, data_size, slot_size, buf_offset, tsc, - rflags, largest_align, cpu); + return ltt_reserve_slot_lockless_slow(chan, trace, data_size, + largest_align, cpu, ret_buf, + slot_size, buf_offset, tsc, + rflags); } /* @@ -519,7 +538,9 @@ static __inline__ int ust_buffers_write(struct ust_buffer *buf, size_t offset, return len; } -int ust_buffers_get_subbuf(struct ust_buffer *buf, long *consumed); -int ust_buffers_put_subbuf(struct ust_buffer *buf, unsigned long uconsumed_old); +extern int ust_buffers_get_subbuf(struct ust_buffer *buf, long *consumed); +extern int ust_buffers_put_subbuf(struct ust_buffer *buf, unsigned long uconsumed_old); + +extern void init_ustrelay_transport(void); #endif /* _UST_BUFFERS_H */