X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust-ctl%2Fustctl.c;h=c11deb6c3d18aeba0538ea890638184a069f7839;hb=02a15cfb0d1fbff3960e184e901c297588b215f0;hp=886e8485bc8cf683736b52b788d04e9cfdc0f1cf;hpb=5f9d3dbc9ce5bb9d9c91027310e3c268e5937d61;p=lttng-ust.git diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index 886e8485..c11deb6c 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -449,6 +449,12 @@ struct lttng_ust_shm_handle *ustctl_map_channel(struct lttng_ust_object_data *ch return NULL; } memcpy(handle->shadow_chan, chan, chan_size); + /* + * The callback pointers in the producer are invalid in the + * consumer. Zero them out. + */ + memset(&handle->shadow_chan->backend.config.cb, 0, + sizeof(handle->shadow_chan->backend.config.cb)); return handle; } @@ -649,9 +655,11 @@ int ustctl_put_subbuf(struct lttng_ust_shm_handle *handle, return 0; } -int ustctl_flush_buffer(struct lttng_ust_shm_handle *handle, - struct lttng_ust_lib_ring_buffer *buf) +void ustctl_flush_buffer(struct lttng_ust_shm_handle *handle, + struct lttng_ust_lib_ring_buffer *buf, + int producer_active) { - lib_ring_buffer_switch_slow(buf, SWITCH_ACTIVE, handle); - return 0; + lib_ring_buffer_switch_slow(buf, + producer_active ? SWITCH_ACTIVE : SWITCH_FLUSH, + handle); }