X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-ust-abi.c;h=7e7078e04602231539e3f308ec5b07d086482d71;hb=882a56d75d6054e1bf35d1bcddd668be4da4980f;hp=b3db6fd735c7e91239a0f61e3e89898b9754c545;hpb=ef9ff354212ff4b038e1a5b6a7ed0ffe1b949663;p=lttng-ust.git diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index b3db6fd7..7e7078e0 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -203,7 +203,6 @@ static const struct lttng_ust_objd_ops lttng_session_ops; static const struct lttng_ust_objd_ops lttng_channel_ops; static const struct lttng_ust_objd_ops lttng_metadata_ops; static const struct lttng_ust_objd_ops lttng_event_ops; -static const struct lttng_ust_objd_ops lttng_loglevel_ops; static const struct lttng_ust_objd_ops lttng_wildcard_ops; static const struct lttng_ust_objd_ops lib_ring_buffer_objd_ops; static const struct lttng_ust_objd_ops lttng_tracepoint_list_ops; @@ -669,44 +668,6 @@ objd_error: return ret; } -static -int lttng_abi_create_loglevel(int channel_objd, - struct lttng_ust_event *event_param) -{ - struct ltt_channel *channel = objd_private(channel_objd); - struct session_loglevel *loglevel; - int loglevel_objd, ret; - - event_param->name[LTTNG_UST_SYM_NAME_LEN - 1] = '\0'; - loglevel_objd = objd_alloc(NULL, <tng_loglevel_ops); - if (loglevel_objd < 0) { - ret = loglevel_objd; - goto objd_error; - } - /* - * We tolerate no failure path after loglevel creation. It will - * stay invariant for the rest of the session. - */ - ret = ltt_loglevel_create(channel, event_param, &loglevel); - if (ret < 0) { - goto loglevel_error; - } - objd_set_private(loglevel_objd, loglevel); - /* The loglevel holds a reference on the channel */ - objd_ref(channel_objd); - return loglevel_objd; - -loglevel_error: - { - int err; - - err = lttng_ust_objd_unref(loglevel_objd); - assert(!err); - } -objd_error: - return ret; -} - static int lttng_abi_create_wildcard(int channel_objd, struct lttng_ust_event *event_param) @@ -787,15 +748,11 @@ long lttng_channel_cmd(int objd, unsigned int cmd, unsigned long arg, { struct lttng_ust_event *event_param = (struct lttng_ust_event *) arg; - if (event_param->instrumentation == LTTNG_UST_TRACEPOINT_LOGLEVEL) { - return lttng_abi_create_loglevel(objd, event_param); + if (event_param->name[strlen(event_param->name) - 1] == '*') { + /* If ends with wildcard, create wildcard. */ + return lttng_abi_create_wildcard(objd, event_param); } else { - if (event_param->name[strlen(event_param->name) - 1] == '*') { - /* If ends with wildcard, create wildcard. */ - return lttng_abi_create_wildcard(objd, event_param); - } else { - return lttng_abi_create_event(objd, event_param); - } + return lttng_abi_create_event(objd, event_param); } } case LTTNG_UST_CONTEXT: @@ -1010,62 +967,6 @@ static const struct lttng_ust_objd_ops lttng_event_ops = { .cmd = lttng_event_cmd, }; -/** - * lttng_loglevel_cmd - lttng control through object descriptors - * - * @objd: the object descriptor - * @cmd: the command - * @arg: command arg - * @uargs: UST arguments (internal) - * - * This object descriptor implements lttng commands: - * LTTNG_UST_CONTEXT - * Prepend a context field to each record of events of this - * loglevel. - * LTTNG_UST_ENABLE - * Enable recording for these loglevel events (weak enable) - * LTTNG_UST_DISABLE - * Disable recording for these loglevel events (strong disable) - */ -static -long lttng_loglevel_cmd(int objd, unsigned int cmd, unsigned long arg, - union ust_args *uargs) -{ - struct session_loglevel *loglevel = objd_private(objd); - - switch (cmd) { - case LTTNG_UST_CONTEXT: - return -ENOSYS; /* not implemented yet */ -#if 0 - return lttng_abi_add_context(objd, - (struct lttng_ust_context *) arg, - &loglevel->ctx, loglevel->chan->session); -#endif - case LTTNG_UST_ENABLE: - return ltt_loglevel_enable(loglevel); - case LTTNG_UST_DISABLE: - return ltt_loglevel_disable(loglevel); - default: - return -EINVAL; - } -} - -static -int lttng_loglevel_release(int objd) -{ - struct session_loglevel *loglevel = objd_private(objd); - - if (loglevel) - return lttng_ust_objd_unref(loglevel->chan->objd); - return 0; -} - -/* TODO: filter control ioctl */ -static const struct lttng_ust_objd_ops lttng_loglevel_ops = { - .release = lttng_loglevel_release, - .cmd = lttng_loglevel_cmd, -}; - /** * lttng_wildcard_cmd - lttng control through object descriptors *