};
struct channel;
-struct shm_handle;
+struct lttng_ust_shm_handle;
struct ltt_channel_ops {
struct ltt_channel *(*channel_create)(const char *name,
uint64_t *memory_map_size);
void (*channel_destroy)(struct ltt_channel *ltt_chan);
struct lib_ring_buffer *(*buffer_read_open)(struct channel *chan,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
int *shm_fd, int *wait_fd,
uint64_t *memory_map_size);
void (*buffer_read_close)(struct lib_ring_buffer *buf,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
int (*event_reserve)(struct lib_ring_buffer_ctx *ctx,
uint32_t event_id);
void (*event_commit)(struct lib_ring_buffer_ctx *ctx);
* may change due to concurrent writes.
*/
size_t (*packet_avail_size)(struct channel *chan,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
//wait_queue_head_t *(*get_reader_wait_queue)(struct channel *chan);
//wait_queue_head_t *(*get_hp_wait_queue)(struct channel *chan);
int (*is_finalized)(struct channel *chan);
int (*is_disabled)(struct channel *chan);
- int (*flush_buffer)(struct channel *chan, struct shm_handle *handle);
+ int (*flush_buffer)(struct channel *chan, struct lttng_ust_shm_handle *handle);
};
struct ltt_channel {
struct cds_list_head list; /* Channel list */
struct ltt_channel_ops *ops;
int header_type; /* 0: unset, 1: compact, 2: large */
- struct shm_handle *handle; /* shared-memory handle */
+ struct lttng_ust_shm_handle *handle; /* shared-memory handle */
int metadata_dumped:1;
};
int ustctl_calibrate(int sock, struct lttng_ust_calibrate *calibrate);
/*
- * Map channel shm_handle and add streams. Typically performed by the
+ * Map channel lttng_ust_shm_handle and add streams. Typically performed by the
* consumer to map the objects into its memory space.
*/
-struct shm_handle *ustctl_map_channel(struct lttng_ust_object_data *chan_data);
-int ustctl_add_stream(struct shm_handle *shm_handle,
+struct lttng_ust_shm_handle *ustctl_map_channel(struct lttng_ust_object_data *chan_data);
+int ustctl_add_stream(struct lttng_ust_shm_handle *lttng_ust_shm_handle,
struct lttng_ust_object_data *stream_data);
/*
- * Note: the lttng_ust_object_data from which the shm_handle is derived can only
+ * Note: the lttng_ust_object_data from which the lttng_ust_shm_handle is derived can only
* be released after unmapping the handle.
*/
-void ustctl_unmap_channel(struct shm_handle *shm_handle);
+void ustctl_unmap_channel(struct lttng_ust_shm_handle *lttng_ust_shm_handle);
/* Buffer operations */
-struct shm_handle;
+struct lttng_ust_shm_handle;
struct lib_ring_buffer;
/* Open/close stream buffers for read */
-struct lib_ring_buffer *ustctl_open_stream_read(struct shm_handle *handle,
+struct lib_ring_buffer *ustctl_open_stream_read(struct lttng_ust_shm_handle *handle,
int cpu);
-void ustctl_close_stream_read(struct shm_handle *handle,
+void ustctl_close_stream_read(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf);
/* For mmap mode, readable without "get" operation */
-int ustctl_get_mmap_len(struct shm_handle *handle,
+int ustctl_get_mmap_len(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf,
unsigned long *len);
-int ustctl_get_max_subbuf_size(struct shm_handle *handle,
+int ustctl_get_max_subbuf_size(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf,
unsigned long *len);
* For mmap mode, operate on the current packet (between get/put or
* get_next/put_next).
*/
-void *ustctl_get_mmap_base(struct shm_handle *handle,
+void *ustctl_get_mmap_base(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf);
-int ustctl_get_mmap_read_offset(struct shm_handle *handle,
+int ustctl_get_mmap_read_offset(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf, unsigned long *off);
-int ustctl_get_subbuf_size(struct shm_handle *handle,
+int ustctl_get_subbuf_size(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf, unsigned long *len);
-int ustctl_get_padded_subbuf_size(struct shm_handle *handle,
+int ustctl_get_padded_subbuf_size(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf, unsigned long *len);
-int ustctl_get_next_subbuf(struct shm_handle *handle,
+int ustctl_get_next_subbuf(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf);
-int ustctl_put_next_subbuf(struct shm_handle *handle,
+int ustctl_put_next_subbuf(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf);
/* snapshot */
-int ustctl_snapshot(struct shm_handle *handle,
+int ustctl_snapshot(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf);
-int ustctl_snapshot_get_consumed(struct shm_handle *handle,
+int ustctl_snapshot_get_consumed(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf, unsigned long *pos);
-int ustctl_snapshot_get_produced(struct shm_handle *handle,
+int ustctl_snapshot_get_produced(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf, unsigned long *pos);
-int ustctl_get_subbuf(struct shm_handle *handle,
+int ustctl_get_subbuf(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf, unsigned long *pos);
-int ustctl_put_subbuf(struct shm_handle *handle,
+int ustctl_put_subbuf(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf);
/* Release object created by members of this API */
struct channel;
struct lib_ring_buffer_config;
struct lib_ring_buffer_ctx;
-struct shm_handle *handle;
+struct lttng_ust_shm_handle *handle;
/*
* Ring buffer client callbacks. Only used by slow path, never on fast path.
size_t (*subbuffer_header_size) (void);
void (*buffer_begin) (struct lib_ring_buffer *buf, u64 tsc,
unsigned int subbuf_idx,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
void (*buffer_end) (struct lib_ring_buffer *buf, u64 tsc,
unsigned int subbuf_idx, unsigned long data_size,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
/* Optional callbacks (can be set to NULL) */
/* Called at buffer creation/finalize */
int (*buffer_create) (struct lib_ring_buffer *buf, void *priv,
int cpu, const char *name,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
/*
* Clients should guarantee that no new reader handle can be opened
* after finalize.
*/
void (*buffer_finalize) (struct lib_ring_buffer *buf,
void *priv, int cpu,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
/*
* Extract header length, payload length and timestamp from event
struct channel *chan, struct lib_ring_buffer *buf,
size_t offset, size_t *header_len,
size_t *payload_len, u64 *timestamp,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
};
/*
/* input received by lib_ring_buffer_reserve(), saved here. */
struct channel *chan; /* channel */
void *priv; /* client private data */
- struct shm_handle *handle; /* shared-memory handle */
+ struct lttng_ust_shm_handle *handle; /* shared-memory handle */
size_t data_size; /* size of payload */
int largest_align; /*
* alignment of the largest element
void lib_ring_buffer_ctx_init(struct lib_ring_buffer_ctx *ctx,
struct channel *chan, void *priv,
size_t data_size, int largest_align,
- int cpu, struct shm_handle *handle)
+ int cpu, struct lttng_ust_shm_handle *handle)
{
ctx->chan = chan;
ctx->priv = priv;
extern size_t lib_ring_buffer_read(struct lib_ring_buffer_backend *bufb,
size_t offset, void *dest, size_t len,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
extern int lib_ring_buffer_read_cstr(struct lib_ring_buffer_backend *bufb,
size_t offset, void *dest, size_t len,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
/*
* Return the address where a given offset is located.
extern void *
lib_ring_buffer_offset_address(struct lib_ring_buffer_backend *bufb,
size_t offset,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
extern void *
lib_ring_buffer_read_offset_address(struct lib_ring_buffer_backend *bufb,
size_t offset,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
/**
* lib_ring_buffer_write - write data to a buffer backend
{
struct lib_ring_buffer_backend *bufb = &ctx->buf->backend;
struct channel_backend *chanb = &ctx->chan->backend;
- struct shm_handle *handle = ctx->handle;
+ struct lttng_ust_shm_handle *handle = ctx->handle;
size_t sbidx;
size_t offset = ctx->buf_offset;
struct lib_ring_buffer_backend_pages_shmp *rpages;
unsigned long lib_ring_buffer_get_records_unread(
const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *buf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct lib_ring_buffer_backend *bufb = &buf->backend;
struct lib_ring_buffer_backend_pages_shmp *pages;
int lib_ring_buffer_backend_create(struct lib_ring_buffer_backend *bufb,
struct channel_backend *chan, int cpu,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
struct shm_object *shmobj);
void channel_backend_unregister_notifiers(struct channel_backend *chanb);
void lib_ring_buffer_backend_free(struct lib_ring_buffer_backend *bufb);
const char *name,
const struct lib_ring_buffer_config *config,
void *priv, size_t subbuf_size,
- size_t num_subbuf, struct shm_handle *handle);
+ size_t num_subbuf, struct lttng_ust_shm_handle *handle);
void channel_backend_free(struct channel_backend *chanb,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
void lib_ring_buffer_backend_reset(struct lib_ring_buffer_backend *bufb,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
void channel_backend_reset(struct channel_backend *chanb);
int lib_ring_buffer_backend_init(void);
static inline
void subbuffer_count_record(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer_backend *bufb,
- unsigned long idx, struct shm_handle *handle)
+ unsigned long idx, struct lttng_ust_shm_handle *handle)
{
unsigned long sb_bindex;
static inline
void subbuffer_consume_record(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer_backend *bufb,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
unsigned long sb_bindex;
const struct lib_ring_buffer_config *config,
struct lib_ring_buffer_backend *bufb,
unsigned long idx,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
unsigned long sb_bindex;
const struct lib_ring_buffer_config *config,
struct lib_ring_buffer_backend *bufb,
unsigned long idx,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct lib_ring_buffer_backend_pages_shmp *pages;
unsigned long overruns, sb_bindex;
struct lib_ring_buffer_backend *bufb,
unsigned long idx,
unsigned long data_size,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct lib_ring_buffer_backend_pages_shmp *pages;
unsigned long sb_bindex;
unsigned long subbuffer_get_read_data_size(
const struct lib_ring_buffer_config *config,
struct lib_ring_buffer_backend *bufb,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct lib_ring_buffer_backend_pages_shmp *pages;
unsigned long sb_bindex;
const struct lib_ring_buffer_config *config,
struct lib_ring_buffer_backend *bufb,
unsigned long idx,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct lib_ring_buffer_backend_pages_shmp *pages;
unsigned long sb_bindex;
void lib_ring_buffer_clear_noref(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer_backend *bufb,
unsigned long idx,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
unsigned long id, new_id;
void lib_ring_buffer_set_noref_offset(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer_backend *bufb,
unsigned long idx, unsigned long offset,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
if (config->mode != RING_BUFFER_OVERWRITE)
return;
struct channel_backend *chanb,
unsigned long consumed_idx,
unsigned long consumed_count,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
unsigned long old_id, new_id;
*/
extern
-struct shm_handle *channel_create(const struct lib_ring_buffer_config *config,
+struct lttng_ust_shm_handle *channel_create(const struct lib_ring_buffer_config *config,
const char *name, void *priv,
void *buf_addr,
size_t subbuf_size, size_t num_subbuf,
/* channel_handle_create - for consumer. */
extern
-struct shm_handle *channel_handle_create(int shm_fd, int wait_fd,
+struct lttng_ust_shm_handle *channel_handle_create(int shm_fd, int wait_fd,
uint64_t memory_map_size);
/* channel_handle_add_stream - for consumer. */
extern
-int channel_handle_add_stream(struct shm_handle *handle,
+int channel_handle_add_stream(struct lttng_ust_shm_handle *handle,
int shm_fd, int wait_fd, uint64_t memory_map_size);
/*
* channel.
*/
extern
-void *channel_destroy(struct channel *chan, struct shm_handle *handle,
+void *channel_destroy(struct channel *chan, struct lttng_ust_shm_handle *handle,
int shadow);
extern struct lib_ring_buffer *channel_get_ring_buffer(
const struct lib_ring_buffer_config *config,
struct channel *chan, int cpu,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
int *shm_fd, int *wait_fd,
uint64_t *memory_map_size);
extern int lib_ring_buffer_open_read(struct lib_ring_buffer *buf,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
int shadow);
extern void lib_ring_buffer_release_read(struct lib_ring_buffer *buf,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
int shadow);
/*
extern int lib_ring_buffer_snapshot(struct lib_ring_buffer *buf,
unsigned long *consumed,
unsigned long *produced,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
extern void lib_ring_buffer_move_consumer(struct lib_ring_buffer *buf,
unsigned long consumed_new,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
extern int lib_ring_buffer_get_subbuf(struct lib_ring_buffer *buf,
unsigned long consumed,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
extern void lib_ring_buffer_put_subbuf(struct lib_ring_buffer *buf,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
/*
* lib_ring_buffer_get_next_subbuf/lib_ring_buffer_put_next_subbuf are helpers
* to read sub-buffers sequentially.
*/
static inline int lib_ring_buffer_get_next_subbuf(struct lib_ring_buffer *buf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
int ret;
static inline
void lib_ring_buffer_put_next_subbuf(struct lib_ring_buffer *buf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
lib_ring_buffer_put_subbuf(buf, handle);
lib_ring_buffer_move_consumer(buf, subbuf_align(buf->cons_snapshot,
extern void channel_reset(struct channel *chan);
extern void lib_ring_buffer_reset(struct lib_ring_buffer *buf,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
static inline
unsigned long lib_ring_buffer_get_offset(const struct lib_ring_buffer_config *config,
unsigned long lib_ring_buffer_get_read_data_size(
const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *buf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
return subbuffer_get_read_data_size(config, &buf->backend, handle);
}
struct lib_ring_buffer_ctx *ctx)
{
struct channel *chan = ctx->chan;
- struct shm_handle *handle = ctx->handle;
+ struct lttng_ust_shm_handle *handle = ctx->handle;
struct lib_ring_buffer *buf;
unsigned long o_begin, o_end, o_old;
size_t before_hdr_pad = 0;
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)
+ struct lttng_ust_shm_handle *handle)
{
lib_ring_buffer_switch_slow(buf, mode, handle);
}
const struct lib_ring_buffer_ctx *ctx)
{
struct channel *chan = ctx->chan;
- struct shm_handle *handle = ctx->handle;
+ struct lttng_ust_shm_handle *handle = ctx->handle;
struct lib_ring_buffer *buf = ctx->buf;
unsigned long offset_end = ctx->buf_offset;
unsigned long endidx = subbuf_index(offset_end - 1, chan);
extern
void lib_ring_buffer_switch_slow(struct lib_ring_buffer *buf,
enum switch_mode mode,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
/* Buffer write helpers */
struct lib_ring_buffer *buf,
unsigned long commit_count,
unsigned long idx,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
if (config->oops == RING_BUFFER_OOPS_CONSISTENCY)
v_set(config, &shmp_index(handle, buf->commit_hot, idx)->seq, commit_count);
int lib_ring_buffer_poll_deliver(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *buf,
struct channel *chan,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
unsigned long consumed_old, consumed_idx, commit_count, write_offset;
unsigned long lib_ring_buffer_get_data_size(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *buf,
unsigned long idx,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
return subbuffer_get_data_size(config, &buf->backend, idx, handle);
}
int lib_ring_buffer_reserve_committed(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *buf,
struct channel *chan,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
unsigned long offset, idx, commit_count;
unsigned long offset,
unsigned long commit_count,
unsigned long idx,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
unsigned long old_commit_count = commit_count
- chan->backend.subbuf_size;
unsigned long buf_offset,
unsigned long commit_count,
size_t slot_size,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
unsigned long offset, commit_seq_old;
extern int lib_ring_buffer_create(struct lib_ring_buffer *buf,
struct channel_backend *chanb, int cpu,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
struct shm_object *shmobj);
extern void lib_ring_buffer_free(struct lib_ring_buffer *buf,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
/* Keep track of trap nesting inside ring buffer code */
extern __thread unsigned int lib_ring_buffer_nesting;
struct lib_ring_buffer_backend *bufb,
size_t size, size_t num_subbuf,
int extra_reader_sb,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
struct shm_object *shmobj)
{
struct channel_backend *chanb = &shmp(handle, bufb->chan)->backend;
int lib_ring_buffer_backend_create(struct lib_ring_buffer_backend *bufb,
struct channel_backend *chanb, int cpu,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
struct shm_object *shmobj)
{
const struct lib_ring_buffer_config *config = &chanb->config;
}
void lib_ring_buffer_backend_reset(struct lib_ring_buffer_backend *bufb,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel_backend *chanb = &shmp(handle, bufb->chan)->backend;
const struct lib_ring_buffer_config *config = &chanb->config;
* @parent: dentry of parent directory, %NULL for root directory
* @subbuf_size: size of sub-buffers (> PAGE_SIZE, power of 2)
* @num_subbuf: number of sub-buffers (power of 2)
- * @shm_handle: shared memory handle
+ * @lttng_ust_shm_handle: shared memory handle
*
* Returns channel pointer if successful, %NULL otherwise.
*
const char *name,
const struct lib_ring_buffer_config *config,
void *priv, size_t subbuf_size, size_t num_subbuf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = caa_container_of(chanb, struct channel, backend);
unsigned int i;
* Destroy all channel buffers and frees the channel.
*/
void channel_backend_free(struct channel_backend *chanb,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
const struct lib_ring_buffer_config *config = &chanb->config;
unsigned int i;
* Returns the length copied.
*/
size_t lib_ring_buffer_read(struct lib_ring_buffer_backend *bufb, size_t offset,
- void *dest, size_t len, struct shm_handle *handle)
+ void *dest, size_t len, struct lttng_ust_shm_handle *handle)
{
struct channel_backend *chanb = &shmp(handle, bufb->chan)->backend;
const struct lib_ring_buffer_config *config = &chanb->config;
* Should be protected by get_subbuf/put_subbuf.
*/
int lib_ring_buffer_read_cstr(struct lib_ring_buffer_backend *bufb, size_t offset,
- void *dest, size_t len, struct shm_handle *handle)
+ void *dest, size_t len, struct lttng_ust_shm_handle *handle)
{
struct channel_backend *chanb = &shmp(handle, bufb->chan)->backend;
const struct lib_ring_buffer_config *config = &chanb->config;
*/
void *lib_ring_buffer_read_offset_address(struct lib_ring_buffer_backend *bufb,
size_t offset,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct lib_ring_buffer_backend_pages_shmp *rpages;
struct channel_backend *chanb = &shmp(handle, bufb->chan)->backend;
*/
void *lib_ring_buffer_offset_address(struct lib_ring_buffer_backend *bufb,
size_t offset,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
size_t sbidx;
struct lib_ring_buffer_backend_pages_shmp *rpages;
static
void lib_ring_buffer_print_errors(struct channel *chan,
struct lib_ring_buffer *buf, int cpu,
- struct shm_handle *handle);
+ struct lttng_ust_shm_handle *handle);
/*
* Must be called under cpu hotplug protection.
*/
void lib_ring_buffer_free(struct lib_ring_buffer *buf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = shmp(handle, buf->backend.chan);
* current iterator record is reset.
*/
void lib_ring_buffer_reset(struct lib_ring_buffer *buf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = shmp(handle, buf->backend.chan);
const struct lib_ring_buffer_config *config = &chan->backend.config;
*/
int lib_ring_buffer_create(struct lib_ring_buffer *buf,
struct channel_backend *chanb, int cpu,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
struct shm_object *shmobj)
{
const struct lib_ring_buffer_config *config = &chanb->config;
#endif //0
static void lib_ring_buffer_start_switch_timer(struct lib_ring_buffer *buf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = shmp(handle, buf->backend.chan);
//const struct lib_ring_buffer_config *config = &chan->backend.config;
}
static void lib_ring_buffer_stop_switch_timer(struct lib_ring_buffer *buf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = shmp(handle, buf->backend.chan);
#endif //0
static void lib_ring_buffer_start_read_timer(struct lib_ring_buffer *buf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = shmp(handle, buf->backend.chan);
const struct lib_ring_buffer_config *config = &chan->backend.config;
}
static void lib_ring_buffer_stop_read_timer(struct lib_ring_buffer *buf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = shmp(handle, buf->backend.chan);
const struct lib_ring_buffer_config *config = &chan->backend.config;
}
static void channel_unregister_notifiers(struct channel *chan,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
const struct lib_ring_buffer_config *config = &chan->backend.config;
int cpu;
//channel_backend_unregister_notifiers(&chan->backend);
}
-static void channel_free(struct channel *chan, struct shm_handle *handle,
+static void channel_free(struct channel *chan, struct lttng_ust_shm_handle *handle,
int shadow)
{
if (!shadow)
* Holds cpu hotplug.
* Returns NULL on failure.
*/
-struct shm_handle *channel_create(const struct lib_ring_buffer_config *config,
+struct lttng_ust_shm_handle *channel_create(const struct lib_ring_buffer_config *config,
const char *name, void *priv, void *buf_addr,
size_t subbuf_size,
size_t num_subbuf, unsigned int switch_timer_interval,
int ret, cpu;
size_t shmsize;
struct channel *chan;
- struct shm_handle *handle;
+ struct lttng_ust_shm_handle *handle;
struct shm_object *shmobj;
struct shm_ref *ref;
read_timer_interval))
return NULL;
- handle = zmalloc(sizeof(struct shm_handle));
+ handle = zmalloc(sizeof(struct lttng_ust_shm_handle));
if (!handle)
return NULL;
return NULL;
}
-struct shm_handle *channel_handle_create(int shm_fd, int wait_fd,
+struct lttng_ust_shm_handle *channel_handle_create(int shm_fd, int wait_fd,
uint64_t memory_map_size)
{
- struct shm_handle *handle;
+ struct lttng_ust_shm_handle *handle;
struct shm_object *object;
- handle = zmalloc(sizeof(struct shm_handle));
+ handle = zmalloc(sizeof(struct lttng_ust_shm_handle));
if (!handle)
return NULL;
return NULL;
}
-int channel_handle_add_stream(struct shm_handle *handle,
+int channel_handle_add_stream(struct lttng_ust_shm_handle *handle,
int shm_fd, int wait_fd, uint64_t memory_map_size)
{
struct shm_object *object;
}
static
-void channel_release(struct channel *chan, struct shm_handle *handle,
+void channel_release(struct channel *chan, struct lttng_ust_shm_handle *handle,
int shadow)
{
channel_free(chan, handle, shadow);
* They should release their handle at that point. Returns the private
* data pointer.
*/
-void *channel_destroy(struct channel *chan, struct shm_handle *handle,
+void *channel_destroy(struct channel *chan, struct lttng_ust_shm_handle *handle,
int shadow)
{
const struct lib_ring_buffer_config *config = &chan->backend.config;
struct lib_ring_buffer *channel_get_ring_buffer(
const struct lib_ring_buffer_config *config,
struct channel *chan, int cpu,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
int *shm_fd, int *wait_fd,
uint64_t *memory_map_size)
{
}
int lib_ring_buffer_open_read(struct lib_ring_buffer *buf,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
int shadow)
{
if (shadow) {
}
void lib_ring_buffer_release_read(struct lib_ring_buffer *buf,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
int shadow)
{
struct channel *chan = shmp(handle, buf->backend.chan);
int lib_ring_buffer_snapshot(struct lib_ring_buffer *buf,
unsigned long *consumed, unsigned long *produced,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = shmp(handle, buf->backend.chan);
const struct lib_ring_buffer_config *config = &chan->backend.config;
*/
void lib_ring_buffer_move_consumer(struct lib_ring_buffer *buf,
unsigned long consumed_new,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct lib_ring_buffer_backend *bufb = &buf->backend;
struct channel *chan = shmp(handle, bufb->chan);
*/
int lib_ring_buffer_get_subbuf(struct lib_ring_buffer *buf,
unsigned long consumed,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = shmp(handle, buf->backend.chan);
const struct lib_ring_buffer_config *config = &chan->backend.config;
* @buf: ring buffer
*/
void lib_ring_buffer_put_subbuf(struct lib_ring_buffer *buf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct lib_ring_buffer_backend *bufb = &buf->backend;
struct channel *chan = shmp(handle, bufb->chan);
struct channel *chan,
unsigned long cons_offset,
int cpu,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
const struct lib_ring_buffer_config *config = &chan->backend.config;
unsigned long cons_idx, commit_count, commit_count_sb;
void lib_ring_buffer_print_buffer_errors(struct lib_ring_buffer *buf,
struct channel *chan,
void *priv, int cpu,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
const struct lib_ring_buffer_config *config = &chan->backend.config;
unsigned long write_offset, cons_offset;
static
void lib_ring_buffer_print_errors(struct channel *chan,
struct lib_ring_buffer *buf, int cpu,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
const struct lib_ring_buffer_config *config = &chan->backend.config;
void *priv = chan->backend.priv;
struct channel *chan,
struct switch_offsets *offsets,
u64 tsc,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
const struct lib_ring_buffer_config *config = &chan->backend.config;
unsigned long oldidx = subbuf_index(offsets->old, chan);
struct channel *chan,
struct switch_offsets *offsets,
u64 tsc,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
const struct lib_ring_buffer_config *config = &chan->backend.config;
unsigned long oldidx = subbuf_index(offsets->old - 1, chan);
struct channel *chan,
struct switch_offsets *offsets,
u64 tsc,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
const struct lib_ring_buffer_config *config = &chan->backend.config;
unsigned long beginidx = subbuf_index(offsets->begin, chan);
struct channel *chan,
struct switch_offsets *offsets,
u64 tsc,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
const struct lib_ring_buffer_config *config = &chan->backend.config;
unsigned long endidx = subbuf_index(offsets->end - 1, chan);
* for a ACTIVE flush.
*/
void lib_ring_buffer_switch_slow(struct lib_ring_buffer *buf, enum switch_mode mode,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = shmp(handle, buf->backend.chan);
const struct lib_ring_buffer_config *config = &chan->backend.config;
struct lib_ring_buffer_ctx *ctx)
{
const struct lib_ring_buffer_config *config = &chan->backend.config;
- struct shm_handle *handle = ctx->handle;
+ struct lttng_ust_shm_handle *handle = ctx->handle;
unsigned long reserve_commit_diff;
offsets->begin = v_read(config, &buf->offset);
int lib_ring_buffer_reserve_slow(struct lib_ring_buffer_ctx *ctx)
{
struct channel *chan = ctx->chan;
- struct shm_handle *handle = ctx->handle;
+ struct lttng_ust_shm_handle *handle = ctx->handle;
const struct lib_ring_buffer_config *config = &chan->backend.config;
struct lib_ring_buffer *buf;
struct switch_offsets offsets;
void align_shm(struct shm_object *obj, size_t align);
static inline
-int shm_get_wakeup_fd(struct shm_handle *handle, struct shm_ref *ref)
+int shm_get_wakeup_fd(struct lttng_ust_shm_handle *handle, struct shm_ref *ref)
{
struct shm_object_table *table = handle->table;
struct shm_object *obj;
}
static inline
-int shm_get_wait_fd(struct shm_handle *handle, struct shm_ref *ref)
+int shm_get_wait_fd(struct lttng_ust_shm_handle *handle, struct shm_ref *ref)
{
struct shm_object_table *table = handle->table;
struct shm_object *obj;
}
static inline
-int shm_get_object_data(struct shm_handle *handle, struct shm_ref *ref,
+int shm_get_object_data(struct lttng_ust_shm_handle *handle, struct shm_ref *ref,
int *shm_fd, int *wait_fd, uint64_t *memory_map_size)
{
struct shm_object_table *table = handle->table;
struct shm_object objects[];
};
-struct shm_handle {
+struct lttng_ust_shm_handle {
struct shm_object_table *table;
DECLARE_SHMP(struct channel, chan);
/*
static void client_buffer_begin(struct lib_ring_buffer *buf, u64 tsc,
unsigned int subbuf_idx,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = shmp(handle, buf->backend.chan);
struct packet_header *header =
*/
static void client_buffer_end(struct lib_ring_buffer *buf, u64 tsc,
unsigned int subbuf_idx, unsigned long data_size,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = shmp(handle, buf->backend.chan);
struct packet_header *header =
}
static int client_buffer_create(struct lib_ring_buffer *buf, void *priv,
- int cpu, const char *name, struct shm_handle *handle)
+ int cpu, const char *name, struct lttng_ust_shm_handle *handle)
{
return 0;
}
-static void client_buffer_finalize(struct lib_ring_buffer *buf, void *priv, int cpu, struct shm_handle *handle)
+static void client_buffer_finalize(struct lib_ring_buffer *buf, void *priv, int cpu, struct lttng_ust_shm_handle *handle)
{
}
static
struct lib_ring_buffer *ltt_buffer_read_open(struct channel *chan,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
int *shm_fd, int *wait_fd,
uint64_t *memory_map_size)
{
static
void ltt_buffer_read_close(struct lib_ring_buffer *buf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
lib_ring_buffer_release_read(buf, handle, 0);
}
}
static
-int ltt_flush_buffer(struct channel *chan, struct shm_handle *handle)
+int ltt_flush_buffer(struct channel *chan, struct lttng_ust_shm_handle *handle)
{
struct lib_ring_buffer *buf;
int cpu;
static void client_buffer_begin(struct lib_ring_buffer *buf, u64 tsc,
unsigned int subbuf_idx,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = shmp(handle, buf->backend.chan);
struct metadata_packet_header *header =
*/
static void client_buffer_end(struct lib_ring_buffer *buf, u64 tsc,
unsigned int subbuf_idx, unsigned long data_size,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
struct channel *chan = shmp(handle, buf->backend.chan);
struct metadata_packet_header *header =
static int client_buffer_create(struct lib_ring_buffer *buf, void *priv,
int cpu, const char *name,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
return 0;
}
static void client_buffer_finalize(struct lib_ring_buffer *buf,
void *priv, int cpu,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
}
static
struct lib_ring_buffer *ltt_buffer_read_open(struct channel *chan,
- struct shm_handle *handle,
+ struct lttng_ust_shm_handle *handle,
int *shm_fd, int *wait_fd,
uint64_t *memory_map_size)
{
static
void ltt_buffer_read_close(struct lib_ring_buffer *buf,
- struct shm_handle *handle)
+ struct lttng_ust_shm_handle *handle)
{
lib_ring_buffer_release_read(buf, handle, 0);
}
}
static
-size_t ltt_packet_avail_size(struct channel *chan, struct shm_handle *handle)
+size_t ltt_packet_avail_size(struct channel *chan, struct lttng_ust_shm_handle *handle)
{
unsigned long o_begin;
}
static
-int ltt_flush_buffer(struct channel *chan, struct shm_handle *handle)
+int ltt_flush_buffer(struct channel *chan, struct lttng_ust_shm_handle *handle)
{
struct lib_ring_buffer *buf;
int shm_fd, wait_fd;
/* Buffer operations */
/* Map channel shm into process memory */
-struct shm_handle *ustctl_map_channel(struct lttng_ust_object_data *chan_data)
+struct lttng_ust_shm_handle *ustctl_map_channel(struct lttng_ust_object_data *chan_data)
{
- struct shm_handle *handle;
+ struct lttng_ust_shm_handle *handle;
struct channel *chan;
size_t chan_size;
return NULL;
}
/*
- * Set to -1 because the shm_handle destruction will take care
+ * Set to -1 because the lttng_ust_shm_handle destruction will take care
* of closing shm_fd and wait_fd.
*/
chan_data->shm_fd = -1;
}
/* Add stream to channel shm and map its shm into process memory */
-int ustctl_add_stream(struct shm_handle *handle,
+int ustctl_add_stream(struct lttng_ust_shm_handle *handle,
struct lttng_ust_object_data *stream_data)
{
int ret;
return ret;
}
/*
- * Set to -1 because the shm_handle destruction will take care
+ * Set to -1 because the lttng_ust_shm_handle destruction will take care
* of closing shm_fd and wait_fd.
*/
stream_data->shm_fd = -1;
return 0;
}
-void ustctl_unmap_channel(struct shm_handle *handle)
+void ustctl_unmap_channel(struct lttng_ust_shm_handle *handle)
{
struct channel *chan;
channel_destroy(chan, handle, 1);
}
-struct lib_ring_buffer *ustctl_open_stream_read(struct shm_handle *handle,
+struct lib_ring_buffer *ustctl_open_stream_read(struct lttng_ust_shm_handle *handle,
int cpu)
{
struct channel *chan = handle->shadow_chan;
return buf;
}
-void ustctl_close_stream_read(struct shm_handle *handle,
+void ustctl_close_stream_read(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf)
{
lib_ring_buffer_release_read(buf, handle, 1);
/* For mmap mode, readable without "get" operation */
-void *ustctl_get_mmap_base(struct shm_handle *handle,
+void *ustctl_get_mmap_base(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf)
{
return shmp(handle, buf->backend.memory_map);
}
/* returns the length to mmap. */
-int ustctl_get_mmap_len(struct shm_handle *handle,
+int ustctl_get_mmap_len(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf,
unsigned long *len)
{
}
/* returns the maximum size for sub-buffers. */
-int ustctl_get_max_subbuf_size(struct shm_handle *handle,
+int ustctl_get_max_subbuf_size(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf,
unsigned long *len)
{
*/
/* returns the offset of the subbuffer belonging to the mmap reader. */
-int ustctl_get_mmap_read_offset(struct shm_handle *handle,
+int ustctl_get_mmap_read_offset(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf, unsigned long *off)
{
struct channel *chan = handle->shadow_chan;
}
/* returns the size of the current sub-buffer, without padding (for mmap). */
-int ustctl_get_subbuf_size(struct shm_handle *handle,
+int ustctl_get_subbuf_size(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf, unsigned long *len)
{
struct channel *chan = handle->shadow_chan;
}
/* returns the size of the current sub-buffer, without padding (for mmap). */
-int ustctl_get_padded_subbuf_size(struct shm_handle *handle,
+int ustctl_get_padded_subbuf_size(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf, unsigned long *len)
{
struct channel *chan = handle->shadow_chan;
}
/* Get exclusive read access to the next sub-buffer that can be read. */
-int ustctl_get_next_subbuf(struct shm_handle *handle,
+int ustctl_get_next_subbuf(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf)
{
return lib_ring_buffer_get_next_subbuf(buf, handle);
/* Release exclusive sub-buffer access, move consumer forward. */
-int ustctl_put_next_subbuf(struct shm_handle *handle,
+int ustctl_put_next_subbuf(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf)
{
lib_ring_buffer_put_next_subbuf(buf, handle);
/* snapshot */
/* Get a snapshot of the current ring buffer producer and consumer positions */
-int ustctl_snapshot(struct shm_handle *handle,
+int ustctl_snapshot(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf)
{
return lib_ring_buffer_snapshot(buf, &buf->cons_snapshot,
}
/* Get the consumer position (iteration start) */
-int ustctl_snapshot_get_consumed(struct shm_handle *handle,
+int ustctl_snapshot_get_consumed(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf, unsigned long *pos)
{
*pos = buf->cons_snapshot;
}
/* Get the producer position (iteration end) */
-int ustctl_snapshot_get_produced(struct shm_handle *handle,
+int ustctl_snapshot_get_produced(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf, unsigned long *pos)
{
*pos = buf->prod_snapshot;
}
/* Get exclusive read access to the specified sub-buffer position */
-int ustctl_get_subbuf(struct shm_handle *handle,
+int ustctl_get_subbuf(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf, unsigned long *pos)
{
return lib_ring_buffer_get_subbuf(buf, *pos, handle);
}
/* Release exclusive sub-buffer access */
-int ustctl_put_subbuf(struct shm_handle *handle,
+int ustctl_put_subbuf(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf)
{
lib_ring_buffer_put_subbuf(buf, handle);
return 0;
}
-int ustctl_buffer_flush(struct shm_handle *handle,
+int ustctl_buffer_flush(struct lttng_ust_shm_handle *handle,
struct lib_ring_buffer *buf)
{
lib_ring_buffer_switch_slow(buf, SWITCH_ACTIVE, handle);
}
static
-struct shm_handle *map_channel(struct lttng_ust_object_data *chan_data,
+struct lttng_ust_shm_handle *map_channel(struct lttng_ust_object_data *chan_data,
struct lttng_ust_object_data *stream_datas, int nr_check)
{
- struct shm_handle *handle;
+ struct lttng_ust_shm_handle *handle;
struct channel *chan;
int k, ret;
}
static
-void unmap_channel(struct shm_handle *handle)
+void unmap_channel(struct lttng_ust_shm_handle *handle)
{
struct channel *chan;
}
static
-int consume_stream(struct shm_handle *handle, int cpu, char *outfile)
+int consume_stream(struct lttng_ust_shm_handle *handle, int cpu, char *outfile)
{
struct channel *chan;
struct lib_ring_buffer *buf;
int k, ret;
mode_t old_umask;
char pathname[PATH_MAX];
- struct shm_handle *handle;
+ struct lttng_ust_shm_handle *handle;
snprintf(pathname, PATH_MAX - 1, "%s", outputpath);
old_umask = umask(0);
}
static
-struct shm_handle *map_channel(struct lttng_ust_object_data *chan_data,
+struct lttng_ust_shm_handle *map_channel(struct lttng_ust_object_data *chan_data,
struct lttng_ust_object_data *stream_datas, int nr_check)
{
- struct shm_handle *handle;
+ struct lttng_ust_shm_handle *handle;
struct channel *chan;
int k, ret;
}
static
-void unmap_channel(struct shm_handle *handle)
+void unmap_channel(struct lttng_ust_shm_handle *handle)
{
struct channel *chan;
}
static
-int consume_stream(struct shm_handle *handle, int cpu, char *outfile)
+int consume_stream(struct lttng_ust_shm_handle *handle, int cpu, char *outfile)
{
struct channel *chan;
struct lib_ring_buffer *buf;
for (i = 0; i < NR_SESSIONS; i++) {
char pathname[PATH_MAX];
- struct shm_handle *handle;
+ struct lttng_ust_shm_handle *handle;
snprintf(pathname, PATH_MAX - 1, "/tmp/testtrace%u", i);
old_umask = umask(0);