Cleanup: remove now unused metadata code from UST
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 3 Mar 2013 23:22:36 +0000 (18:22 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 3 Mar 2013 23:22:36 +0000 (18:22 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-events.h
liblttng-ust/Makefile.am
liblttng-ust/lttng-events.c
liblttng-ust/lttng-ust-abi.c
liblttng-ust/probes/lttng-probe-ust.c [deleted file]
liblttng-ust/probes/lttng-probe-ust.h [deleted file]

index 663ffbe353d454ba1ca47417e3ec3194b8068be5..05966ff69e344218daf0fa29b9e401843e3b7eac 100644 (file)
@@ -356,7 +356,7 @@ struct lttng_event {
        struct cds_list_head node;              /* Event list in session */
        struct cds_list_head _deprecated2;
        void *_deprecated3;
-       unsigned int metadata_dumped:1;
+       unsigned int _deprecated4:1;
 
        /* LTTng-UST 2.1 starts here */
        /* list of struct lttng_bytecode_runtime, sorted by seqnum */
@@ -426,7 +426,7 @@ struct lttng_channel {
        const struct lttng_channel_ops *ops;
        int header_type;                /* 0: unset, 1: compact, 2: large */
        struct lttng_ust_shm_handle *handle;    /* shared-memory handle */
-       unsigned int metadata_dumped:1;
+       unsigned int _deprecated3:1;
 
        /* Channel ID */
        unsigned int id;
@@ -450,13 +450,13 @@ struct lttng_session {
        int active;                             /* Is trace session active ? */
        int been_active;                        /* Been active ? */
        int objd;                               /* Object associated */
-       struct lttng_channel *metadata;         /* Metadata channel */
+       void *_deprecated1;
        struct cds_list_head chan_head;         /* Channel list head */
        struct cds_list_head events_head;       /* list of events */
-       struct cds_list_head _deprecated1;
+       struct cds_list_head _deprecated2;
        struct cds_list_head node;              /* Session list */
-       int _deprecated2;
-       unsigned int metadata_dumped:1;
+       int _deprecated3;
+       unsigned int _deprecated4:1;
 
        /* New UST 2.1 */
        /* List of enablers */
index 86661c6bdb9cefb62685eb7c8d7280c68422bab4..a5076c6ec7f560fcf755cd20fb1562a3d3ba3410 100644 (file)
@@ -20,8 +20,6 @@ liblttng_ust_runtime_la_SOURCES = \
        lttng-ust-comm.c \
        lttng-ust-abi.c \
        lttng-probes.c \
-       probes/lttng-probe-ust.c \
-       probes/lttng-probe-ust.h \
        lttng-context-vtid.c \
        lttng-context-vpid.c \
        lttng-context-pthread-id.c \
index ec5d78f50527056f1f50adb2e2d4df40da47b630..00babd0ebd293807abc7d9d07df4030173978897 100644 (file)
@@ -266,8 +266,6 @@ int lttng_channel_enable(struct lttng_channel *channel)
 {
        int old;
 
-       if (channel == channel->session->metadata)
-               return -EPERM;
        old = uatomic_xchg(&channel->enabled, 1);
        if (old)
                return -EEXIST;
@@ -278,38 +276,12 @@ int lttng_channel_disable(struct lttng_channel *channel)
 {
        int old;
 
-       if (channel == channel->session->metadata)
-               return -EPERM;
        old = uatomic_xchg(&channel->enabled, 0);
        if (!old)
                return -EEXIST;
        return 0;
 }
 
-int lttng_event_enable(struct lttng_event *event)
-{
-       int old;
-
-       if (event->chan == event->chan->session->metadata)
-               return -EPERM;
-       old = uatomic_xchg(&event->enabled, 1);
-       if (old)
-               return -EEXIST;
-       return 0;
-}
-
-int lttng_event_disable(struct lttng_event *event)
-{
-       int old;
-
-       if (event->chan == event->chan->session->metadata)
-               return -EPERM;
-       old = uatomic_xchg(&event->enabled, 0);
-       if (!old)
-               return -EEXIST;
-       return 0;
-}
-
 /*
  * Supports event creation while tracing session is active.
  */
@@ -370,25 +342,20 @@ int lttng_event_create(const struct lttng_event_desc *desc,
        else
                uri = NULL;
 
-       /* Don't register metadata events */
-       if (session->metadata == chan) {
-               event->id = -1U;
-       } else {
-               /* Fetch event ID from sessiond */
-               ret = ustcomm_register_event(notify_socket,
-                       session->objd,
-                       chan->objd,
-                       event_name,
-                       loglevel,
-                       desc->signature,
-                       desc->nr_fields,
-                       desc->fields,
-                       uri,
-                       &event->id);
-               if (ret < 0) {
-                       DBG("Error (%d) registering event to sessiond", ret);
-                       goto sessiond_register_error;
-               }
+       /* Fetch event ID from sessiond */
+       ret = ustcomm_register_event(notify_socket,
+               session->objd,
+               chan->objd,
+               event_name,
+               loglevel,
+               desc->signature,
+               desc->nr_fields,
+               desc->fields,
+               uri,
+               &event->id);
+       if (ret < 0) {
+               DBG("Error (%d) registering event to sessiond", ret);
+               goto sessiond_register_error;
        }
 
        /* Populate lttng_event structure before tracepoint registration. */
@@ -685,8 +652,6 @@ int lttng_enabler_enable(struct lttng_enabler *enabler)
 
 int lttng_enabler_disable(struct lttng_enabler *enabler)
 {
-       if (enabler->chan == enabler->chan->session->metadata)
-               return -EPERM;
        enabler->enabled = 0;
        lttng_session_lazy_sync_enablers(enabler->chan->session);
        return 0;
index 1e146e6196512cc545485c17da935240edb7ae31..acf3c849f2d7a9c69d0d9157638d594cd406d6b3 100644 (file)
@@ -369,39 +369,6 @@ static const struct lttng_ust_objd_ops lttng_ops = {
        .cmd = lttng_cmd,
 };
 
-/*
- * We tolerate no failure in this function (if one happens, we print a dmesg
- * error, but cannot return any error, because the channel information is
- * invariant.
- */
-static
-void lttng_metadata_create_events(int channel_objd)
-{
-       struct lttng_channel *chan = objd_private(channel_objd);
-       struct lttng_enabler *enabler;
-       static struct lttng_ust_event metadata_params = {
-               .instrumentation = LTTNG_UST_TRACEPOINT,
-               .name = "lttng_ust:metadata",
-               .loglevel_type = LTTNG_UST_LOGLEVEL_ALL,
-               .loglevel = TRACE_DEFAULT,
-       };
-
-       /*
-        * We tolerate no failure path after event creation. It will stay
-        * invariant for the rest of the session.
-        */
-       enabler = lttng_enabler_create(LTTNG_ENABLER_EVENT,
-                               &metadata_params, chan);
-       if (!enabler) {
-               goto create_error;
-       }
-       return;
-
-create_error:
-       WARN_ON(1);
-       return;         /* not allowed to return error */
-}
-
 int lttng_abi_map_channel(int session_objd,
                struct lttng_ust_channel *ust_chan,
                union ust_args *uargs,
@@ -427,7 +394,6 @@ int lttng_abi_map_channel(int session_objd,
 
        switch (type) {
        case LTTNG_UST_CHAN_PER_CPU:
-       case LTTNG_UST_CHAN_METADATA:
                break;
        default:
                return -EINVAL;
@@ -465,15 +431,6 @@ int lttng_abi_map_channel(int session_objd,
                }
                chan_name = "channel";
                break;
-       case LTTNG_UST_CHAN_METADATA:
-               if (config->output == RING_BUFFER_MMAP) {
-                       transport_name = "relay-metadata-mmap";
-               } else {
-                       ret = -EINVAL;
-                       goto notransport;
-               }
-               chan_name = "metadata";
-               break;
        default:
                transport_name = "<unknown>";
                chan_name = "<unknown>";
@@ -506,7 +463,6 @@ int lttng_abi_map_channel(int session_objd,
        cds_list_add(&lttng_chan->node, &session->chan_head);
        lttng_chan->header_type = 0;
        lttng_chan->handle = channel_handle;
-       lttng_chan->metadata_dumped = 0;
        lttng_chan->type = type;
 
        /*
@@ -545,8 +501,6 @@ active:
  *             Enables tracing for a session (weak enable)
  *     LTTNG_UST_DISABLE
  *             Disables tracing for a session (strong disable)
- *     LTTNG_UST_METADATA
- *             Returns a LTTng metadata object descriptor
  *
  * The returned channel will be deleted when its file descriptor is closed.
  */
@@ -610,12 +564,9 @@ long lttng_tracepoint_list_cmd(int objd, unsigned int cmd, unsigned long arg,
        switch (cmd) {
        case LTTNG_UST_TRACEPOINT_LIST_GET:
        {
-       retry:
                iter = lttng_ust_tracepoint_list_get_iter_next(list);
                if (!iter)
                        return -LTTNG_UST_ERR_NOENT;
-               if (!strcmp(iter->name, "lttng_ust:metadata"))
-                       goto retry;
                memcpy(tp, iter, sizeof(*tp));
                return 0;
        }
@@ -692,12 +643,9 @@ long lttng_tracepoint_field_list_cmd(int objd, unsigned int cmd,
        switch (cmd) {
        case LTTNG_UST_TRACEPOINT_FIELD_LIST_GET:
        {
-       retry:
                iter = lttng_ust_field_list_get_iter_next(list);
                if (!iter)
                        return -LTTNG_UST_ERR_NOENT;
-               if (!strcmp(iter->event_name, "lttng_ust:metadata"))
-                       goto retry;
                memcpy(tp, iter, sizeof(*tp));
                return 0;
        }
@@ -824,40 +772,6 @@ objd_error:
        return ret;
 }
 
-static
-long lttng_metadata_cmd(int objd, unsigned int cmd, unsigned long arg,
-       union ust_args *uargs, void *owner)
-{
-       struct lttng_channel *channel = objd_private(objd);
-       struct lttng_session *session = channel->session;
-
-       switch (cmd) {
-       case LTTNG_UST_STREAM:
-       {
-               struct lttng_ust_stream *stream;
-               int ret;
-
-               stream = (struct lttng_ust_stream *) arg;
-               /* stream used as output */
-               ret = lttng_abi_map_stream(objd, stream, uargs, owner);
-               if (ret == 0) {
-                       session->metadata = channel;
-                       lttng_metadata_create_events(objd);
-               }
-               return ret;
-       }
-       case LTTNG_UST_FLUSH_BUFFER:
-       {
-               if (!session->metadata) {
-                       return -ENOENT;
-               }
-               return channel->ops->flush_buffer(channel->chan, channel->handle);
-       }
-       default:
-               return -EINVAL;
-       }
-}
-
 /**
  *     lttng_channel_cmd - lttng control through object descriptors
  *
@@ -896,10 +810,6 @@ long lttng_channel_cmd(int objd, unsigned int cmd, unsigned long arg,
                        return -EPERM;
        }
 
-       if (channel->type == LTTNG_UST_CHAN_METADATA) {
-               return lttng_metadata_cmd(objd, cmd, arg, uargs, owner);
-       }
-
        switch (cmd) {
        case LTTNG_UST_STREAM:
        {
diff --git a/liblttng-ust/probes/lttng-probe-ust.c b/liblttng-ust/probes/lttng-probe-ust.c
deleted file mode 100644 (file)
index 2f83e28..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * probes/lttng-probe-ust.c
- *
- * LTTng UST core probes.
- *
- * Copyright 2010-2012 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * 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
- */
-
-#define TRACEPOINT_DEFINE
-#define TRACEPOINT_CREATE_PROBES
-#include "lttng-probe-ust.h"
diff --git a/liblttng-ust/probes/lttng-probe-ust.h b/liblttng-ust/probes/lttng-probe-ust.h
deleted file mode 100644 (file)
index 433d5db..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#undef TRACEPOINT_PROVIDER
-#define TRACEPOINT_PROVIDER lttng_ust
-
-#if !defined(_TRACEPOINT_LTTNG_UST_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
-#define _TRACEPOINT_LTTNG_UST_H
-
-/*
- * Copyright (C) 2011  Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * 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; 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
- */
-
-#include <lttng/tracepoint.h>
-
-TRACEPOINT_EVENT(lttng_ust, metadata,
-
-       TP_ARGS(const char *, str),
-
-       /*
-        * Not exactly a string: more a sequence of bytes (dynamic
-        * array) without the length. This is a dummy anyway: we only
-        * use this declaration to generate an event metadata entry.
-        */
-       TP_FIELDS(
-               ctf_string(str, str)
-       )
-)
-
-#undef TRACEPOINT_INCLUDE
-#define TRACEPOINT_INCLUDE "./probes/lttng-probe-ust.h"
-
-#endif /* _TRACEPOINT_LTTNG_UST_H */
-
-/* This part must be outside ifdef protection */
-#include <lttng/tracepoint-event.h>
This page took 0.030796 seconds and 4 git commands to generate.