X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust-ctl%2Fustctl.c;h=4067758254438c45e2db0363ba55ee8d5d2f08a0;hb=4925438891788d3abc0520fd3d09d3f4003d992d;hp=fcb6f0d55c398f2cc534d7f8aa27c5f4e21b5657;hpb=1ff31389b273bb27a619a794ce414c65e73cb6ea;p=lttng-ust.git diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index fcb6f0d5..40677582 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -18,6 +18,7 @@ #define _GNU_SOURCE #include +#include #include #include #include @@ -1725,7 +1726,24 @@ int ustctl_get_sequence_number(struct ustctl_consumer_stream *stream, return client_cb->sequence_number(buf, handle, seq); } -#if defined(__x86_64__) || defined(__i386__) +int ustctl_get_instance_id(struct ustctl_consumer_stream *stream, + uint64_t *id) +{ + struct lttng_ust_client_lib_ring_buffer_client_cb *client_cb; + struct lttng_ust_lib_ring_buffer *buf; + struct lttng_ust_shm_handle *handle; + + if (!stream || !id) + return -EINVAL; + buf = stream->buf; + handle = stream->chan->chan->handle; + client_cb = get_client_cb(buf, handle); + if (!client_cb) + return -ENOSYS; + return client_cb->instance_id(buf, handle, id); +} + +#ifdef LTTNG_UST_HAVE_PERF_EVENT int ustctl_has_perf_counters(void) { @@ -2166,10 +2184,28 @@ int ustctl_reply_register_channel(int sock, return 0; } +/* Regenerate the statedump. */ +int ustctl_regenerate_statedump(int sock, int handle) +{ + struct ustcomm_ust_msg lum; + struct ustcomm_ust_reply lur; + int ret; + + memset(&lum, 0, sizeof(lum)); + lum.handle = handle; + lum.cmd = LTTNG_UST_SESSION_STATEDUMP; + ret = ustcomm_send_app_cmd(sock, &lum, &lur); + if (ret) + return ret; + DBG("Regenerated statedump for handle %u", handle); + return 0; +} + static __attribute__((constructor)) void ustctl_init(void) { init_usterr(); + lttng_ust_getenv_init(); /* Needs init_usterr() to be completed. */ lttng_ust_clock_init(); lttng_ring_buffer_metadata_client_init(); lttng_ring_buffer_client_overwrite_init();