void lttng_context_vtid_reset(void);
void lttng_context_vpid_reset(void);
-const struct lttng_ust_lib_ring_buffer_config *lttng_client_callbacks_metadata;
-const struct lttng_ust_lib_ring_buffer_config *lttng_client_callbacks_discard;
-const struct lttng_ust_lib_ring_buffer_config *lttng_client_callbacks_overwrite;
+const struct lttng_ust_lib_ring_buffer_client_cb *lttng_client_callbacks_metadata;
+const struct lttng_ust_lib_ring_buffer_client_cb *lttng_client_callbacks_discard;
+const struct lttng_ust_lib_ring_buffer_client_cb *lttng_client_callbacks_overwrite;
struct cds_list_head ltt_transport_list;
struct ltt_transport *ltt_transport_find(const char *name);
#include <lttng/usterr-signal-safe.h>
#include <lttng/ust-comm.h>
#include <lttng/ust-events.h>
+#include <sys/mman.h>
#include "../libringbuffer/backend.h"
#include "../libringbuffer/frontend.h"
struct channel *chan;
size_t chan_size;
struct lttng_ust_lib_ring_buffer_config *config;
+ int ret;
handle = channel_handle_create(chan_data->shm_fd,
chan_data->wait_fd,
channel_destroy(chan, handle, 1);
return NULL;
}
+ /* Replace the object table pointer. */
+ ret = munmap(handle->table->objects[0].memory_map,
+ handle->table->objects[0].memory_map_size);
+ if (ret) {
+ perror("munmap");
+ assert(0);
+ }
+ handle->table->objects[0].memory_map = (char *) handle->shadow_chan;
+ handle->table->objects[0].is_shadow = 1;
return handle;
}
.client_type = LTTNG_CLIENT_TYPE,
};
-const struct lttng_ust_lib_ring_buffer_config *LTTNG_CLIENT_CALLBACKS = &client_config;
+const struct lttng_ust_lib_ring_buffer_client_cb *LTTNG_CLIENT_CALLBACKS = &client_config.cb;
static
struct ltt_channel *_channel_create(const char *name,
.client_type = LTTNG_CLIENT_TYPE,
};
-const struct lttng_ust_lib_ring_buffer_config *LTTNG_CLIENT_CALLBACKS = &client_config;
+const struct lttng_ust_lib_ring_buffer_client_cb *LTTNG_CLIENT_CALLBACKS = &client_config.cb;
static
struct ltt_channel *_channel_create(const char *name,
{
int ret, i;
- ret = munmap(obj->memory_map, obj->memory_map_size);
- if (ret) {
- PERROR("umnmap");
- assert(0);
- }
+ if (!obj->is_shadow) {
+ ret = munmap(obj->memory_map, obj->memory_map_size);
+ if (ret) {
+ PERROR("umnmap");
+ assert(0);
+ }
+ }
ret = close(obj->shm_fd);
if (ret) {
PERROR("close");
int shm_fd; /* shm fd */
int wait_fd[2]; /* fd for wait/wakeup */
char *memory_map;
+ int is_shadow;
size_t memory_map_size;
size_t allocated_len;
};