X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fringbuffer%2Fring_buffer_frontend.c;h=ff84dd0ebdf61a842d6c19dd8a65e76e6fe601cc;hb=f1f2e1141d41c5bb2d72bf3fd1cdceb9a1c0bc53;hp=8c9e5ef768857393e2c93c796ca4194ecb3f169a;hpb=46e25482873e8c85b547db4cec1734f127b27488;p=lttng-modules.git diff --git a/lib/ringbuffer/ring_buffer_frontend.c b/lib/ringbuffer/ring_buffer_frontend.c index 8c9e5ef7..ff84dd0e 100644 --- a/lib/ringbuffer/ring_buffer_frontend.c +++ b/lib/ringbuffer/ring_buffer_frontend.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -49,8 +50,6 @@ #include #include #include -#include -#include /* * Internal structure representing offsets to use at a sub-buffer switch. @@ -313,11 +312,10 @@ free_chanbuf: return ret; } -static void switch_buffer_timer(LTTNG_TIMER_FUNC_ARG_TYPE t) +static void switch_buffer_timer(struct timer_list *t) { - struct lib_ring_buffer *buf = lttng_from_timer(buf, t, switch_timer); + struct lib_ring_buffer *buf = from_timer(buf, t, switch_timer); struct channel *chan = buf->backend.chan; - const struct lib_ring_buffer_config *config = &chan->backend.config; /* * Only flush buffers periodically if readers are active. @@ -325,12 +323,8 @@ static void switch_buffer_timer(LTTNG_TIMER_FUNC_ARG_TYPE t) if (atomic_long_read(&buf->active_readers)) lib_ring_buffer_switch_slow(buf, SWITCH_ACTIVE); - if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) - lttng_mod_timer_pinned(&buf->switch_timer, - jiffies + chan->switch_timer_interval); - else - mod_timer(&buf->switch_timer, - jiffies + chan->switch_timer_interval); + mod_timer(&buf->switch_timer, + jiffies + chan->switch_timer_interval); } /* @@ -346,9 +340,9 @@ static void lib_ring_buffer_start_switch_timer(struct lib_ring_buffer *buf) return; if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) - flags = LTTNG_TIMER_PINNED; + flags = TIMER_PINNED; - lttng_timer_setup(&buf->switch_timer, switch_buffer_timer, flags, buf); + timer_setup(&buf->switch_timer, switch_buffer_timer, flags); buf->switch_timer.expires = jiffies + chan->switch_timer_interval; if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) @@ -376,9 +370,9 @@ static void lib_ring_buffer_stop_switch_timer(struct lib_ring_buffer *buf) /* * Polling timer to check the channels for data. */ -static void read_buffer_timer(LTTNG_TIMER_FUNC_ARG_TYPE t) +static void read_buffer_timer(struct timer_list *t) { - struct lib_ring_buffer *buf = lttng_from_timer(buf, t, read_timer); + struct lib_ring_buffer *buf = from_timer(buf, t, read_timer); struct channel *chan = buf->backend.chan; const struct lib_ring_buffer_config *config = &chan->backend.config; @@ -390,12 +384,8 @@ static void read_buffer_timer(LTTNG_TIMER_FUNC_ARG_TYPE t) wake_up_interruptible(&chan->read_wait); } - if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) - lttng_mod_timer_pinned(&buf->read_timer, - jiffies + chan->read_timer_interval); - else - mod_timer(&buf->read_timer, - jiffies + chan->read_timer_interval); + mod_timer(&buf->read_timer, + jiffies + chan->read_timer_interval); } /* @@ -413,9 +403,9 @@ static void lib_ring_buffer_start_read_timer(struct lib_ring_buffer *buf) return; if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) - flags = LTTNG_TIMER_PINNED; + flags = TIMER_PINNED; - lttng_timer_setup(&buf->read_timer, read_buffer_timer, flags, buf); + timer_setup(&buf->read_timer, read_buffer_timer, flags); buf->read_timer.expires = jiffies + chan->read_timer_interval; if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) @@ -1022,7 +1012,7 @@ int lib_ring_buffer_open_read(struct lib_ring_buffer *buf) if (!atomic_long_add_unless(&buf->active_readers, 1, 1)) return -EBUSY; kref_get(&chan->ref); - lttng_smp_mb__after_atomic(); + smp_mb__after_atomic(); return 0; } EXPORT_SYMBOL_GPL(lib_ring_buffer_open_read); @@ -1032,7 +1022,7 @@ void lib_ring_buffer_release_read(struct lib_ring_buffer *buf) struct channel *chan = buf->backend.chan; CHAN_WARN_ON(chan, atomic_long_read(&buf->active_readers) != 1); - lttng_smp_mb__before_atomic(); + smp_mb__before_atomic(); atomic_long_dec(&buf->active_readers); kref_put(&chan->ref, channel_release); }