From: Mathieu Desnoyers Date: Thu, 14 Apr 2016 19:41:15 +0000 (-0400) Subject: Implement session statedump command X-Git-Tag: v2.9.0-rc1~48 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=601252cfa07fa29f15c769fe3f4cf4419311d6f9;p=lttng-modules.git Implement session statedump command Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-abi.c b/lttng-abi.c index 4dd9273f..e193f437 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -569,6 +569,8 @@ long lttng_session_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return lttng_session_list_tracker_pids(session); case LTTNG_KERNEL_SESSION_METADATA_REGEN: return lttng_session_metadata_regenerate(session); + case LTTNG_KERNEL_SESSION_STATEDUMP: + return lttng_session_statedump(session); default: return -ENOIOCTLCMD; } diff --git a/lttng-abi.h b/lttng-abi.h index 9b9a2323..ff1520c3 100644 --- a/lttng-abi.h +++ b/lttng-abi.h @@ -204,6 +204,8 @@ struct lttng_kernel_filter_bytecode { */ #define LTTNG_KERNEL_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58) #define LTTNG_KERNEL_SESSION_METADATA_REGEN _IO(0xF6, 0x59) +/* 0x5A and 0x5B are reserved for a future ABI-breaking cleanup. */ +#define LTTNG_KERNEL_SESSION_STATEDUMP _IO(0xF6, 0x5C) /* Channel FD ioctl */ #define LTTNG_KERNEL_STREAM _IO(0xF6, 0x62) diff --git a/lttng-events.c b/lttng-events.c index 928886f3..bcf59da1 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -213,6 +213,16 @@ void lttng_session_destroy(struct lttng_session *session) kfree(session); } +int lttng_session_statedump(struct lttng_session *session) +{ + int ret; + + mutex_lock(&sessions_mutex); + ret = lttng_statedump_start(session); + mutex_unlock(&sessions_mutex); + return ret; +} + int lttng_session_enable(struct lttng_session *session) { int ret = 0; diff --git a/lttng-events.h b/lttng-events.h index 9c8f03b8..9e05e2f9 100644 --- a/lttng-events.h +++ b/lttng-events.h @@ -533,6 +533,7 @@ int lttng_session_enable(struct lttng_session *session); int lttng_session_disable(struct lttng_session *session); void lttng_session_destroy(struct lttng_session *session); int lttng_session_metadata_regenerate(struct lttng_session *session); +int lttng_session_statedump(struct lttng_session *session); void metadata_cache_destroy(struct kref *kref); struct lttng_channel *lttng_channel_create(struct lttng_session *session,