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.
*/
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 */
}
}
-/*
- * 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.
*/
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);
} 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 {
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. */
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:
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;
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.
*
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);
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;