4 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; only
9 * version 2.1 of the License.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 #include <lttng/ust-events.h>
26 #include <usterr-signal-safe.h>
27 #include "lttng-tracer-core.h"
30 static CDS_LIST_HEAD(lttng_transport_list
);
32 struct lttng_transport
*lttng_transport_find(const char *name
)
34 struct lttng_transport
*transport
;
36 cds_list_for_each_entry(transport
, <tng_transport_list
, node
) {
37 if (!strcmp(transport
->name
, name
))
44 * lttng_transport_register - LTT transport registration
45 * @transport: transport structure
47 * Registers a transport which can be used as output to extract the data out of
48 * LTTng. Called with ust_lock held.
50 void lttng_transport_register(struct lttng_transport
*transport
)
52 cds_list_add_tail(&transport
->node
, <tng_transport_list
);
56 * lttng_transport_unregister - LTT transport unregistration
57 * @transport: transport structure
58 * Called with ust_lock held.
60 void lttng_transport_unregister(struct lttng_transport
*transport
)
62 cds_list_del(&transport
->node
);
66 * Needed by comm layer.
68 struct lttng_enum
*lttng_ust_enum_get_from_desc(struct lttng_session
*session
,
69 const struct lttng_enum_desc
*enum_desc
)
71 struct lttng_enum
*_enum
;
72 struct cds_hlist_head
*head
;
73 struct cds_hlist_node
*node
;
74 size_t name_len
= strlen(enum_desc
->name
);
77 hash
= jhash(enum_desc
->name
, name_len
, 0);
78 head
= &session
->enums_ht
.table
[hash
& (LTTNG_UST_ENUM_HT_SIZE
- 1)];
79 cds_hlist_for_each_entry(_enum
, node
, head
, hlist
) {
81 if (_enum
->desc
== enum_desc
)
87 size_t lttng_ust_dummy_get_size(struct lttng_ctx_field
*field
, size_t offset
)
91 size
+= lib_ring_buffer_align(offset
, lttng_alignof(char));
92 size
+= sizeof(char); /* tag */
96 void lttng_ust_dummy_record(struct lttng_ctx_field
*field
,
97 struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
98 struct lttng_channel
*chan
)
100 char sel_char
= (char) LTTNG_UST_DYNAMIC_TYPE_NONE
;
102 lib_ring_buffer_align_ctx(ctx
, lttng_alignof(sel_char
));
103 chan
->ops
->event_write(ctx
, &sel_char
, sizeof(sel_char
));
106 void lttng_ust_dummy_get_value(struct lttng_ctx_field
*field
,
107 struct lttng_ctx_value
*value
)
109 value
->sel
= LTTNG_UST_DYNAMIC_TYPE_NONE
;
112 int lttng_context_is_app(const char *name
)
114 if (strncmp(name
, "$app.", strlen("$app.")) != 0) {