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 <lttng/tracepoint.h>
33 #include <usterr-signal-safe.h>
35 #include "ltt-tracer.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",
333 .loglevel_type
= LTTNG_UST_LOGLEVEL_ALL
,
334 .loglevel
= TRACE_DEFAULT
,
336 struct ltt_event
*event
;
340 * We tolerate no failure path after event creation. It will stay
341 * invariant for the rest of the session.
343 ret
= ltt_event_create(channel
, &metadata_params
, NULL
, &event
);
351 return; /* not allowed to return error */
354 int lttng_abi_create_channel(int session_objd
,
355 struct lttng_ust_channel
*chan_param
,
356 enum channel_type channel_type
,
357 union ust_args
*uargs
)
359 struct ltt_session
*session
= objd_private(session_objd
);
360 const struct lttng_ust_objd_ops
*ops
;
361 const char *transport_name
;
362 struct ltt_channel
*chan
;
365 struct ltt_channel chan_priv_init
;
367 switch (channel_type
) {
368 case PER_CPU_CHANNEL
:
369 if (chan_param
->output
== LTTNG_UST_MMAP
) {
370 transport_name
= chan_param
->overwrite
?
371 "relay-overwrite-mmap" : "relay-discard-mmap";
375 ops
= <tng_channel_ops
;
377 case METADATA_CHANNEL
:
378 if (chan_param
->output
== LTTNG_UST_MMAP
)
379 transport_name
= "relay-metadata-mmap";
382 ops
= <tng_metadata_ops
;
385 transport_name
= "<unknown>";
388 chan_objd
= objd_alloc(NULL
, ops
);
393 memset(&chan_priv_init
, 0, sizeof(chan_priv_init
));
394 /* Copy of session UUID for consumer (availability through shm) */
395 memcpy(chan_priv_init
.uuid
, session
->uuid
, sizeof(session
->uuid
));
398 * We tolerate no failure path after channel creation. It will stay
399 * invariant for the rest of the session.
401 chan
= ltt_channel_create(session
, transport_name
, NULL
,
402 chan_param
->subbuf_size
,
403 chan_param
->num_subbuf
,
404 chan_param
->switch_timer_interval
,
405 chan_param
->read_timer_interval
,
406 &uargs
->channel
.shm_fd
,
407 &uargs
->channel
.wait_fd
,
408 &uargs
->channel
.memory_map_size
,
414 objd_set_private(chan_objd
, chan
);
415 chan
->objd
= chan_objd
;
416 if (channel_type
== METADATA_CHANNEL
) {
417 session
->metadata
= chan
;
418 lttng_metadata_create_events(chan_objd
);
420 /* The channel created holds a reference on the session */
421 objd_ref(session_objd
);
429 err
= lttng_ust_objd_unref(chan_objd
);
437 * lttng_session_cmd - lttng session object command
442 * @uargs: UST arguments (internal)
444 * This descriptor implements lttng commands:
446 * Returns a LTTng channel object descriptor
448 * Enables tracing for a session (weak enable)
450 * Disables tracing for a session (strong disable)
452 * Returns a LTTng metadata object descriptor
454 * The returned channel will be deleted when its file descriptor is closed.
457 long lttng_session_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
458 union ust_args
*uargs
)
460 struct ltt_session
*session
= objd_private(objd
);
463 case LTTNG_UST_CHANNEL
:
464 return lttng_abi_create_channel(objd
,
465 (struct lttng_ust_channel
*) arg
,
466 PER_CPU_CHANNEL
, uargs
);
467 case LTTNG_UST_SESSION_START
:
468 case LTTNG_UST_ENABLE
:
469 return ltt_session_enable(session
);
470 case LTTNG_UST_SESSION_STOP
:
471 case LTTNG_UST_DISABLE
:
472 return ltt_session_disable(session
);
473 case LTTNG_UST_METADATA
:
474 return lttng_abi_create_channel(objd
,
475 (struct lttng_ust_channel
*) arg
,
476 METADATA_CHANNEL
, uargs
);
483 * Called when the last file reference is dropped.
485 * Big fat note: channels and events are invariant for the whole session after
486 * their creation. So this session destruction also destroys all channel and
487 * event structures specific to this session (they are not destroyed when their
488 * individual file is released).
491 int lttng_release_session(int objd
)
493 struct ltt_session
*session
= objd_private(objd
);
496 ltt_session_destroy(session
);
503 static const struct lttng_ust_objd_ops lttng_session_ops
= {
504 .release
= lttng_release_session
,
505 .cmd
= lttng_session_cmd
,
509 long lttng_tracepoint_list_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
510 union ust_args
*uargs
)
512 struct lttng_ust_tracepoint_list
*list
= objd_private(objd
);
513 struct lttng_ust_tracepoint_iter
*tp
=
514 (struct lttng_ust_tracepoint_iter
*) arg
;
515 struct lttng_ust_tracepoint_iter
*iter
;
518 case LTTNG_UST_TRACEPOINT_LIST_GET
:
521 iter
= lttng_ust_tracepoint_list_get_iter_next(list
);
524 if (!strcmp(iter
->name
, "lttng_ust:metadata"))
526 memcpy(tp
, iter
, sizeof(*tp
));
535 int lttng_abi_tracepoint_list(void)
538 struct lttng_ust_tracepoint_list
*list
;
540 list_objd
= objd_alloc(NULL
, <tng_tracepoint_list_ops
);
545 list
= zmalloc(sizeof(*list
));
550 objd_set_private(list_objd
, list
);
552 /* populate list by walking on all registered probes. */
553 ret
= ltt_probes_get_event_list(list
);
565 err
= lttng_ust_objd_unref(list_objd
);
573 int lttng_release_tracepoint_list(int objd
)
575 struct lttng_ust_tracepoint_list
*list
= objd_private(objd
);
578 ltt_probes_prune_event_list(list
);
586 static const struct lttng_ust_objd_ops lttng_tracepoint_list_ops
= {
587 .release
= lttng_release_tracepoint_list
,
588 .cmd
= lttng_tracepoint_list_cmd
,
591 struct stream_priv_data
{
592 struct lttng_ust_lib_ring_buffer
*buf
;
593 struct ltt_channel
*ltt_chan
;
597 int lttng_abi_open_stream(int channel_objd
, struct lttng_ust_stream
*info
,
598 union ust_args
*uargs
)
600 struct ltt_channel
*channel
= objd_private(channel_objd
);
601 struct lttng_ust_lib_ring_buffer
*buf
;
602 struct stream_priv_data
*priv
;
603 int stream_objd
, ret
;
605 buf
= channel
->ops
->buffer_read_open(channel
->chan
, channel
->handle
,
606 &uargs
->stream
.shm_fd
,
607 &uargs
->stream
.wait_fd
,
608 &uargs
->stream
.memory_map_size
);
612 priv
= zmalloc(sizeof(*priv
));
618 priv
->ltt_chan
= channel
;
619 stream_objd
= objd_alloc(priv
, &lib_ring_buffer_objd_ops
);
620 if (stream_objd
< 0) {
624 /* Hold a reference on the channel object descriptor */
625 objd_ref(channel_objd
);
631 channel
->ops
->buffer_read_close(buf
, channel
->handle
);
636 int lttng_abi_create_event(int channel_objd
,
637 struct lttng_ust_event
*event_param
)
639 struct ltt_channel
*channel
= objd_private(channel_objd
);
640 struct ltt_event
*event
;
643 event_param
->name
[LTTNG_UST_SYM_NAME_LEN
- 1] = '\0';
644 event_objd
= objd_alloc(NULL
, <tng_event_ops
);
645 if (event_objd
< 0) {
650 * We tolerate no failure path after event creation. It will stay
651 * invariant for the rest of the session.
653 ret
= ltt_event_create(channel
, event_param
, NULL
, &event
);
657 objd_set_private(event_objd
, event
);
658 /* The event holds a reference on the channel */
659 objd_ref(channel_objd
);
666 err
= lttng_ust_objd_unref(event_objd
);
674 int lttng_abi_create_wildcard(int channel_objd
,
675 struct lttng_ust_event
*event_param
)
677 struct ltt_channel
*channel
= objd_private(channel_objd
);
678 struct session_wildcard
*wildcard
;
679 int wildcard_objd
, ret
;
681 event_param
->name
[LTTNG_UST_SYM_NAME_LEN
- 1] = '\0';
682 wildcard_objd
= objd_alloc(NULL
, <tng_wildcard_ops
);
683 if (wildcard_objd
< 0) {
688 * We tolerate no failure path after wildcard creation. It will
689 * stay invariant for the rest of the session.
691 ret
= ltt_wildcard_create(channel
, event_param
, &wildcard
);
695 objd_set_private(wildcard_objd
, wildcard
);
696 /* The wildcard holds a reference on the channel */
697 objd_ref(channel_objd
);
698 return wildcard_objd
;
704 err
= lttng_ust_objd_unref(wildcard_objd
);
712 * lttng_channel_cmd - lttng control through object descriptors
714 * @objd: the object descriptor
717 * @uargs: UST arguments (internal)
719 * This object descriptor implements lttng commands:
721 * Returns an event stream object descriptor or failure.
722 * (typically, one event stream records events from one CPU)
724 * Returns an event object descriptor or failure.
726 * Prepend a context field to each event in the channel
728 * Enable recording for events in this channel (weak enable)
730 * Disable recording for events in this channel (strong disable)
732 * Channel and event file descriptors also hold a reference on the session.
735 long lttng_channel_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
736 union ust_args
*uargs
)
738 struct ltt_channel
*channel
= objd_private(objd
);
741 case LTTNG_UST_STREAM
:
743 struct lttng_ust_stream
*stream
;
745 stream
= (struct lttng_ust_stream
*) arg
;
746 /* stream used as output */
747 return lttng_abi_open_stream(objd
, stream
, uargs
);
749 case LTTNG_UST_EVENT
:
751 struct lttng_ust_event
*event_param
=
752 (struct lttng_ust_event
*) arg
;
753 if (event_param
->name
[strlen(event_param
->name
) - 1] == '*') {
754 /* If ends with wildcard, create wildcard. */
755 return lttng_abi_create_wildcard(objd
, event_param
);
757 return lttng_abi_create_event(objd
, event_param
);
760 case LTTNG_UST_CONTEXT
:
761 return lttng_abi_add_context(objd
,
762 (struct lttng_ust_context
*) arg
,
763 &channel
->ctx
, channel
->session
);
764 case LTTNG_UST_ENABLE
:
765 return ltt_channel_enable(channel
);
766 case LTTNG_UST_DISABLE
:
767 return ltt_channel_disable(channel
);
768 case LTTNG_UST_FLUSH_BUFFER
:
769 return channel
->ops
->flush_buffer(channel
->chan
, channel
->handle
);
776 * lttng_metadata_cmd - lttng control through object descriptors
778 * @objd: the object descriptor
781 * @uargs: UST arguments (internal)
783 * This object descriptor implements lttng commands:
785 * Returns an event stream file descriptor or failure.
787 * Channel and event file descriptors also hold a reference on the session.
790 long lttng_metadata_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
791 union ust_args
*uargs
)
793 struct ltt_channel
*channel
= objd_private(objd
);
796 case LTTNG_UST_STREAM
:
798 struct lttng_ust_stream
*stream
;
800 stream
= (struct lttng_ust_stream
*) arg
;
801 /* stream used as output */
802 return lttng_abi_open_stream(objd
, stream
, uargs
);
804 case LTTNG_UST_FLUSH_BUFFER
:
805 return channel
->ops
->flush_buffer(channel
->chan
, channel
->handle
);
813 * lttng_channel_poll - lttng stream addition/removal monitoring
818 unsigned int lttng_channel_poll(struct file
*file
, poll_table
*wait
)
820 struct ltt_channel
*channel
= file
->private_data
;
821 unsigned int mask
= 0;
823 if (file
->f_mode
& FMODE_READ
) {
824 poll_wait_set_exclusive(wait
);
825 poll_wait(file
, channel
->ops
->get_hp_wait_queue(channel
->chan
),
828 if (channel
->ops
->is_disabled(channel
->chan
))
830 if (channel
->ops
->is_finalized(channel
->chan
))
832 if (channel
->ops
->buffer_has_read_closed_stream(channel
->chan
))
833 return POLLIN
| POLLRDNORM
;
842 int lttng_channel_release(int objd
)
844 struct ltt_channel
*channel
= objd_private(objd
);
847 return lttng_ust_objd_unref(channel
->session
->objd
);
851 static const struct lttng_ust_objd_ops lttng_channel_ops
= {
852 .release
= lttng_channel_release
,
853 //.poll = lttng_channel_poll,
854 .cmd
= lttng_channel_cmd
,
857 static const struct lttng_ust_objd_ops lttng_metadata_ops
= {
858 .release
= lttng_channel_release
,
859 .cmd
= lttng_metadata_cmd
,
863 * lttng_rb_cmd - lttng ring buffer control through object descriptors
865 * @objd: the object descriptor
868 * @uargs: UST arguments (internal)
870 * This object descriptor implements lttng commands:
871 * (None for now. Access is done directly though shm.)
874 long lttng_rb_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
875 union ust_args
*uargs
)
884 int lttng_rb_release(int objd
)
886 struct stream_priv_data
*priv
= objd_private(objd
);
887 struct lttng_ust_lib_ring_buffer
*buf
;
888 struct ltt_channel
*channel
;
892 channel
= priv
->ltt_chan
;
895 * If we are at ABI exit, we don't want to close the
896 * buffer opened for read: it is being shared between
897 * the parent and child (right after fork), and we don't
898 * want the child to close it for the parent. For a real
899 * exit, we don't care about marking it as closed, as
900 * the consumer daemon (if there is one) will do fine
901 * even if we don't mark it as "closed" for reading on
903 * We only mark it as closed if it is being explicitely
904 * released by the session daemon with an explicit
907 if (!lttng_ust_abi_close_in_progress
)
908 channel
->ops
->buffer_read_close(buf
, channel
->handle
);
910 return lttng_ust_objd_unref(channel
->objd
);
915 static const struct lttng_ust_objd_ops lib_ring_buffer_objd_ops
= {
916 .release
= lttng_rb_release
,
921 * lttng_event_cmd - lttng control through object descriptors
923 * @objd: the object descriptor
926 * @uargs: UST arguments (internal)
928 * This object descriptor implements lttng commands:
930 * Prepend a context field to each record of this event
932 * Enable recording for this event (weak enable)
934 * Disable recording for this event (strong disable)
937 long lttng_event_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
938 union ust_args
*uargs
)
940 struct ltt_event
*event
= objd_private(objd
);
943 case LTTNG_UST_CONTEXT
:
944 return lttng_abi_add_context(objd
,
945 (struct lttng_ust_context
*) arg
,
946 &event
->ctx
, event
->chan
->session
);
947 case LTTNG_UST_ENABLE
:
948 return ltt_event_enable(event
);
949 case LTTNG_UST_DISABLE
:
950 return ltt_event_disable(event
);
957 int lttng_event_release(int objd
)
959 struct ltt_event
*event
= objd_private(objd
);
962 return lttng_ust_objd_unref(event
->chan
->objd
);
966 /* TODO: filter control ioctl */
967 static const struct lttng_ust_objd_ops lttng_event_ops
= {
968 .release
= lttng_event_release
,
969 .cmd
= lttng_event_cmd
,
973 * lttng_wildcard_cmd - lttng control through object descriptors
975 * @objd: the object descriptor
978 * @uargs: UST arguments (internal)
980 * This object descriptor implements lttng commands:
982 * Prepend a context field to each record of events of this
985 * Enable recording for these wildcard events (weak enable)
987 * Disable recording for these wildcard events (strong disable)
990 long lttng_wildcard_cmd(int objd
, unsigned int cmd
, unsigned long arg
,
991 union ust_args
*uargs
)
993 struct session_wildcard
*wildcard
= objd_private(objd
);
996 case LTTNG_UST_CONTEXT
:
997 return -ENOSYS
; /* not implemented yet */
999 return lttng_abi_add_context(objd
,
1000 (struct lttng_ust_context
*) arg
,
1001 &wildcard
->ctx
, wildcard
->chan
->session
);
1003 case LTTNG_UST_ENABLE
:
1004 return ltt_wildcard_enable(wildcard
);
1005 case LTTNG_UST_DISABLE
:
1006 return ltt_wildcard_disable(wildcard
);
1013 int lttng_wildcard_release(int objd
)
1015 struct session_wildcard
*wildcard
= objd_private(objd
);
1018 return lttng_ust_objd_unref(wildcard
->chan
->objd
);
1022 /* TODO: filter control ioctl */
1023 static const struct lttng_ust_objd_ops lttng_wildcard_ops
= {
1024 .release
= lttng_wildcard_release
,
1025 .cmd
= lttng_wildcard_cmd
,
1028 void lttng_ust_abi_exit(void)
1030 lttng_ust_abi_close_in_progress
= 1;
1031 objd_table_destroy();
1032 lttng_ust_abi_close_in_progress
= 0;