X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-ust-abi.c;h=c0e089d0022b5362dc44b477c5349bdb08d553dd;hb=616d3093e1c34557aca7e9f6149338f43cf91886;hp=baea888586536c6555dbad8422db5d86b4a08cba;hpb=6b0e60f149100b0b83b4a813689f75b04b3acb8f;p=lttng-ust.git diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index baea8885..c0e089d0 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -1,10 +1,25 @@ /* * lttng-ust-abi.c * - * Copyright 2010-2011 (c) - Mathieu Desnoyers - * * LTTng UST ABI * + * Copyright (C) 2010-2012 Mathieu Desnoyers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; only + * version 2.1 of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * * Mimic system calls for: * - session creation, returns an object descriptor or failure. * - channel creation, returns an object descriptor or failure. @@ -20,8 +35,6 @@ * - Takes an instrumentation source as parameter * - e.g. tracepoints, dynamic_probes... * - Takes instrumentation source specific arguments. - * - * Dual LGPL v2.1/GPL v2 license. */ #include @@ -29,10 +42,11 @@ #include #include #include +#include +#include "tracepoint-internal.h" #include #include #include "ltt-tracer.h" -#include "tracepoint-internal.h" static int lttng_ust_abi_close_in_progress; @@ -203,7 +217,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; @@ -331,6 +344,8 @@ void lttng_metadata_create_events(int channel_objd) static struct lttng_ust_event metadata_params = { .instrumentation = LTTNG_UST_TRACEPOINT, .name = "lttng_ust:metadata", + .loglevel_type = LTTNG_UST_LOGLEVEL_ALL, + .loglevel = TRACE_DEFAULT, }; struct ltt_event *event; int ret; @@ -403,7 +418,9 @@ int lttng_abi_create_channel(int session_objd, chan_param->switch_timer_interval, chan_param->read_timer_interval, &uargs->channel.shm_fd, + &uargs->channel.shm_path, &uargs->channel.wait_fd, + &uargs->channel.wait_pipe_path, &uargs->channel.memory_map_size, &chan_priv_init); if (!chan) { @@ -602,9 +619,9 @@ int lttng_abi_open_stream(int channel_objd, struct lttng_ust_stream *info, int stream_objd, ret; buf = channel->ops->buffer_read_open(channel->chan, channel->handle, - &uargs->stream.shm_fd, - &uargs->stream.wait_fd, - &uargs->stream.memory_map_size); + &uargs->stream.shm_fd, &uargs->stream.shm_path, + &uargs->stream.wait_fd, &uargs->stream.wait_pipe_path, + &uargs->stream.memory_map_size); if (!buf) return -ENOENT; @@ -766,6 +783,8 @@ long lttng_channel_cmd(int objd, unsigned int cmd, unsigned long arg, return ltt_channel_disable(channel); case LTTNG_UST_FLUSH_BUFFER: return channel->ops->flush_buffer(channel->chan, channel->handle); + case LTTNG_UST_STREAM_PIPE: + return channel->ops->channel_open_pipe(channel->chan, channel->handle); default: return -EINVAL; } @@ -802,6 +821,8 @@ long lttng_metadata_cmd(int objd, unsigned int cmd, unsigned long arg, } case LTTNG_UST_FLUSH_BUFFER: return channel->ops->flush_buffer(channel->chan, channel->handle); + case LTTNG_UST_STREAM_PIPE: + return channel->ops->channel_open_pipe(channel->chan, channel->handle); default: return -EINVAL; } @@ -968,62 +989,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 *