From: Philippe Proulx Date: Tue, 14 Jun 2016 22:50:32 +0000 (-0400) Subject: Remove calibrate from lttng-sessiond X-Git-Tag: v2.9.0-rc1~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3a6922c6ab7b4d9455f517ac0bf86dfcede0ef3d;p=lttng-tools.git Remove calibrate from lttng-sessiond Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 916a73be2..325ffd2cf 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -2748,64 +2748,6 @@ int cmd_destroy_session(struct ltt_session *session, int wpipe) return ret; } -/* - * Command LTTNG_CALIBRATE processed by the client thread. - */ -int cmd_calibrate(enum lttng_domain_type domain, - struct lttng_calibrate *calibrate) -{ - int ret; - - switch (domain) { - case LTTNG_DOMAIN_KERNEL: - { - struct lttng_kernel_calibrate kcalibrate; - - switch (calibrate->type) { - case LTTNG_CALIBRATE_FUNCTION: - default: - /* Default and only possible calibrate option. */ - kcalibrate.type = LTTNG_KERNEL_CALIBRATE_KRETPROBE; - break; - } - - ret = kernel_calibrate(kernel_tracer_fd, &kcalibrate); - if (ret < 0) { - ret = LTTNG_ERR_KERN_ENABLE_FAIL; - goto error; - } - break; - } - case LTTNG_DOMAIN_UST: - { - struct lttng_ust_calibrate ucalibrate; - - switch (calibrate->type) { - case LTTNG_CALIBRATE_FUNCTION: - default: - /* Default and only possible calibrate option. */ - ucalibrate.type = LTTNG_UST_CALIBRATE_TRACEPOINT; - break; - } - - ret = ust_app_calibrate_glb(&ucalibrate); - if (ret < 0) { - ret = LTTNG_ERR_UST_CALIBRATE_FAIL; - goto error; - } - break; - } - default: - ret = LTTNG_ERR_UND; - goto error; - } - - ret = LTTNG_OK; - -error: - return ret; -} - /* * Command LTTNG_REGISTER_CONSUMER processed by the client thread. */ diff --git a/src/bin/lttng-sessiond/cmd.h b/src/bin/lttng-sessiond/cmd.h index 975a7f10f..ac88d5130 100644 --- a/src/bin/lttng-sessiond/cmd.h +++ b/src/bin/lttng-sessiond/cmd.h @@ -96,8 +96,6 @@ ssize_t cmd_list_syscalls(struct lttng_event **events); ssize_t cmd_list_tracker_pids(struct ltt_session *session, enum lttng_domain_type domain, int32_t **pids); -int cmd_calibrate(enum lttng_domain_type domain, - struct lttng_calibrate *calibrate); int cmd_data_pending(struct ltt_session *session); /* Snapshot */ diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index ae8349c89..aa5164978 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -576,25 +576,6 @@ void kernel_wait_quiescent(int fd) } } -/* - * Kernel calibrate - */ -int kernel_calibrate(int fd, struct lttng_kernel_calibrate *calibrate) -{ - int ret; - - assert(calibrate); - - ret = kernctl_calibrate(fd, calibrate); - if (ret < 0) { - PERROR("calibrate ioctl"); - return -1; - } - - return 0; -} - - /* * Force flush buffer of metadata. */ diff --git a/src/bin/lttng-sessiond/kernel.h b/src/bin/lttng-sessiond/kernel.h index 2a9a76f92..233ceffea 100644 --- a/src/bin/lttng-sessiond/kernel.h +++ b/src/bin/lttng-sessiond/kernel.h @@ -54,7 +54,6 @@ int kernel_start_session(struct ltt_kernel_session *session); int kernel_stop_session(struct ltt_kernel_session *session); ssize_t kernel_list_events(int tracer_fd, struct lttng_event **event_list); void kernel_wait_quiescent(int fd); -int kernel_calibrate(int fd, struct lttng_kernel_calibrate *calibrate); int kernel_validate_version(int tracer_fd); void kernel_destroy_session(struct ltt_kernel_session *ksess); void kernel_destroy_channel(struct ltt_kernel_channel *kchan); diff --git a/src/bin/lttng-sessiond/lttng-ust-abi.h b/src/bin/lttng-sessiond/lttng-ust-abi.h index 57b1d4e42..fb9c5a336 100644 --- a/src/bin/lttng-sessiond/lttng-ust-abi.h +++ b/src/bin/lttng-sessiond/lttng-ust-abi.h @@ -220,21 +220,6 @@ struct lttng_ust_object_data { } u; } LTTNG_PACKED; -enum lttng_ust_calibrate_type { - LTTNG_UST_CALIBRATE_TRACEPOINT, -}; - -#define LTTNG_UST_CALIBRATE_PADDING1 16 -#define LTTNG_UST_CALIBRATE_PADDING2 (LTTNG_UST_SYM_NAME_LEN + 32) -struct lttng_ust_calibrate { - enum lttng_ust_calibrate_type type; /* type (input) */ - char padding[LTTNG_UST_CALIBRATE_PADDING1]; - - union { - char padding[LTTNG_UST_CALIBRATE_PADDING2]; - } u; -} LTTNG_PACKED; - #define FILTER_BYTECODE_MAX_LEN 65536 #define LTTNG_UST_FILTER_PADDING 32 struct lttng_ust_filter_bytecode { diff --git a/src/bin/lttng-sessiond/lttng-ust-ctl.h b/src/bin/lttng-sessiond/lttng-ust-ctl.h index dccb089e1..a812ee857 100644 --- a/src/bin/lttng-sessiond/lttng-ust-ctl.h +++ b/src/bin/lttng-sessiond/lttng-ust-ctl.h @@ -124,8 +124,6 @@ int ustctl_wait_quiescent(int sock); int ustctl_sock_flush_buffer(int sock, struct lttng_ust_object_data *object); -int ustctl_calibrate(int sock, struct lttng_ust_calibrate *calibrate); - /* Release object created by members of this API. */ int ustctl_release_object(int sock, struct lttng_ust_object_data *data); /* Release handle returned by create session. */ diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index a2afb8f75..2752e9ff3 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -3058,7 +3058,6 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int sock, case LTTNG_CREATE_SESSION: case LTTNG_CREATE_SESSION_SNAPSHOT: case LTTNG_CREATE_SESSION_LIVE: - case LTTNG_CALIBRATE: case LTTNG_LIST_SESSIONS: case LTTNG_LIST_TRACEPOINTS: case LTTNG_LIST_SYSCALLS: @@ -3900,12 +3899,6 @@ error_add_context: ret = LTTNG_OK; break; } - case LTTNG_CALIBRATE: - { - ret = cmd_calibrate(cmd_ctx->lsm->domain.type, - &cmd_ctx->lsm->u.calibrate); - break; - } case LTTNG_REGISTER_CONSUMER: { struct consumer_data *cdata; diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 47bd04cd8..e496a5f55 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -5203,54 +5203,6 @@ end: return ret; } -/* - * Calibrate registered applications. - */ -int ust_app_calibrate_glb(struct lttng_ust_calibrate *calibrate) -{ - int ret = 0; - struct lttng_ht_iter iter; - struct ust_app *app; - - rcu_read_lock(); - - cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) { - if (!app->compatible) { - /* - * TODO: In time, we should notice the caller of this error by - * telling him that this is a version error. - */ - continue; - } - - health_code_update(); - - pthread_mutex_lock(&app->sock_lock); - ret = ustctl_calibrate(app->sock, calibrate); - pthread_mutex_unlock(&app->sock_lock); - if (ret < 0) { - switch (ret) { - case -ENOSYS: - /* Means that it's not implemented on the tracer side. */ - ret = 0; - break; - default: - DBG2("Calibrate app PID %d returned with error %d", - app->pid, ret); - break; - } - } - } - - DBG("UST app global domain calibration finished"); - - rcu_read_unlock(); - - health_code_update(); - - return ret; -} - /* * Receive registration and populate the given msg structure. * diff --git a/src/bin/lttng-sessiond/ust-app.h b/src/bin/lttng-sessiond/ust-app.h index 3b5d6ae9a..48f9fd381 100644 --- a/src/bin/lttng-sessiond/ust-app.h +++ b/src/bin/lttng-sessiond/ust-app.h @@ -328,7 +328,6 @@ void ust_app_global_update_all(struct ltt_ust_session *usess); void ust_app_clean_list(void); int ust_app_ht_alloc(void); struct ust_app *ust_app_find_by_pid(pid_t pid); -int ust_app_calibrate_glb(struct lttng_ust_calibrate *calibrate); struct ust_app_stream *ust_app_alloc_stream(void); int ust_app_recv_registration(int sock, struct ust_register_msg *msg); int ust_app_recv_notify(int sock); @@ -497,11 +496,6 @@ int ust_app_enable_event_pid(struct ltt_ust_session *usess, return 0; } static inline -int ust_app_calibrate_glb(struct lttng_ust_calibrate *calibrate) -{ - return 0; -} -static inline int ust_app_recv_registration(int sock, struct ust_register_msg *msg) { return 0;