From: Julien Desfossez Date: Thu, 30 Jun 2016 15:43:50 +0000 (-0400) Subject: Add ustctl command to regenerate the statedump X-Git-Tag: v2.9.0-rc1~51 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f53329f3d1489c6241f8606954835357a56a9eab;p=lttng-ust.git Add ustctl command to regenerate the statedump Signed-off-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ust-ctl.h b/include/lttng/ust-ctl.h index 06de95c2..08122a79 100644 --- a/include/lttng/ust-ctl.h +++ b/include/lttng/ust-ctl.h @@ -260,6 +260,9 @@ int ustctl_get_instance_id(struct ustctl_consumer_stream *stream, /* returns whether UST has perf counters support. */ int ustctl_has_perf_counters(void); +/* Regenerate the statedump. */ +int ustctl_regenerate_statedump(int sock, int handle); + /* event registry management */ enum ustctl_socket_type { diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index 97445d5e..7b46eda2 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -2183,6 +2183,23 @@ 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) {