4 * Copyright 2010-2011 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 * Mimic system calls for:
9 * - session creation, returns an object descriptor or failure.
10 * - channel creation, returns an object descriptor or failure.
11 * - Operates on a session object descriptor
12 * - Takes all channel options as parameters.
13 * - stream get, returns an object descriptor or failure.
14 * - Operates on a channel object descriptor.
15 * - stream notifier get, returns an object descriptor or failure.
16 * - Operates on a channel object descriptor.
17 * - event creation, returns an object descriptor or failure.
18 * - Operates on a channel object descriptor
19 * - Takes an event name as parameter
20 * - Takes an instrumentation source as parameter
21 * - e.g. tracepoints, dynamic_probes...
22 * - Takes instrumentation source specific arguments.
24 * Dual LGPL v2.1/GPL v2 license.
27 #include <lttng/ust-abi.h>
28 #include <urcu/compiler.h>
29 #include <urcu/list.h>
30 #include <lttng/ust-events.h>
31 #include <lttng/ust-version.h>
32 #include <usterr-signal-safe.h>
34 #include "ltt-tracer.h"
35 #include "tracepoint-internal.h"
37 static int lttng_ust_abi_close_in_progress
;
40 int lttng_abi_tracepoint_list(void);
43 * Object descriptor table. Should be protected from concurrent access
47 struct lttng_ust_obj
{
51 const struct lttng_ust_objd_ops
*ops
;
54 int freelist_next
; /* offset freelist. end is -1. */
58 struct lttng_ust_objd_table
{
59 struct lttng_ust_obj
*array
;
60 unsigned int len
, allocated_len
;
61 int freelist_head
; /* offset freelist head. end is -1 */
64 static struct lttng_ust_objd_table objd_table
= {
69 int objd_alloc(void *private_data
, const struct lttng_ust_objd_ops
*ops
)
71 struct lttng_ust_obj
*obj
;
73 if (objd_table
.freelist_head
!= -1) {
74 obj
= &objd_table
.array
[objd_table
.freelist_head
];
75 objd_table
.freelist_head
= obj
->u
.freelist_next
;
79 if (objd_table
.len
>= objd_table
.allocated_len
) {
80 unsigned int new_allocated_len
, old_allocated_len
;
81 struct lttng_ust_obj
*new_table
, *old_table
;
83 old_allocated_len
= objd_table
.allocated_len
;
84 old_table
= objd_table
.array
;
85 if (!old_allocated_len
)
86 new_allocated_len
= 1;
88 new_allocated_len
= old_allocated_len
<< 1;
89 new_table
= zmalloc(sizeof(struct lttng_ust_obj
) * new_allocated_len
);
92 memcpy(new_table
, old_table
,
93 sizeof(struct lttng_ust_obj
) * old_allocated_len
);
95 objd_table
.array
= new_table
;
96 objd_table
.allocated_len
= new_allocated_len
;
98 obj
= &objd_table
.array
[objd_table
.len
];
101 obj
->u
.s
.private_data
= private_data
;
103 obj
->u
.s
.f_count
= 2; /* count == 1 : object is allocated */
104 /* count == 2 : allocated + hold ref */
105 return obj
- objd_table
.array
;
109 struct lttng_ust_obj
*_objd_get(int id
)
111 if (id
>= objd_table
.len
)
113 if (!objd_table
.array
[id
].u
.s
.f_count
)
115 return &objd_table
.array
[id
];
119 void *objd_private(int id
)
121 struct lttng_ust_obj
*obj
= _objd_get(id
);
123 return obj
->u
.s
.private_data
;
127 void objd_set_private(int id
, void *private_data
)
129 struct lttng_ust_obj
*obj
= _objd_get(id
);
131 obj
->u
.s
.private_data
= private_data
;
134 const struct lttng_ust_objd_ops
*objd_ops(int id
)
136 struct lttng_ust_obj
*obj
= _objd_get(id
);
144 void objd_free(int id
)
146 struct lttng_ust_obj
*obj
= _objd_get(id
);
149 obj
->u
.freelist_next
= objd_table
.freelist_head
;
150 objd_table
.freelist_head
= obj
- objd_table
.array
;
151 assert(obj
->u
.s
.f_count
== 1);
152 obj
->u
.s
.f_count
= 0; /* deallocated */
156 void objd_ref(int id
)
158 struct lttng_ust_obj
*obj
= _objd_get(id
);
162 int lttng_ust_objd_unref(int id
)
164 struct lttng_ust_obj
*obj
= _objd_get(id
);
168 if (obj
->u
.s
.f_count
== 1) {
169 ERR("Reference counting error\n");
172 if ((--obj
->u
.s
.f_count
) == 1) {
173 const struct lttng_ust_objd_ops
*ops
= objd_ops(id
);
183 void objd_table_destroy(void)
187 for (i
= 0; i
< objd_table
.allocated_len
; i
++)
188 (void) lttng_ust_objd_unref(i
);
189 free(objd_table
.array
);
190 objd_table
.array
= NULL
;
192 objd_table
.allocated_len
= 0;
193 objd_table
.freelist_head
= -1;
197 * This is LTTng's own personal way to create an ABI for sessiond.
198 * We send commands over a socket.
201 static const struct lttng_ust_objd_ops lttng_ops
;
202 static const struct lttng_ust_objd_ops lttng_session_ops
;
203 static const struct lttng_ust_objd_ops lttng_channel_ops
;
204 static const struct lttng_ust_objd_ops lttng_metadata_ops
;
205 static const struct lttng_ust_objd_ops lttng_event_ops
;
206 static const struct lttng_ust_objd_ops lttng_wildcard_ops
;
207 static const struct lttng_ust_objd_ops lib_ring_buffer_objd_ops
;
208 static const struct lttng_ust_objd_ops lttng_tracepoint_list_ops
;
215 int lttng_abi_create_root_handle(void)
219 root_handle
= objd_alloc(NULL
, <tng_ops
);
224 int lttng_abi_create_session(void)
226 struct ltt_session
*session
;
227 int session_objd
, ret
;
229 session
= ltt_session_create();
232 session_objd
= objd_alloc(session
, <tng_session_ops
);
233 if (session_objd
< 0) {
237 session
->objd
= session_objd
;
241 ltt_session_destroy(session
);
246 long lttng_abi_tracer_version(int objd
,
247 struct lttng_ust_tracer_version
*v
)
249 v
->major
= LTTNG_UST_MAJOR_VERSION
;
250 v
->minor
= LTTNG_UST_MINOR_VERSION
;
251 v
->patchlevel
= LTTNG_UST_PATCHLEVEL_VERSION
;
256 long lttng_abi_add_context(int objd
,
257 struct lttng_ust_context
*context_param
,
258 struct lttng_ctx
**ctx
, struct ltt_session
*session
)
260 if (session
->been_active
)
263 switch (context_param
->ctx
) {
264 case LTTNG_UST_CONTEXT_PTHREAD_ID
:
265 return lttng_add_pthread_id_to_ctx(ctx
);
266 case LTTNG_UST_CONTEXT_VTID
:
267 return lttng_add_vtid_to_ctx(ctx
);
268 case LTTNG_UST_CONTEXT_VPID
:
269 return lttng_add_vpid_to_ctx(ctx
);
270 case LTTNG_UST_CONTEXT_PROCNAME
:
271 return lttng_add_procname_to_ctx(ctx
);
278 * lttng_cmd - lttng control through socket commands
280 * @objd: the object descriptor
283 * @uargs: UST arguments (internal)
285 * This descriptor implements lttng commands:
287 * Returns a LTTng trace session object descriptor
288 * LTTNG_UST_TRACER_VERSION
289 * Returns the LTTng kernel tracer version
290 * LTTNG_UST_TRACEPOINT_LIST
291 * Returns a file descriptor listing available tracepoints
292 * LTTNG_UST_WAIT_QUIESCENT
293 * Returns after all previously running probes have completed
295 * The returned session will be deleted when its file descriptor is closed.
298 long lttng_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
299 union ust_args
*uargs
)
302 case LTTNG_UST_SESSION
:
303 return lttng_abi_create_session();
304 case LTTNG_UST_TRACER_VERSION
:
305 return lttng_abi_tracer_version(objd
,
306 (struct lttng_ust_tracer_version
*) arg
);
307 case LTTNG_UST_TRACEPOINT_LIST
:
308 return lttng_abi_tracepoint_list();
309 case LTTNG_UST_WAIT_QUIESCENT
:
317 static const struct lttng_ust_objd_ops lttng_ops
= {
322 * We tolerate no failure in this function (if one happens, we print a dmesg
323 * error, but cannot return any error, because the channel information is
327 void lttng_metadata_create_events(int channel_objd
)
329 struct ltt_channel
*channel
= objd_private(channel_objd
);
330 static struct lttng_ust_event metadata_params
= {
331 .instrumentation
= LTTNG_UST_TRACEPOINT
,
332 .name
= "lttng_ust:metadata",
334 struct ltt_event
*event
;
338 * We tolerate no failure path after event creation. It will stay
339 * invariant for the rest of the session.
341 ret
= ltt_event_create(channel
, &metadata_params
, NULL
, &event
);
349 return; /* not allowed to return error */
352 int lttng_abi_create_channel(int session_objd
,
353 struct lttng_ust_channel
*chan_param
,
354 enum channel_type channel_type
,
355 union ust_args
*uargs
)
357 struct ltt_session
*session
= objd_private(session_objd
);
358 const struct lttng_ust_objd_ops
*ops
;
359 const char *transport_name
;
360 struct ltt_channel
*chan
;
363 struct ltt_channel chan_priv_init
;
365 switch (channel_type
) {
366 case PER_CPU_CHANNEL
:
367 if (chan_param
->output
== LTTNG_UST_MMAP
) {
368 transport_name
= chan_param
->overwrite
?
369 "relay-overwrite-mmap" : "relay-discard-mmap";
373 ops
= <tng_channel_ops
;
375 case METADATA_CHANNEL
:
376 if (chan_param
->output
== LTTNG_UST_MMAP
)
377 transport_name
= "relay-metadata-mmap";
380 ops
= <tng_metadata_ops
;
383 transport_name
= "<unknown>";
386 chan_objd
= objd_alloc(NULL
, ops
);
391 memset(&chan_priv_init
, 0, sizeof(chan_priv_init
));
392 /* Copy of session UUID for consumer (availability through shm) */
393 memcpy(chan_priv_init
.uuid
, session
->uuid
, sizeof(session
->uuid
));
396 * We tolerate no failure path after channel creation. It will stay
397 * invariant for the rest of the session.
399 chan
= ltt_channel_create(session
, transport_name
, NULL
,
400 chan_param
->subbuf_size
,
401 chan_param
->num_subbuf
,
402 chan_param
->switch_timer_interval
,
403 chan_param
->read_timer_interval
,
404 &uargs
->channel
.shm_fd
,
405 &uargs
->channel
.wait_fd
,
406 &uargs
->channel
.memory_map_size
,
412 objd_set_private(chan_objd
, chan
);
413 chan
->objd
= chan_objd
;
414 if (channel_type
== METADATA_CHANNEL
) {
415 session
->metadata
= chan
;
416 lttng_metadata_create_events(chan_objd
);
418 /* The channel created holds a reference on the session */
419 objd_ref(session_objd
);
427 err
= lttng_ust_objd_unref(chan_objd
);
435 * lttng_session_cmd - lttng session object command
440 * @uargs: UST arguments (internal)
442 * This descriptor implements lttng commands:
444 * Returns a LTTng channel object descriptor
446 * Enables tracing for a session (weak enable)
448 * Disables tracing for a session (strong disable)
450 * Returns a LTTng metadata object descriptor
452 * The returned channel will be deleted when its file descriptor is closed.
455 long lttng_session_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
456 union ust_args
*uargs
)
458 struct ltt_session
*session
= objd_private(objd
);
461 case LTTNG_UST_CHANNEL
:
462 return lttng_abi_create_channel(objd
,
463 (struct lttng_ust_channel
*) arg
,
464 PER_CPU_CHANNEL
, uargs
);
465 case LTTNG_UST_SESSION_START
:
466 case LTTNG_UST_ENABLE
:
467 return ltt_session_enable(session
);
468 case LTTNG_UST_SESSION_STOP
:
469 case LTTNG_UST_DISABLE
:
470 return ltt_session_disable(session
);
471 case LTTNG_UST_METADATA
:
472 return lttng_abi_create_channel(objd
,
473 (struct lttng_ust_channel
*) arg
,
474 METADATA_CHANNEL
, uargs
);
481 * Called when the last file reference is dropped.
483 * Big fat note: channels and events are invariant for the whole session after
484 * their creation. So this session destruction also destroys all channel and
485 * event structures specific to this session (they are not destroyed when their
486 * individual file is released).
489 int lttng_release_session(int objd
)
491 struct ltt_session
*session
= objd_private(objd
);
494 ltt_session_destroy(session
);
501 static const struct lttng_ust_objd_ops lttng_session_ops
= {
502 .release
= lttng_release_session
,
503 .cmd
= lttng_session_cmd
,
507 long lttng_tracepoint_list_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
508 union ust_args
*uargs
)
510 struct lttng_ust_tracepoint_list
*list
= objd_private(objd
);
511 struct lttng_ust_tracepoint_iter
*tp
=
512 (struct lttng_ust_tracepoint_iter
*) arg
;
513 struct lttng_ust_tracepoint_iter
*iter
;
516 case LTTNG_UST_TRACEPOINT_LIST_GET
:
519 iter
= lttng_ust_tracepoint_list_get_iter_next(list
);
522 if (!strcmp(iter
->name
, "lttng_ust:metadata"))
524 memcpy(tp
, iter
, sizeof(*tp
));
533 int lttng_abi_tracepoint_list(void)
536 struct lttng_ust_tracepoint_list
*list
;
538 list_objd
= objd_alloc(NULL
, <tng_tracepoint_list_ops
);
543 list
= zmalloc(sizeof(*list
));
548 objd_set_private(list_objd
, list
);
550 /* populate list by walking on all registered probes. */
551 ret
= ltt_probes_get_event_list(list
);
563 err
= lttng_ust_objd_unref(list_objd
);
571 int lttng_release_tracepoint_list(int objd
)
573 struct lttng_ust_tracepoint_list
*list
= objd_private(objd
);
576 ltt_probes_prune_event_list(list
);
584 static const struct lttng_ust_objd_ops lttng_tracepoint_list_ops
= {
585 .release
= lttng_release_tracepoint_list
,
586 .cmd
= lttng_tracepoint_list_cmd
,
589 struct stream_priv_data
{
590 struct lttng_ust_lib_ring_buffer
*buf
;
591 struct ltt_channel
*ltt_chan
;
595 int lttng_abi_open_stream(int channel_objd
, struct lttng_ust_stream
*info
,
596 union ust_args
*uargs
)
598 struct ltt_channel
*channel
= objd_private(channel_objd
);
599 struct lttng_ust_lib_ring_buffer
*buf
;
600 struct stream_priv_data
*priv
;
601 int stream_objd
, ret
;
603 buf
= channel
->ops
->buffer_read_open(channel
->chan
, channel
->handle
,
604 &uargs
->stream
.shm_fd
,
605 &uargs
->stream
.wait_fd
,
606 &uargs
->stream
.memory_map_size
);
610 priv
= zmalloc(sizeof(*priv
));
616 priv
->ltt_chan
= channel
;
617 stream_objd
= objd_alloc(priv
, &lib_ring_buffer_objd_ops
);
618 if (stream_objd
< 0) {
622 /* Hold a reference on the channel object descriptor */
623 objd_ref(channel_objd
);
629 channel
->ops
->buffer_read_close(buf
, channel
->handle
);
634 int lttng_abi_create_event(int channel_objd
,
635 struct lttng_ust_event
*event_param
)
637 struct ltt_channel
*channel
= objd_private(channel_objd
);
638 struct ltt_event
*event
;
641 event_param
->name
[LTTNG_UST_SYM_NAME_LEN
- 1] = '\0';
642 event_objd
= objd_alloc(NULL
, <tng_event_ops
);
643 if (event_objd
< 0) {
648 * We tolerate no failure path after event creation. It will stay
649 * invariant for the rest of the session.
651 ret
= ltt_event_create(channel
, event_param
, NULL
, &event
);
655 objd_set_private(event_objd
, event
);
656 /* The event holds a reference on the channel */
657 objd_ref(channel_objd
);
664 err
= lttng_ust_objd_unref(event_objd
);
672 int lttng_abi_create_wildcard(int channel_objd
,
673 struct lttng_ust_event
*event_param
)
675 struct ltt_channel
*channel
= objd_private(channel_objd
);
676 struct session_wildcard
*wildcard
;
677 int wildcard_objd
, ret
;
679 event_param
->name
[LTTNG_UST_SYM_NAME_LEN
- 1] = '\0';
680 wildcard_objd
= objd_alloc(NULL
, <tng_wildcard_ops
);
681 if (wildcard_objd
< 0) {
686 * We tolerate no failure path after wildcard creation. It will
687 * stay invariant for the rest of the session.
689 ret
= ltt_wildcard_create(channel
, event_param
, &wildcard
);
693 objd_set_private(wildcard_objd
, wildcard
);
694 /* The wildcard holds a reference on the channel */
695 objd_ref(channel_objd
);
696 return wildcard_objd
;
702 err
= lttng_ust_objd_unref(wildcard_objd
);
710 * lttng_channel_cmd - lttng control through object descriptors
712 * @objd: the object descriptor
715 * @uargs: UST arguments (internal)
717 * This object descriptor implements lttng commands:
719 * Returns an event stream object descriptor or failure.
720 * (typically, one event stream records events from one CPU)
722 * Returns an event object descriptor or failure.
724 * Prepend a context field to each event in the channel
726 * Enable recording for events in this channel (weak enable)
728 * Disable recording for events in this channel (strong disable)
730 * Channel and event file descriptors also hold a reference on the session.
733 long lttng_channel_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
734 union ust_args
*uargs
)
736 struct ltt_channel
*channel
= objd_private(objd
);
739 case LTTNG_UST_STREAM
:
741 struct lttng_ust_stream
*stream
;
743 stream
= (struct lttng_ust_stream
*) arg
;
744 /* stream used as output */
745 return lttng_abi_open_stream(objd
, stream
, uargs
);
747 case LTTNG_UST_EVENT
:
749 struct lttng_ust_event
*event_param
=
750 (struct lttng_ust_event
*) arg
;
751 if (event_param
->name
[strlen(event_param
->name
) - 1] == '*') {
752 /* If ends with wildcard, create wildcard. */
753 return lttng_abi_create_wildcard(objd
, event_param
);
755 return lttng_abi_create_event(objd
, event_param
);
758 case LTTNG_UST_CONTEXT
:
759 return lttng_abi_add_context(objd
,
760 (struct lttng_ust_context
*) arg
,
761 &channel
->ctx
, channel
->session
);
762 case LTTNG_UST_ENABLE
:
763 return ltt_channel_enable(channel
);
764 case LTTNG_UST_DISABLE
:
765 return ltt_channel_disable(channel
);
766 case LTTNG_UST_FLUSH_BUFFER
:
767 return channel
->ops
->flush_buffer(channel
->chan
, channel
->handle
);
774 * lttng_metadata_cmd - lttng control through object descriptors
776 * @objd: the object descriptor
779 * @uargs: UST arguments (internal)
781 * This object descriptor implements lttng commands:
783 * Returns an event stream file descriptor or failure.
785 * Channel and event file descriptors also hold a reference on the session.
788 long lttng_metadata_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
789 union ust_args
*uargs
)
791 struct ltt_channel
*channel
= objd_private(objd
);
794 case LTTNG_UST_STREAM
:
796 struct lttng_ust_stream
*stream
;
798 stream
= (struct lttng_ust_stream
*) arg
;
799 /* stream used as output */
800 return lttng_abi_open_stream(objd
, stream
, uargs
);
802 case LTTNG_UST_FLUSH_BUFFER
:
803 return channel
->ops
->flush_buffer(channel
->chan
, channel
->handle
);
811 * lttng_channel_poll - lttng stream addition/removal monitoring
816 unsigned int lttng_channel_poll(struct file
*file
, poll_table
*wait
)
818 struct ltt_channel
*channel
= file
->private_data
;
819 unsigned int mask
= 0;
821 if (file
->f_mode
& FMODE_READ
) {
822 poll_wait_set_exclusive(wait
);
823 poll_wait(file
, channel
->ops
->get_hp_wait_queue(channel
->chan
),
826 if (channel
->ops
->is_disabled(channel
->chan
))
828 if (channel
->ops
->is_finalized(channel
->chan
))
830 if (channel
->ops
->buffer_has_read_closed_stream(channel
->chan
))
831 return POLLIN
| POLLRDNORM
;
840 int lttng_channel_release(int objd
)
842 struct ltt_channel
*channel
= objd_private(objd
);
845 return lttng_ust_objd_unref(channel
->session
->objd
);
849 static const struct lttng_ust_objd_ops lttng_channel_ops
= {
850 .release
= lttng_channel_release
,
851 //.poll = lttng_channel_poll,
852 .cmd
= lttng_channel_cmd
,
855 static const struct lttng_ust_objd_ops lttng_metadata_ops
= {
856 .release
= lttng_channel_release
,
857 .cmd
= lttng_metadata_cmd
,
861 * lttng_rb_cmd - lttng ring buffer control through object descriptors
863 * @objd: the object descriptor
866 * @uargs: UST arguments (internal)
868 * This object descriptor implements lttng commands:
869 * (None for now. Access is done directly though shm.)
872 long lttng_rb_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
873 union ust_args
*uargs
)
882 int lttng_rb_release(int objd
)
884 struct stream_priv_data
*priv
= objd_private(objd
);
885 struct lttng_ust_lib_ring_buffer
*buf
;
886 struct ltt_channel
*channel
;
890 channel
= priv
->ltt_chan
;
893 * If we are at ABI exit, we don't want to close the
894 * buffer opened for read: it is being shared between
895 * the parent and child (right after fork), and we don't
896 * want the child to close it for the parent. For a real
897 * exit, we don't care about marking it as closed, as
898 * the consumer daemon (if there is one) will do fine
899 * even if we don't mark it as "closed" for reading on
901 * We only mark it as closed if it is being explicitely
902 * released by the session daemon with an explicit
905 if (!lttng_ust_abi_close_in_progress
)
906 channel
->ops
->buffer_read_close(buf
, channel
->handle
);
908 return lttng_ust_objd_unref(channel
->objd
);
913 static const struct lttng_ust_objd_ops lib_ring_buffer_objd_ops
= {
914 .release
= lttng_rb_release
,
919 * lttng_event_cmd - lttng control through object descriptors
921 * @objd: the object descriptor
924 * @uargs: UST arguments (internal)
926 * This object descriptor implements lttng commands:
928 * Prepend a context field to each record of this event
930 * Enable recording for this event (weak enable)
932 * Disable recording for this event (strong disable)
935 long lttng_event_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
936 union ust_args
*uargs
)
938 struct ltt_event
*event
= objd_private(objd
);
941 case LTTNG_UST_CONTEXT
:
942 return lttng_abi_add_context(objd
,
943 (struct lttng_ust_context
*) arg
,
944 &event
->ctx
, event
->chan
->session
);
945 case LTTNG_UST_ENABLE
:
946 return ltt_event_enable(event
);
947 case LTTNG_UST_DISABLE
:
948 return ltt_event_disable(event
);
955 int lttng_event_release(int objd
)
957 struct ltt_event
*event
= objd_private(objd
);
960 return lttng_ust_objd_unref(event
->chan
->objd
);
964 /* TODO: filter control ioctl */
965 static const struct lttng_ust_objd_ops lttng_event_ops
= {
966 .release
= lttng_event_release
,
967 .cmd
= lttng_event_cmd
,
971 * lttng_wildcard_cmd - lttng control through object descriptors
973 * @objd: the object descriptor
976 * @uargs: UST arguments (internal)
978 * This object descriptor implements lttng commands:
980 * Prepend a context field to each record of events of this
983 * Enable recording for these wildcard events (weak enable)
985 * Disable recording for these wildcard events (strong disable)
988 long lttng_wildcard_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
989 union ust_args
*uargs
)
991 struct session_wildcard
*wildcard
= objd_private(objd
);
994 case LTTNG_UST_CONTEXT
:
995 return -ENOSYS
; /* not implemented yet */
997 return lttng_abi_add_context(objd
,
998 (struct lttng_ust_context
*) arg
,
999 &wildcard
->ctx
, wildcard
->chan
->session
);
1001 case LTTNG_UST_ENABLE
:
1002 return ltt_wildcard_enable(wildcard
);
1003 case LTTNG_UST_DISABLE
:
1004 return ltt_wildcard_disable(wildcard
);
1011 int lttng_wildcard_release(int objd
)
1013 struct session_wildcard
*wildcard
= objd_private(objd
);
1016 return lttng_ust_objd_unref(wildcard
->chan
->objd
);
1020 /* TODO: filter control ioctl */
1021 static const struct lttng_ust_objd_ops lttng_wildcard_ops
= {
1022 .release
= lttng_wildcard_release
,
1023 .cmd
= lttng_wildcard_cmd
,
1026 void lttng_ust_abi_exit(void)
1028 lttng_ust_abi_close_in_progress
= 1;
1029 objd_table_destroy();
1030 lttng_ust_abi_close_in_progress
= 0;