X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=liblttng-ust-ctl%2Fustctl.c;h=b4234effc01212bb43f4150716429364a4f340e4;hb=7a7849896a95db678d916ccb7c5d91371828e3f8;hp=3d510f6e0760f334db9635996e7754e8e3ca78e5;hpb=c1fca4572d4458b2e6e96752f9efc595c5f72405;p=lttng-ust.git diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index 3d510f6e..b4234eff 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "../libringbuffer/backend.h" #include "../libringbuffer/frontend.h" @@ -422,6 +423,7 @@ struct lttng_ust_shm_handle *ustctl_map_channel(struct lttng_ust_object_data *ch 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, @@ -474,6 +476,15 @@ struct lttng_ust_shm_handle *ustctl_map_channel(struct lttng_ust_object_data *ch 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; }