projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update loglevel ABI: only loglevel value/enum is known by UST
[lttng-ust.git]
/
libringbuffer
/
frontend_api.h
diff --git
a/libringbuffer/frontend_api.h
b/libringbuffer/frontend_api.h
index 1d8e29493655da9709cec47909167177a7c1bcc6..49f6e4c27274a32c2c59b05e414714b780770b9e 100644
(file)
--- a/
libringbuffer/frontend_api.h
+++ b/
libringbuffer/frontend_api.h
@@
-18,7
+18,6
@@
*/
#include "frontend.h"
*/
#include "frontend.h"
-#include "ust/core.h"
#include <urcu-bp.h>
#include <urcu/compiler.h>
#include <urcu-bp.h>
#include <urcu/compiler.h>
@@
-37,16
+36,16
@@
* section.
*/
static inline
* section.
*/
static inline
-int lib_ring_buffer_get_cpu(const struct lib_ring_buffer_config *config)
+int lib_ring_buffer_get_cpu(const struct l
ttng_ust_l
ib_ring_buffer_config *config)
{
int cpu, nesting;
rcu_read_lock();
{
int cpu, nesting;
rcu_read_lock();
- cpu = ust_get_cpu();
+ cpu =
lttng_
ust_get_cpu();
nesting = ++lib_ring_buffer_nesting; /* TLS */
cmm_barrier();
nesting = ++lib_ring_buffer_nesting; /* TLS */
cmm_barrier();
- if (unlikely(nesting > 4)) {
+ if (
caa_
unlikely(nesting > 4)) {
WARN_ON_ONCE(1);
lib_ring_buffer_nesting--; /* TLS */
rcu_read_unlock();
WARN_ON_ONCE(1);
lib_ring_buffer_nesting--; /* TLS */
rcu_read_unlock();
@@
-59,7
+58,7
@@
int lib_ring_buffer_get_cpu(const struct lib_ring_buffer_config *config)
* lib_ring_buffer_put_cpu - Follows ring buffer reserve/commit.
*/
static inline
* lib_ring_buffer_put_cpu - Follows ring buffer reserve/commit.
*/
static inline
-void lib_ring_buffer_put_cpu(const struct lib_ring_buffer_config *config)
+void lib_ring_buffer_put_cpu(const struct l
ttng_ust_l
ib_ring_buffer_config *config)
{
cmm_barrier();
lib_ring_buffer_nesting--; /* TLS */
{
cmm_barrier();
lib_ring_buffer_nesting--; /* TLS */
@@
-73,13
+72,13
@@
void lib_ring_buffer_put_cpu(const struct lib_ring_buffer_config *config)
* returns 0 if reserve ok, or 1 if the slow path must be taken.
*/
static inline
* returns 0 if reserve ok, or 1 if the slow path must be taken.
*/
static inline
-int lib_ring_buffer_try_reserve(const struct lib_ring_buffer_config *config,
- struct lib_ring_buffer_ctx *ctx,
+int lib_ring_buffer_try_reserve(const struct l
ttng_ust_l
ib_ring_buffer_config *config,
+ struct l
ttng_ust_l
ib_ring_buffer_ctx *ctx,
unsigned long *o_begin, unsigned long *o_end,
unsigned long *o_old, size_t *before_hdr_pad)
{
struct channel *chan = ctx->chan;
unsigned long *o_begin, unsigned long *o_end,
unsigned long *o_old, size_t *before_hdr_pad)
{
struct channel *chan = ctx->chan;
- struct lib_ring_buffer *buf = ctx->buf;
+ struct l
ttng_ust_l
ib_ring_buffer *buf = ctx->buf;
*o_begin = v_read(config, &buf->offset);
*o_old = *o_begin;
*o_begin = v_read(config, &buf->offset);
*o_old = *o_begin;
@@
-97,7
+96,7
@@
int lib_ring_buffer_try_reserve(const struct lib_ring_buffer_config *config,
if (last_tsc_overflow(config, buf, ctx->tsc))
ctx->rflags |= RING_BUFFER_RFLAG_FULL_TSC;
if (last_tsc_overflow(config, buf, ctx->tsc))
ctx->rflags |= RING_BUFFER_RFLAG_FULL_TSC;
- if (unlikely(subbuf_offset(*o_begin, chan) == 0))
+ if (
caa_
unlikely(subbuf_offset(*o_begin, chan) == 0))
return 1;
ctx->slot_size = record_header_size(config, chan, *o_begin,
return 1;
ctx->slot_size = record_header_size(config, chan, *o_begin,
@@
-105,7
+104,7
@@
int lib_ring_buffer_try_reserve(const struct lib_ring_buffer_config *config,
ctx->slot_size +=
lib_ring_buffer_align(*o_begin + ctx->slot_size,
ctx->largest_align) + ctx->data_size;
ctx->slot_size +=
lib_ring_buffer_align(*o_begin + ctx->slot_size,
ctx->largest_align) + ctx->data_size;
- if (unlikely((subbuf_offset(*o_begin, chan) + ctx->slot_size)
+ if (
caa_
unlikely((subbuf_offset(*o_begin, chan) + ctx->slot_size)
> chan->backend.subbuf_size))
return 1;
> chan->backend.subbuf_size))
return 1;
@@
-115,7
+114,7
@@
int lib_ring_buffer_try_reserve(const struct lib_ring_buffer_config *config,
*/
*o_end = *o_begin + ctx->slot_size;
*/
*o_end = *o_begin + ctx->slot_size;
- if (unlikely((subbuf_offset(*o_end, chan)) == 0))
+ if (
caa_
unlikely((subbuf_offset(*o_end, chan)) == 0))
/*
* The offset_end will fall at the very beginning of the next
* subbuffer.
/*
* The offset_end will fall at the very beginning of the next
* subbuffer.
@@
-142,12
+141,12
@@
int lib_ring_buffer_try_reserve(const struct lib_ring_buffer_config *config,
*/
static inline
*/
static inline
-int lib_ring_buffer_reserve(const struct lib_ring_buffer_config *config,
- struct lib_ring_buffer_ctx *ctx)
+int lib_ring_buffer_reserve(const struct l
ttng_ust_l
ib_ring_buffer_config *config,
+ struct l
ttng_ust_l
ib_ring_buffer_ctx *ctx)
{
struct channel *chan = ctx->chan;
{
struct channel *chan = ctx->chan;
- struct shm_handle *handle = ctx->handle;
- struct lib_ring_buffer *buf;
+ struct
lttng_ust_
shm_handle *handle = ctx->handle;
+ struct l
ttng_ust_l
ib_ring_buffer *buf;
unsigned long o_begin, o_end, o_old;
size_t before_hdr_pad = 0;
unsigned long o_begin, o_end, o_old;
size_t before_hdr_pad = 0;
@@
-165,11
+164,11
@@
int lib_ring_buffer_reserve(const struct lib_ring_buffer_config *config,
/*
* Perform retryable operations.
*/
/*
* Perform retryable operations.
*/
- if (unlikely(lib_ring_buffer_try_reserve(config, ctx, &o_begin,
+ if (
caa_
unlikely(lib_ring_buffer_try_reserve(config, ctx, &o_begin,
&o_end, &o_old, &before_hdr_pad)))
goto slow_path;
&o_end, &o_old, &before_hdr_pad)))
goto slow_path;
- if (unlikely(v_cmpxchg(config, &ctx->buf->offset, o_old, o_end)
+ if (
caa_
unlikely(v_cmpxchg(config, &ctx->buf->offset, o_old, o_end)
!= o_old))
goto slow_path;
!= o_old))
goto slow_path;
@@
-214,9
+213,9
@@
slow_path:
* disabled, for RING_BUFFER_SYNC_PER_CPU configuration.
*/
static inline
* disabled, for RING_BUFFER_SYNC_PER_CPU configuration.
*/
static inline
-void lib_ring_buffer_switch(const struct lib_ring_buffer_config *config,
- struct lib_ring_buffer *buf, enum switch_mode mode,
- struct shm_handle *handle)
+void lib_ring_buffer_switch(const struct l
ttng_ust_l
ib_ring_buffer_config *config,
+ struct l
ttng_ust_l
ib_ring_buffer *buf, enum switch_mode mode,
+ struct
lttng_ust_
shm_handle *handle)
{
lib_ring_buffer_switch_slow(buf, mode, handle);
}
{
lib_ring_buffer_switch_slow(buf, mode, handle);
}
@@
-232,12
+231,12
@@
void lib_ring_buffer_switch(const struct lib_ring_buffer_config *config,
* specified sub-buffer, and delivers it if necessary.
*/
static inline
* specified sub-buffer, and delivers it if necessary.
*/
static inline
-void lib_ring_buffer_commit(const struct lib_ring_buffer_config *config,
- const struct lib_ring_buffer_ctx *ctx)
+void lib_ring_buffer_commit(const struct l
ttng_ust_l
ib_ring_buffer_config *config,
+ const struct l
ttng_ust_l
ib_ring_buffer_ctx *ctx)
{
struct channel *chan = ctx->chan;
{
struct channel *chan = ctx->chan;
- struct shm_handle *handle = ctx->handle;
- struct lib_ring_buffer *buf = ctx->buf;
+ struct
lttng_ust_
shm_handle *handle = ctx->handle;
+ struct l
ttng_ust_l
ib_ring_buffer *buf = ctx->buf;
unsigned long offset_end = ctx->buf_offset;
unsigned long endidx = subbuf_index(offset_end - 1, chan);
unsigned long commit_count;
unsigned long offset_end = ctx->buf_offset;
unsigned long endidx = subbuf_index(offset_end - 1, chan);
unsigned long commit_count;
@@
-253,7
+252,7
@@
void lib_ring_buffer_commit(const struct lib_ring_buffer_config *config,
*/
cmm_smp_wmb();
*/
cmm_smp_wmb();
- v_add(config, ctx->slot_size, &shmp
(handle, buf->commit_hot)[endidx].
cc);
+ v_add(config, ctx->slot_size, &shmp
_index(handle, buf->commit_hot, endidx)->
cc);
/*
* commit count read can race with concurrent OOO commit count updates.
/*
* commit count read can race with concurrent OOO commit count updates.
@@
-273,7
+272,7
@@
void lib_ring_buffer_commit(const struct lib_ring_buffer_config *config,
* count reaches back the reserve offset for a specific sub-buffer,
* which is completely independent of the order.
*/
* count reaches back the reserve offset for a specific sub-buffer,
* which is completely independent of the order.
*/
- commit_count = v_read(config, &shmp
(handle, buf->commit_hot)[endidx].
cc);
+ commit_count = v_read(config, &shmp
_index(handle, buf->commit_hot, endidx)->
cc);
lib_ring_buffer_check_deliver(config, buf, chan, offset_end - 1,
commit_count, endidx, handle);
lib_ring_buffer_check_deliver(config, buf, chan, offset_end - 1,
commit_count, endidx, handle);
@@
-297,10
+296,10
@@
void lib_ring_buffer_commit(const struct lib_ring_buffer_config *config,
* Returns 0 upon success, -EPERM if the record cannot be discarded.
*/
static inline
* Returns 0 upon success, -EPERM if the record cannot be discarded.
*/
static inline
-int lib_ring_buffer_try_discard_reserve(const struct lib_ring_buffer_config *config,
- const struct lib_ring_buffer_ctx *ctx)
+int lib_ring_buffer_try_discard_reserve(const struct l
ttng_ust_l
ib_ring_buffer_config *config,
+ const struct l
ttng_ust_l
ib_ring_buffer_ctx *ctx)
{
{
- struct lib_ring_buffer *buf = ctx->buf;
+ struct l
ttng_ust_l
ib_ring_buffer *buf = ctx->buf;
unsigned long end_offset = ctx->pre_offset + ctx->slot_size;
/*
unsigned long end_offset = ctx->pre_offset + ctx->slot_size;
/*
@@
-317,7
+316,7
@@
int lib_ring_buffer_try_discard_reserve(const struct lib_ring_buffer_config *con
*/
save_last_tsc(config, buf, 0ULL);
*/
save_last_tsc(config, buf, 0ULL);
- if (likely(v_cmpxchg(config, &buf->offset, end_offset, ctx->pre_offset)
+ if (
caa_
likely(v_cmpxchg(config, &buf->offset, end_offset, ctx->pre_offset)
!= end_offset))
return -EPERM;
else
!= end_offset))
return -EPERM;
else
@@
-325,29
+324,29
@@
int lib_ring_buffer_try_discard_reserve(const struct lib_ring_buffer_config *con
}
static inline
}
static inline
-void channel_record_disable(const struct lib_ring_buffer_config *config,
+void channel_record_disable(const struct l
ttng_ust_l
ib_ring_buffer_config *config,
struct channel *chan)
{
uatomic_inc(&chan->record_disabled);
}
static inline
struct channel *chan)
{
uatomic_inc(&chan->record_disabled);
}
static inline
-void channel_record_enable(const struct lib_ring_buffer_config *config,
+void channel_record_enable(const struct l
ttng_ust_l
ib_ring_buffer_config *config,
struct channel *chan)
{
uatomic_dec(&chan->record_disabled);
}
static inline
struct channel *chan)
{
uatomic_dec(&chan->record_disabled);
}
static inline
-void lib_ring_buffer_record_disable(const struct lib_ring_buffer_config *config,
- struct lib_ring_buffer *buf)
+void lib_ring_buffer_record_disable(const struct l
ttng_ust_l
ib_ring_buffer_config *config,
+ struct l
ttng_ust_l
ib_ring_buffer *buf)
{
uatomic_inc(&buf->record_disabled);
}
static inline
{
uatomic_inc(&buf->record_disabled);
}
static inline
-void lib_ring_buffer_record_enable(const struct lib_ring_buffer_config *config,
- struct lib_ring_buffer *buf)
+void lib_ring_buffer_record_enable(const struct l
ttng_ust_l
ib_ring_buffer_config *config,
+ struct l
ttng_ust_l
ib_ring_buffer *buf)
{
uatomic_dec(&buf->record_disabled);
}
{
uatomic_dec(&buf->record_disabled);
}
This page took
0.031526 seconds
and
4
git commands to generate.