From: Mathieu Desnoyers Date: Thu, 17 Nov 2011 21:45:13 +0000 (-0500) Subject: Fix lib ring buffer compile errors X-Git-Tag: v1.9.1~84 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2fed87aef82aaa8edfb6d8d8ac6bbf5f1e67b955;p=lttng-ust.git Fix lib ring buffer compile errors Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ringbuffer-config.h b/include/lttng/ringbuffer-config.h index 151fda13..513da2f6 100644 --- a/include/lttng/ringbuffer-config.h +++ b/include/lttng/ringbuffer-config.h @@ -43,7 +43,7 @@ struct lttng_ust_lib_ring_buffer_client_cb { /* Mandatory callbacks */ /* A static inline version is also required for fast path */ - u64 (*ring_buffer_clock_read) (struct channel *chan); + uint64_t (*ring_buffer_clock_read) (struct channel *chan); size_t (*record_header_size) (const struct lttng_ust_lib_ring_buffer_config *config, struct channel *chan, size_t offset, size_t *pre_header_padding, @@ -51,10 +51,10 @@ struct lttng_ust_lib_ring_buffer_client_cb { /* Slow path only, at subbuffer switch */ size_t (*subbuffer_header_size) (void); - void (*buffer_begin) (struct lttng_ust_lib_ring_buffer *buf, u64 tsc, + void (*buffer_begin) (struct lttng_ust_lib_ring_buffer *buf, uint64_t tsc, unsigned int subbuf_idx, struct lttng_ust_shm_handle *handle); - void (*buffer_end) (struct lttng_ust_lib_ring_buffer *buf, u64 tsc, + void (*buffer_end) (struct lttng_ust_lib_ring_buffer *buf, uint64_t tsc, unsigned int subbuf_idx, unsigned long data_size, struct lttng_ust_shm_handle *handle); @@ -80,7 +80,7 @@ struct lttng_ust_lib_ring_buffer_client_cb { void (*record_get) (const struct lttng_ust_lib_ring_buffer_config *config, struct channel *chan, struct lttng_ust_lib_ring_buffer *buf, size_t offset, size_t *header_len, - size_t *payload_len, u64 *timestamp, + size_t *payload_len, uint64_t *timestamp, struct lttng_ust_shm_handle *handle); }; @@ -210,7 +210,7 @@ struct lttng_ust_lib_ring_buffer_ctx { * prior to record header alignment * padding. */ - u64 tsc; /* time-stamp counter value */ + uint64_t tsc; /* time-stamp counter value */ unsigned int rflags; /* reservation flags */ }; diff --git a/libringbuffer/backend_types.h b/libringbuffer/backend_types.h index 1c3d3bc5..7417506e 100644 --- a/libringbuffer/backend_types.h +++ b/libringbuffer/backend_types.h @@ -11,6 +11,7 @@ * Dual LGPL v2.1/GPL v2 license. */ +#include #include "shm_internal.h" struct lttng_ust_lib_ring_buffer_backend_pages { @@ -69,7 +70,7 @@ struct channel_backend { unsigned int buf_size_order; /* Order of buffer size */ int extra_reader_sb:1; /* Bool: has extra reader subbuffer */ unsigned long num_subbuf; /* Number of sub-buffers for writer */ - u64 start_tsc; /* Channel creation TSC value */ + uint64_t start_tsc; /* Channel creation TSC value */ DECLARE_SHMP(void *, priv_data);/* Client-specific information */ struct lttng_ust_lib_ring_buffer_config config; /* Ring buffer configuration */ char name[NAME_MAX]; /* Channel name */ diff --git a/libringbuffer/frontend_internal.h b/libringbuffer/frontend_internal.h index dcf86b77..aa7876e8 100644 --- a/libringbuffer/frontend_internal.h +++ b/libringbuffer/frontend_internal.h @@ -86,7 +86,7 @@ unsigned long subbuf_index(unsigned long offset, struct channel *chan) #if (CAA_BITS_PER_LONG == 32) static inline void save_last_tsc(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer *buf, u64 tsc) + struct lttng_ust_lib_ring_buffer *buf, uint64_t tsc) { if (config->tsc_bits == 0 || config->tsc_bits == 64) return; @@ -99,7 +99,7 @@ void save_last_tsc(const struct lttng_ust_lib_ring_buffer_config *config, static inline int last_tsc_overflow(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer *buf, u64 tsc) + struct lttng_ust_lib_ring_buffer *buf, uint64_t tsc) { unsigned long tsc_shifted; @@ -116,7 +116,7 @@ int last_tsc_overflow(const struct lttng_ust_lib_ring_buffer_config *config, #else static inline void save_last_tsc(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer *buf, u64 tsc) + struct lttng_ust_lib_ring_buffer *buf, uint64_t tsc) { if (config->tsc_bits == 0 || config->tsc_bits == 64) return; @@ -126,7 +126,7 @@ void save_last_tsc(const struct lttng_ust_lib_ring_buffer_config *config, static inline int last_tsc_overflow(const struct lttng_ust_lib_ring_buffer_config *config, - struct lttng_ust_lib_ring_buffer *buf, u64 tsc) + struct lttng_ust_lib_ring_buffer *buf, uint64_t tsc) { if (config->tsc_bits == 0 || config->tsc_bits == 64) return 0; @@ -293,7 +293,7 @@ void lib_ring_buffer_check_deliver(const struct lttng_ust_lib_ring_buffer_config { unsigned long old_commit_count = commit_count - chan->backend.subbuf_size; - u64 tsc; + uint64_t tsc; /* Check if all commits have been done */ if (caa_unlikely((buf_trunc(offset, chan) >> chan->backend.num_subbuf_order) diff --git a/libringbuffer/ring_buffer_backend.c b/libringbuffer/ring_buffer_backend.c index 3f47ebd1..d676b5f8 100644 --- a/libringbuffer/ring_buffer_backend.c +++ b/libringbuffer/ring_buffer_backend.c @@ -10,8 +10,8 @@ #include "lttng/core.h" -#include "uatomic.h" #include +#include "vatomic.h" #include "backend.h" #include "frontend.h" #include "smp.h" diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index 18c47ddf..d469d040 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -45,9 +45,9 @@ #include #include -#include "vatomic.h" #include "smp.h" #include +#include "vatomic.h" #include "backend.h" #include "frontend.h" #include "shm.h" @@ -166,7 +166,7 @@ int lib_ring_buffer_create(struct lttng_ust_lib_ring_buffer *buf, struct channel *chan = caa_container_of(chanb, struct channel, backend); void *priv = channel_get_private(chan); size_t subbuf_header_size; - u64 tsc; + uint64_t tsc; int ret; /* Test for cpu hotplug */ @@ -1010,7 +1010,7 @@ static void lib_ring_buffer_switch_old_start(struct lttng_ust_lib_ring_buffer *buf, struct channel *chan, struct switch_offsets *offsets, - u64 tsc, + uint64_t tsc, struct lttng_ust_shm_handle *handle) { const struct lttng_ust_lib_ring_buffer_config *config = &chan->backend.config; @@ -1048,7 +1048,7 @@ static void lib_ring_buffer_switch_old_end(struct lttng_ust_lib_ring_buffer *buf, struct channel *chan, struct switch_offsets *offsets, - u64 tsc, + uint64_t tsc, struct lttng_ust_shm_handle *handle) { const struct lttng_ust_lib_ring_buffer_config *config = &chan->backend.config; @@ -1085,7 +1085,7 @@ static void lib_ring_buffer_switch_new_start(struct lttng_ust_lib_ring_buffer *buf, struct channel *chan, struct switch_offsets *offsets, - u64 tsc, + uint64_t tsc, struct lttng_ust_shm_handle *handle) { const struct lttng_ust_lib_ring_buffer_config *config = &chan->backend.config; @@ -1121,7 +1121,7 @@ static void lib_ring_buffer_switch_new_end(struct lttng_ust_lib_ring_buffer *buf, struct channel *chan, struct switch_offsets *offsets, - u64 tsc, + uint64_t tsc, struct lttng_ust_shm_handle *handle) { const struct lttng_ust_lib_ring_buffer_config *config = &chan->backend.config; @@ -1157,7 +1157,7 @@ int lib_ring_buffer_try_switch_slow(enum switch_mode mode, struct lttng_ust_lib_ring_buffer *buf, struct channel *chan, struct switch_offsets *offsets, - u64 *tsc) + uint64_t *tsc) { const struct lttng_ust_lib_ring_buffer_config *config = &chan->backend.config; unsigned long off; @@ -1222,7 +1222,7 @@ void lib_ring_buffer_switch_slow(struct lttng_ust_lib_ring_buffer *buf, enum swi const struct lttng_ust_lib_ring_buffer_config *config = &chan->backend.config; struct switch_offsets offsets; unsigned long oldidx; - u64 tsc; + uint64_t tsc; offsets.size = 0;