From: Philippe Proulx Date: Tue, 14 Jun 2016 23:10:30 +0000 (-0400) Subject: Remove calibrate from liblttng-ctl X-Git-Tag: v2.9.0-rc1~15 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b812e5ca9073ddac9cf8db747eb6cf9bea78b85a;p=lttng-tools.git Remove calibrate from liblttng-ctl Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h index d37d6c065..5478641b2 100644 --- a/include/lttng/lttng.h +++ b/include/lttng/lttng.h @@ -111,11 +111,8 @@ extern int lttng_stop_tracing(const char *session_name); extern int lttng_stop_tracing_no_wait(const char *session_name); /* - * Calibrate LTTng overhead. - * - * The chan and handle params can not be NULL. - * - * Return 0 on success else a negative LTTng error code. + * Deprecated: As of LTTng 2.9, this function always returns + * -LTTNG_ERR_UND. */ extern int lttng_calibrate(struct lttng_handle *handle, struct lttng_calibrate *calibrate); diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index 1c2ab6188..839a8600e 100644 --- a/src/common/kernel-ctl/kernel-ctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -398,37 +398,6 @@ int kernctl_wait_quiescent(int fd) LTTNG_KERNEL_WAIT_QUIESCENT); } -int kernctl_calibrate(int fd, struct lttng_kernel_calibrate *calibrate) -{ - int ret; - - if (lttng_kernel_use_old_abi == -1) { - ret = LTTNG_IOCTL_CHECK(fd, LTTNG_KERNEL_CALIBRATE, calibrate); - if (!ret) { - lttng_kernel_use_old_abi = 0; - goto end; - } - lttng_kernel_use_old_abi = 1; - } - if (lttng_kernel_use_old_abi) { - struct lttng_kernel_old_calibrate old_calibrate; - - old_calibrate.type = calibrate->type; - ret = LTTNG_IOCTL_CHECK(fd, LTTNG_KERNEL_OLD_CALIBRATE, - &old_calibrate); - if (ret) { - goto end; - } - calibrate->type = old_calibrate.type; - } else { - ret = LTTNG_IOCTL_CHECK(fd, LTTNG_KERNEL_CALIBRATE, calibrate); - } - -end: - return ret; -} - - int kernctl_buffer_flush(int fd) { return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_FLUSH); diff --git a/src/common/kernel-ctl/kernel-ctl.h b/src/common/kernel-ctl/kernel-ctl.h index 7c25a17c3..a8c27dd3a 100644 --- a/src/common/kernel-ctl/kernel-ctl.h +++ b/src/common/kernel-ctl/kernel-ctl.h @@ -44,7 +44,6 @@ int kernctl_syscall_list(int fd); int kernctl_tracer_version(int fd, struct lttng_kernel_tracer_version *v); int kernctl_tracer_abi_version(int fd, struct lttng_kernel_tracer_abi_version *v); int kernctl_wait_quiescent(int fd); -int kernctl_calibrate(int fd, struct lttng_kernel_calibrate *calibrate); /* * kernctl_syscall_mask - Get syscall mask associated to a channel FD. diff --git a/src/common/kernel-ctl/kernel-ioctl.h b/src/common/kernel-ctl/kernel-ioctl.h index e235d1093..2ade00cd1 100644 --- a/src/common/kernel-ctl/kernel-ioctl.h +++ b/src/common/kernel-ctl/kernel-ioctl.h @@ -78,8 +78,6 @@ _IOR(0xF6, 0x41, struct lttng_kernel_old_tracer_version) #define LTTNG_KERNEL_OLD_TRACEPOINT_LIST _IO(0xF6, 0x42) #define LTTNG_KERNEL_OLD_WAIT_QUIESCENT _IO(0xF6, 0x43) -#define LTTNG_KERNEL_OLD_CALIBRATE \ - _IOWR(0xF6, 0x44, struct lttng_kernel_old_calibrate) /* Session FD ioctl */ #define LTTNG_KERNEL_OLD_METADATA \ @@ -110,8 +108,6 @@ _IOR(0xF6, 0x46, struct lttng_kernel_tracer_version) #define LTTNG_KERNEL_TRACEPOINT_LIST _IO(0xF6, 0x47) #define LTTNG_KERNEL_WAIT_QUIESCENT _IO(0xF6, 0x48) -#define LTTNG_KERNEL_CALIBRATE \ - _IOWR(0xF6, 0x49, struct lttng_kernel_calibrate) #define LTTNG_KERNEL_SYSCALL_LIST _IO(0xF6, 0x4A) #define LTTNG_KERNEL_TRACER_ABI_VERSION \ _IOR(0xF6, 0x4B, struct lttng_kernel_tracer_abi_version) diff --git a/src/common/lttng-kernel-old.h b/src/common/lttng-kernel-old.h index 1b8999afb..ed7fd2d72 100644 --- a/src/common/lttng-kernel-old.h +++ b/src/common/lttng-kernel-old.h @@ -93,10 +93,6 @@ struct lttng_kernel_old_tracer_version { uint32_t patchlevel; }; -struct lttng_kernel_old_calibrate { - enum lttng_kernel_calibrate_type type; /* type (input) */ -}; - /* * kernel channel */ diff --git a/src/common/lttng-kernel.h b/src/common/lttng-kernel.h index 78d5fc449..8d87539a4 100644 --- a/src/common/lttng-kernel.h +++ b/src/common/lttng-kernel.h @@ -129,14 +129,6 @@ struct lttng_kernel_tracer_abi_version { uint32_t minor; } LTTNG_PACKED; -enum lttng_kernel_calibrate_type { - LTTNG_KERNEL_CALIBRATE_KRETPROBE, -}; - -struct lttng_kernel_calibrate { - enum lttng_kernel_calibrate_type type; /* type (input) */ -} LTTNG_PACKED; - struct lttng_kernel_syscall_mask { uint32_t len; /* in bits */ char mask[]; diff --git a/src/common/sessiond-comm/sessiond-comm.h b/src/common/sessiond-comm/sessiond-comm.h index 628b1ea67..0c2667031 100644 --- a/src/common/sessiond-comm/sessiond-comm.h +++ b/src/common/sessiond-comm/sessiond-comm.h @@ -56,7 +56,7 @@ enum lttcomm_sessiond_command { /* Tracer command */ LTTNG_ADD_CONTEXT = 0, - LTTNG_CALIBRATE = 1, + /* LTTNG_CALIBRATE used to be here */ LTTNG_DISABLE_CHANNEL = 2, LTTNG_DISABLE_EVENT = 3, LTTNG_LIST_SYSCALLS = 4, diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index bcd59f0c6..f0b211c7b 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -1927,26 +1927,13 @@ int lttng_set_tracing_group(const char *name) return 0; } -/* - * Returns size of returned session payload data or a negative error code. - */ int lttng_calibrate(struct lttng_handle *handle, struct lttng_calibrate *calibrate) { - struct lttcomm_session_msg lsm; - - /* Safety check. NULL pointer are forbidden */ - if (handle == NULL || calibrate == NULL) { - return -LTTNG_ERR_INVALID; - } - - memset(&lsm, 0, sizeof(lsm)); - lsm.cmd_type = LTTNG_CALIBRATE; - lttng_ctl_copy_lttng_domain(&lsm.domain, &handle->domain); - - memcpy(&lsm.u.calibrate, calibrate, sizeof(lsm.u.calibrate)); - - return lttng_ctl_ask_sessiond(&lsm, NULL); + /* + * This command was removed in LTTng 2.9. + */ + return -LTTNG_ERR_UND; } /*