6 * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; only
11 * version 2.1 of the License.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 * Mimic system calls for:
24 * - session creation, returns an object descriptor or failure.
25 * - channel creation, returns an object descriptor or failure.
26 * - Operates on a session object descriptor
27 * - Takes all channel options as parameters.
28 * - stream get, returns an object descriptor or failure.
29 * - Operates on a channel object descriptor.
30 * - stream notifier get, returns an object descriptor or failure.
31 * - Operates on a channel object descriptor.
32 * - event creation, returns an object descriptor or failure.
33 * - Operates on a channel object descriptor
34 * - Takes an event name as parameter
35 * - Takes an instrumentation source as parameter
36 * - e.g. tracepoints, dynamic_probes...
37 * - Takes instrumentation source specific arguments.
43 #include <urcu/compiler.h>
44 #include <urcu/list.h>
47 #include <lttng/tracepoint.h>
48 #include <lttng/ust-abi.h>
49 #include <lttng/ust-error.h>
50 #include <lttng/ust-events.h>
51 #include <lttng/ust-version.h>
53 #include <usterr-signal-safe.h>
55 #include "../libringbuffer/frontend_types.h"
56 #include "../libringbuffer/shm.h"
57 #include "lttng-tracer.h"
58 #include "string-utils.h"
60 #define OBJ_NAME_LEN 16
62 static int lttng_ust_abi_close_in_progress
;
65 int lttng_abi_tracepoint_list(void *owner
);
67 int lttng_abi_tracepoint_field_list(void *owner
);
70 * Object descriptor table. Should be protected from concurrent access
74 struct lttng_ust_obj
{
78 const struct lttng_ust_objd_ops
*ops
;
80 int owner_ref
; /* has ref from owner */
82 char name
[OBJ_NAME_LEN
];
84 int freelist_next
; /* offset freelist. end is -1. */
88 struct lttng_ust_objd_table
{
89 struct lttng_ust_obj
*array
;
90 unsigned int len
, allocated_len
;
91 int freelist_head
; /* offset freelist head. end is -1 */
94 static struct lttng_ust_objd_table objd_table
= {
99 int objd_alloc(void *private_data
, const struct lttng_ust_objd_ops
*ops
,
100 void *owner
, const char *name
)
102 struct lttng_ust_obj
*obj
;
104 if (objd_table
.freelist_head
!= -1) {
105 obj
= &objd_table
.array
[objd_table
.freelist_head
];
106 objd_table
.freelist_head
= obj
->u
.freelist_next
;
110 if (objd_table
.len
>= objd_table
.allocated_len
) {
111 unsigned int new_allocated_len
, old_allocated_len
;
112 struct lttng_ust_obj
*new_table
, *old_table
;
114 old_allocated_len
= objd_table
.allocated_len
;
115 old_table
= objd_table
.array
;
116 if (!old_allocated_len
)
117 new_allocated_len
= 1;
119 new_allocated_len
= old_allocated_len
<< 1;
120 new_table
= zmalloc(sizeof(struct lttng_ust_obj
) * new_allocated_len
);
123 memcpy(new_table
, old_table
,
124 sizeof(struct lttng_ust_obj
) * old_allocated_len
);
126 objd_table
.array
= new_table
;
127 objd_table
.allocated_len
= new_allocated_len
;
129 obj
= &objd_table
.array
[objd_table
.len
];
132 obj
->u
.s
.private_data
= private_data
;
134 obj
->u
.s
.f_count
= 2; /* count == 1 : object is allocated */
135 /* count == 2 : allocated + hold ref */
136 obj
->u
.s
.owner_ref
= 1; /* One owner reference */
137 obj
->u
.s
.owner
= owner
;
138 strncpy(obj
->u
.s
.name
, name
, OBJ_NAME_LEN
);
139 obj
->u
.s
.name
[OBJ_NAME_LEN
- 1] = '\0';
140 return obj
- objd_table
.array
;
144 struct lttng_ust_obj
*_objd_get(int id
)
146 if (id
>= objd_table
.len
)
148 if (!objd_table
.array
[id
].u
.s
.f_count
)
150 return &objd_table
.array
[id
];
154 void *objd_private(int id
)
156 struct lttng_ust_obj
*obj
= _objd_get(id
);
158 return obj
->u
.s
.private_data
;
162 void objd_set_private(int id
, void *private_data
)
164 struct lttng_ust_obj
*obj
= _objd_get(id
);
166 obj
->u
.s
.private_data
= private_data
;
169 const struct lttng_ust_objd_ops
*objd_ops(int id
)
171 struct lttng_ust_obj
*obj
= _objd_get(id
);
179 void objd_free(int id
)
181 struct lttng_ust_obj
*obj
= _objd_get(id
);
184 obj
->u
.freelist_next
= objd_table
.freelist_head
;
185 objd_table
.freelist_head
= obj
- objd_table
.array
;
186 assert(obj
->u
.s
.f_count
== 1);
187 obj
->u
.s
.f_count
= 0; /* deallocated */
191 void objd_ref(int id
)
193 struct lttng_ust_obj
*obj
= _objd_get(id
);
198 int lttng_ust_objd_unref(int id
, int is_owner
)
200 struct lttng_ust_obj
*obj
= _objd_get(id
);
204 if (obj
->u
.s
.f_count
== 1) {
205 ERR("Reference counting error\n");
209 if (!obj
->u
.s
.owner_ref
) {
210 ERR("Error decrementing owner reference");
213 obj
->u
.s
.owner_ref
--;
215 if ((--obj
->u
.s
.f_count
) == 1) {
216 const struct lttng_ust_objd_ops
*ops
= objd_ops(id
);
226 void objd_table_destroy(void)
230 for (i
= 0; i
< objd_table
.allocated_len
; i
++) {
231 struct lttng_ust_obj
*obj
;
236 if (!obj
->u
.s
.owner_ref
)
237 continue; /* only unref owner ref. */
238 (void) lttng_ust_objd_unref(i
, 1);
240 free(objd_table
.array
);
241 objd_table
.array
= NULL
;
243 objd_table
.allocated_len
= 0;
244 objd_table
.freelist_head
= -1;
247 const char *lttng_ust_obj_get_name(int id
)
249 struct lttng_ust_obj
*obj
= _objd_get(id
);
253 return obj
->u
.s
.name
;
256 void lttng_ust_objd_table_owner_cleanup(void *owner
)
260 for (i
= 0; i
< objd_table
.allocated_len
; i
++) {
261 struct lttng_ust_obj
*obj
;
267 continue; /* skip root handles */
268 if (!obj
->u
.s
.owner_ref
)
269 continue; /* only unref owner ref. */
270 if (obj
->u
.s
.owner
== owner
)
271 (void) lttng_ust_objd_unref(i
, 1);
276 * This is LTTng's own personal way to create an ABI for sessiond.
277 * We send commands over a socket.
280 static const struct lttng_ust_objd_ops lttng_ops
;
281 static const struct lttng_ust_objd_ops lttng_session_ops
;
282 static const struct lttng_ust_objd_ops lttng_channel_ops
;
283 static const struct lttng_ust_objd_ops lttng_enabler_ops
;
284 static const struct lttng_ust_objd_ops lttng_tracepoint_list_ops
;
285 static const struct lttng_ust_objd_ops lttng_tracepoint_field_list_ops
;
287 int lttng_abi_create_root_handle(void)
291 /* root handles have NULL owners */
292 root_handle
= objd_alloc(NULL
, <tng_ops
, NULL
, "root");
297 int lttng_is_channel_ready(struct lttng_channel
*lttng_chan
)
299 struct channel
*chan
;
300 unsigned int nr_streams
, exp_streams
;
302 chan
= lttng_chan
->chan
;
303 nr_streams
= channel_handle_get_nr_streams(lttng_chan
->handle
);
304 exp_streams
= chan
->nr_streams
;
305 return nr_streams
== exp_streams
;
309 int lttng_abi_create_session(void *owner
)
311 struct lttng_session
*session
;
312 int session_objd
, ret
;
314 session
= lttng_session_create();
317 session_objd
= objd_alloc(session
, <tng_session_ops
, owner
, "session");
318 if (session_objd
< 0) {
322 session
->objd
= session_objd
;
323 session
->owner
= owner
;
327 lttng_session_destroy(session
);
332 long lttng_abi_tracer_version(int objd
,
333 struct lttng_ust_tracer_version
*v
)
335 v
->major
= LTTNG_UST_MAJOR_VERSION
;
336 v
->minor
= LTTNG_UST_MINOR_VERSION
;
337 v
->patchlevel
= LTTNG_UST_PATCHLEVEL_VERSION
;
342 long lttng_abi_add_context(int objd
,
343 struct lttng_ust_context
*context_param
,
344 union ust_args
*uargs
,
345 struct lttng_ctx
**ctx
, struct lttng_session
*session
)
347 return lttng_attach_context(context_param
, uargs
, ctx
, session
);
351 * lttng_cmd - lttng control through socket commands
353 * @objd: the object descriptor
356 * @uargs: UST arguments (internal)
359 * This descriptor implements lttng commands:
361 * Returns a LTTng trace session object descriptor
362 * LTTNG_UST_TRACER_VERSION
363 * Returns the LTTng kernel tracer version
364 * LTTNG_UST_TRACEPOINT_LIST
365 * Returns a file descriptor listing available tracepoints
366 * LTTNG_UST_TRACEPOINT_FIELD_LIST
367 * Returns a file descriptor listing available tracepoint fields
368 * LTTNG_UST_WAIT_QUIESCENT
369 * Returns after all previously running probes have completed
371 * The returned session will be deleted when its file descriptor is closed.
374 long lttng_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
375 union ust_args
*uargs
, void *owner
)
378 case LTTNG_UST_SESSION
:
379 return lttng_abi_create_session(owner
);
380 case LTTNG_UST_TRACER_VERSION
:
381 return lttng_abi_tracer_version(objd
,
382 (struct lttng_ust_tracer_version
*) arg
);
383 case LTTNG_UST_TRACEPOINT_LIST
:
384 return lttng_abi_tracepoint_list(owner
);
385 case LTTNG_UST_TRACEPOINT_FIELD_LIST
:
386 return lttng_abi_tracepoint_field_list(owner
);
387 case LTTNG_UST_WAIT_QUIESCENT
:
395 static const struct lttng_ust_objd_ops lttng_ops
= {
399 int lttng_abi_map_channel(int session_objd
,
400 struct lttng_ust_channel
*ust_chan
,
401 union ust_args
*uargs
,
404 struct lttng_session
*session
= objd_private(session_objd
);
405 const char *transport_name
;
406 const struct lttng_transport
*transport
;
407 const char *chan_name
;
409 struct lttng_ust_shm_handle
*channel_handle
;
410 struct lttng_channel
*lttng_chan
;
411 struct channel
*chan
;
412 struct lttng_ust_lib_ring_buffer_config
*config
;
417 enum lttng_ust_chan_type type
;
419 chan_data
= uargs
->channel
.chan_data
;
420 wakeup_fd
= uargs
->channel
.wakeup_fd
;
422 type
= ust_chan
->type
;
425 case LTTNG_UST_CHAN_PER_CPU
:
432 if (session
->been_active
) {
434 goto active
; /* Refuse to add channel to active session */
437 channel_handle
= channel_handle_create(chan_data
, len
, wakeup_fd
);
438 if (!channel_handle
) {
443 chan
= shmp(channel_handle
, channel_handle
->chan
);
445 chan
->handle
= channel_handle
;
446 config
= &chan
->backend
.config
;
447 lttng_chan
= channel_get_private(chan
);
453 /* Lookup transport name */
455 case LTTNG_UST_CHAN_PER_CPU
:
456 if (config
->output
== RING_BUFFER_MMAP
) {
457 if (config
->mode
== RING_BUFFER_OVERWRITE
) {
458 if (config
->wakeup
== RING_BUFFER_WAKEUP_BY_WRITER
) {
459 transport_name
= "relay-overwrite-mmap";
461 transport_name
= "relay-overwrite-rt-mmap";
464 if (config
->wakeup
== RING_BUFFER_WAKEUP_BY_WRITER
) {
465 transport_name
= "relay-discard-mmap";
467 transport_name
= "relay-discard-rt-mmap";
474 chan_name
= "channel";
480 transport
= lttng_transport_find(transport_name
);
482 DBG("LTTng transport %s not found\n",
488 chan_objd
= objd_alloc(NULL
, <tng_channel_ops
, owner
, chan_name
);
494 /* Initialize our lttng chan */
495 lttng_chan
->chan
= chan
;
496 lttng_chan
->tstate
= 1;
497 lttng_chan
->enabled
= 1;
498 lttng_chan
->ctx
= NULL
;
499 lttng_chan
->session
= session
;
500 lttng_chan
->ops
= &transport
->ops
;
501 memcpy(<tng_chan
->chan
->backend
.config
,
502 transport
->client_config
,
503 sizeof(lttng_chan
->chan
->backend
.config
));
504 cds_list_add(<tng_chan
->node
, &session
->chan_head
);
505 lttng_chan
->header_type
= 0;
506 lttng_chan
->handle
= channel_handle
;
507 lttng_chan
->type
= type
;
510 * We tolerate no failure path after channel creation. It will stay
511 * invariant for the rest of the session.
513 objd_set_private(chan_objd
, lttng_chan
);
514 lttng_chan
->objd
= chan_objd
;
515 /* The channel created holds a reference on the session */
516 objd_ref(session_objd
);
519 /* error path after channel was created */
523 channel_destroy(chan
, channel_handle
, 0);
527 * error path before channel creation (owning chan_data and
536 lttng_ust_lock_fd_tracker();
537 close_ret
= close(wakeup_fd
);
538 lttng_ust_unlock_fd_tracker();
548 * lttng_session_cmd - lttng session object command
553 * @uargs: UST arguments (internal)
556 * This descriptor implements lttng commands:
558 * Returns a LTTng channel object descriptor
560 * Enables tracing for a session (weak enable)
562 * Disables tracing for a session (strong disable)
564 * The returned channel will be deleted when its file descriptor is closed.
567 long lttng_session_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
568 union ust_args
*uargs
, void *owner
)
570 struct lttng_session
*session
= objd_private(objd
);
573 case LTTNG_UST_CHANNEL
:
574 return lttng_abi_map_channel(objd
,
575 (struct lttng_ust_channel
*) arg
,
577 case LTTNG_UST_SESSION_START
:
578 case LTTNG_UST_ENABLE
:
579 return lttng_session_enable(session
);
580 case LTTNG_UST_SESSION_STOP
:
581 case LTTNG_UST_DISABLE
:
582 return lttng_session_disable(session
);
583 case LTTNG_UST_SESSION_STATEDUMP
:
584 return lttng_session_statedump(session
);
591 * Called when the last file reference is dropped.
593 * Big fat note: channels and events are invariant for the whole session after
594 * their creation. So this session destruction also destroys all channel and
595 * event structures specific to this session (they are not destroyed when their
596 * individual file is released).
599 int lttng_release_session(int objd
)
601 struct lttng_session
*session
= objd_private(objd
);
604 lttng_session_destroy(session
);
611 static const struct lttng_ust_objd_ops lttng_session_ops
= {
612 .release
= lttng_release_session
,
613 .cmd
= lttng_session_cmd
,
617 long lttng_tracepoint_list_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
618 union ust_args
*uargs
, void *owner
)
620 struct lttng_ust_tracepoint_list
*list
= objd_private(objd
);
621 struct lttng_ust_tracepoint_iter
*tp
=
622 (struct lttng_ust_tracepoint_iter
*) arg
;
623 struct lttng_ust_tracepoint_iter
*iter
;
626 case LTTNG_UST_TRACEPOINT_LIST_GET
:
628 iter
= lttng_ust_tracepoint_list_get_iter_next(list
);
630 return -LTTNG_UST_ERR_NOENT
;
631 memcpy(tp
, iter
, sizeof(*tp
));
640 int lttng_abi_tracepoint_list(void *owner
)
643 struct lttng_ust_tracepoint_list
*list
;
645 list_objd
= objd_alloc(NULL
, <tng_tracepoint_list_ops
, owner
, "tp_list");
650 list
= zmalloc(sizeof(*list
));
655 objd_set_private(list_objd
, list
);
657 /* populate list by walking on all registered probes. */
658 ret
= lttng_probes_get_event_list(list
);
670 err
= lttng_ust_objd_unref(list_objd
, 1);
678 int lttng_release_tracepoint_list(int objd
)
680 struct lttng_ust_tracepoint_list
*list
= objd_private(objd
);
683 lttng_probes_prune_event_list(list
);
691 static const struct lttng_ust_objd_ops lttng_tracepoint_list_ops
= {
692 .release
= lttng_release_tracepoint_list
,
693 .cmd
= lttng_tracepoint_list_cmd
,
697 long lttng_tracepoint_field_list_cmd(int objd
, unsigned int cmd
,
698 unsigned long arg
, union ust_args
*uargs
, void *owner
)
700 struct lttng_ust_field_list
*list
= objd_private(objd
);
701 struct lttng_ust_field_iter
*tp
= &uargs
->field_list
.entry
;
702 struct lttng_ust_field_iter
*iter
;
705 case LTTNG_UST_TRACEPOINT_FIELD_LIST_GET
:
707 iter
= lttng_ust_field_list_get_iter_next(list
);
709 return -LTTNG_UST_ERR_NOENT
;
710 memcpy(tp
, iter
, sizeof(*tp
));
719 int lttng_abi_tracepoint_field_list(void *owner
)
722 struct lttng_ust_field_list
*list
;
724 list_objd
= objd_alloc(NULL
, <tng_tracepoint_field_list_ops
, owner
,
730 list
= zmalloc(sizeof(*list
));
735 objd_set_private(list_objd
, list
);
737 /* populate list by walking on all registered probes. */
738 ret
= lttng_probes_get_field_list(list
);
750 err
= lttng_ust_objd_unref(list_objd
, 1);
758 int lttng_release_tracepoint_field_list(int objd
)
760 struct lttng_ust_field_list
*list
= objd_private(objd
);
763 lttng_probes_prune_field_list(list
);
771 static const struct lttng_ust_objd_ops lttng_tracepoint_field_list_ops
= {
772 .release
= lttng_release_tracepoint_field_list
,
773 .cmd
= lttng_tracepoint_field_list_cmd
,
777 int lttng_abi_map_stream(int channel_objd
, struct lttng_ust_stream
*info
,
778 union ust_args
*uargs
, void *owner
)
780 struct lttng_channel
*channel
= objd_private(channel_objd
);
783 ret
= channel_handle_add_stream(channel
->handle
,
784 uargs
->stream
.shm_fd
, uargs
->stream
.wakeup_fd
,
785 info
->stream_nr
, info
->len
);
787 goto error_add_stream
;
796 int lttng_abi_create_enabler(int channel_objd
,
797 struct lttng_ust_event
*event_param
,
799 enum lttng_enabler_type type
)
801 struct lttng_channel
*channel
= objd_private(channel_objd
);
802 struct lttng_enabler
*enabler
;
805 event_param
->name
[LTTNG_UST_SYM_NAME_LEN
- 1] = '\0';
806 event_objd
= objd_alloc(NULL
, <tng_enabler_ops
, owner
, "enabler");
807 if (event_objd
< 0) {
812 * We tolerate no failure path after event creation. It will stay
813 * invariant for the rest of the session.
815 enabler
= lttng_enabler_create(type
, event_param
, channel
);
820 objd_set_private(event_objd
, enabler
);
821 /* The event holds a reference on the channel */
822 objd_ref(channel_objd
);
829 err
= lttng_ust_objd_unref(event_objd
, 1);
837 * lttng_channel_cmd - lttng control through object descriptors
839 * @objd: the object descriptor
842 * @uargs: UST arguments (internal)
845 * This object descriptor implements lttng commands:
847 * Returns an event stream object descriptor or failure.
848 * (typically, one event stream records events from one CPU)
850 * Returns an event object descriptor or failure.
852 * Prepend a context field to each event in the channel
854 * Enable recording for events in this channel (weak enable)
856 * Disable recording for events in this channel (strong disable)
858 * Channel and event file descriptors also hold a reference on the session.
861 long lttng_channel_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
862 union ust_args
*uargs
, void *owner
)
864 struct lttng_channel
*channel
= objd_private(objd
);
866 if (cmd
!= LTTNG_UST_STREAM
) {
868 * Check if channel received all streams.
870 if (!lttng_is_channel_ready(channel
))
875 case LTTNG_UST_STREAM
:
877 struct lttng_ust_stream
*stream
;
879 stream
= (struct lttng_ust_stream
*) arg
;
880 /* stream used as output */
881 return lttng_abi_map_stream(objd
, stream
, uargs
, owner
);
883 case LTTNG_UST_EVENT
:
885 struct lttng_ust_event
*event_param
=
886 (struct lttng_ust_event
*) arg
;
888 if (strutils_is_star_glob_pattern(event_param
->name
)) {
890 * If the event name is a star globbing pattern,
891 * we create the special star globbing enabler.
893 return lttng_abi_create_enabler(objd
, event_param
,
894 owner
, LTTNG_ENABLER_STAR_GLOB
);
896 return lttng_abi_create_enabler(objd
, event_param
,
897 owner
, LTTNG_ENABLER_EVENT
);
900 case LTTNG_UST_CONTEXT
:
901 return lttng_abi_add_context(objd
,
902 (struct lttng_ust_context
*) arg
, uargs
,
903 &channel
->ctx
, channel
->session
);
904 case LTTNG_UST_ENABLE
:
905 return lttng_channel_enable(channel
);
906 case LTTNG_UST_DISABLE
:
907 return lttng_channel_disable(channel
);
908 case LTTNG_UST_FLUSH_BUFFER
:
909 return channel
->ops
->flush_buffer(channel
->chan
, channel
->handle
);
916 int lttng_channel_release(int objd
)
918 struct lttng_channel
*channel
= objd_private(objd
);
921 return lttng_ust_objd_unref(channel
->session
->objd
, 0);
925 static const struct lttng_ust_objd_ops lttng_channel_ops
= {
926 .release
= lttng_channel_release
,
927 .cmd
= lttng_channel_cmd
,
931 * lttng_enabler_cmd - lttng control through object descriptors
933 * @objd: the object descriptor
936 * @uargs: UST arguments (internal)
939 * This object descriptor implements lttng commands:
941 * Prepend a context field to each record of events of this
944 * Enable recording for this enabler
946 * Disable recording for this enabler
948 * Attach a filter to an enabler.
949 * LTTNG_UST_EXCLUSION
950 * Attach exclusions to an enabler.
953 long lttng_enabler_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
954 union ust_args
*uargs
, void *owner
)
956 struct lttng_enabler
*enabler
= objd_private(objd
);
959 case LTTNG_UST_CONTEXT
:
960 return lttng_enabler_attach_context(enabler
,
961 (struct lttng_ust_context
*) arg
);
962 case LTTNG_UST_ENABLE
:
963 return lttng_enabler_enable(enabler
);
964 case LTTNG_UST_DISABLE
:
965 return lttng_enabler_disable(enabler
);
966 case LTTNG_UST_FILTER
:
970 ret
= lttng_enabler_attach_bytecode(enabler
,
971 (struct lttng_ust_filter_bytecode_node
*) arg
);
976 case LTTNG_UST_EXCLUSION
:
978 return lttng_enabler_attach_exclusion(enabler
,
979 (struct lttng_ust_excluder_node
*) arg
);
987 int lttng_enabler_release(int objd
)
989 struct lttng_enabler
*enabler
= objd_private(objd
);
992 return lttng_ust_objd_unref(enabler
->chan
->objd
, 0);
996 static const struct lttng_ust_objd_ops lttng_enabler_ops
= {
997 .release
= lttng_enabler_release
,
998 .cmd
= lttng_enabler_cmd
,
1001 void lttng_ust_abi_exit(void)
1003 lttng_ust_abi_close_in_progress
= 1;
1005 objd_table_destroy();
1007 lttng_ust_abi_close_in_progress
= 0;