X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;ds=sidebyside;f=liblttng-ust%2Fust-core.c;h=60cdbfa91a2c876f5d5ae05db7a6ceae2a065df6;hb=refs%2Fheads%2Fstable-2.5;hp=404e0b26997bc37ec356355c23d24a4fe3191ce5;hpb=69400ac4a4e6575f749c6326df7c2a2c8ac3bdc5;p=lttng-ust.git diff --git a/liblttng-ust/ust-core.c b/liblttng-ust/ust-core.c index 404e0b26..60cdbfa9 100644 --- a/liblttng-ust/ust-core.c +++ b/liblttng-ust/ust-core.c @@ -18,20 +18,41 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include +#include +#include -volatile enum ust_loglevel ust_loglevel; +static CDS_LIST_HEAD(lttng_transport_list); -void init_usterr(void) +struct lttng_transport *lttng_transport_find(const char *name) { - char *ust_debug; + struct lttng_transport *transport; - if (ust_loglevel == UST_LOGLEVEL_UNKNOWN) { - ust_debug = getenv("LTTNG_UST_DEBUG"); - if (ust_debug) - ust_loglevel = UST_LOGLEVEL_DEBUG; - else - ust_loglevel = UST_LOGLEVEL_NORMAL; + cds_list_for_each_entry(transport, <tng_transport_list, node) { + if (!strcmp(transport->name, name)) + return transport; } + return NULL; +} + +/** + * lttng_transport_register - LTT transport registration + * @transport: transport structure + * + * Registers a transport which can be used as output to extract the data out of + * LTTng. Called with ust_lock held. + */ +void lttng_transport_register(struct lttng_transport *transport) +{ + cds_list_add_tail(&transport->node, <tng_transport_list); +} + +/** + * lttng_transport_unregister - LTT transport unregistration + * @transport: transport structure + * Called with ust_lock held. + */ +void lttng_transport_unregister(struct lttng_transport *transport) +{ + cds_list_del(&transport->node); }