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 */
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;
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 */
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 \
{
int old;
- if (channel == channel->session->metadata)
- return -EPERM;
old = uatomic_xchg(&channel->enabled, 1);
if (old)
return -EEXIST;
{
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.
*/
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. */
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;
.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,
switch (type) {
case LTTNG_UST_CHAN_PER_CPU:
- case LTTNG_UST_CHAN_METADATA:
break;
default:
return -EINVAL;
}
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>";
cds_list_add(<tng_chan->node, &session->chan_head);
lttng_chan->header_type = 0;
lttng_chan->handle = channel_handle;
- lttng_chan->metadata_dumped = 0;
lttng_chan->type = type;
/*
* 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.
*/
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;
}
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;
}
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
*
return -EPERM;
}
- if (channel->type == LTTNG_UST_CHAN_METADATA) {
- return lttng_metadata_cmd(objd, cmd, arg, uargs, owner);
- }
-
switch (cmd) {
case LTTNG_UST_STREAM:
{
+++ /dev/null
-/*
- * 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"
+++ /dev/null
-#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>