1 /* Copyright (C) 2009 Pierre-Marc Fournier
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #include <sys/types.h>
23 #include <sys/socket.h>
32 #include <ust/marker.h>
36 #include "buffers.h" /* FIXME: remove */
37 #include "marker-control.h"
41 #define USTSIGNAL SIGIO
43 #define MAX_MSG_SIZE (100)
45 #define MSG_REGISTER_NOTIF 2
47 char consumer_stack
[10000];
49 /* This should only be accessed by the constructor, before the creation
50 * of the listener, and then only by the listener.
54 struct list_head blocked_consumers
= LIST_HEAD_INIT(blocked_consumers
);
56 static struct ustcomm_app ustcomm_app
;
58 struct tracecmd
{ /* no padding */
63 /* volatile because shared between the listener and the main thread */
64 volatile sig_atomic_t buffers_to_export
= 0;
67 /* size: the size of all the fields except size itself */
70 /* Only the necessary part of the payload is transferred. It
71 * may even be none of it.
76 struct consumer_channel
{
78 struct ltt_channel_struct
*chan
;
81 struct blocked_consumer
{
86 /* args to ustcomm_send_reply */
87 struct ustcomm_server server
;
88 struct ustcomm_source src
;
90 /* args to ust_buffers_do_get_subbuf */
91 struct ust_buffer
*buf
;
93 struct list_head list
;
96 static long long make_pidunique(void)
101 gettimeofday(&tv
, NULL
);
105 retval
|= tv
.tv_usec
;
110 static void print_markers(FILE *fp
)
112 struct marker_iter iter
;
115 marker_iter_reset(&iter
);
116 marker_iter_start(&iter
);
119 fprintf(fp
, "marker: %s/%s %d \"%s\" %p\n", iter
.marker
->channel
, iter
.marker
->name
, (int)imv_read(iter
.marker
->state
), iter
.marker
->format
, iter
.marker
->location
);
120 marker_iter_next(&iter
);
125 static int init_socket(void);
127 /* This needs to be called whenever a new thread is created. It notifies
128 * liburcu of the new thread.
131 void ust_register_thread(void)
133 rcu_register_thread();
140 struct trctl_msg msg
;
142 /* FIXME: fd_notif should probably be protected by a spinlock */
147 msg
.type
= MSG_NOTIF
;
148 msg
.size
= sizeof(msg
.type
);
150 /* FIXME: don't block here */
151 result
= write(fd_notif
, &msg
, msg
.size
+sizeof(msg
.size
));
158 /* Ask the daemon to collect a trace called trace_name and being
159 * produced by this pid.
161 * The trace must be at least allocated. (It can also be started.)
162 * This is because _ltt_trace_find is used.
165 static void inform_consumer_daemon(const char *trace_name
)
168 struct ltt_trace_struct
*trace
;
169 pid_t pid
= getpid();
174 trace
= _ltt_trace_find(trace_name
);
176 WARN("inform_consumer_daemon: could not find trace \"%s\"; it is probably already destroyed", trace_name
);
180 for(i
=0; i
< trace
->nr_channels
; i
++) {
181 result
= ustcomm_request_consumer(pid
, trace
->channels
[i
].channel_name
);
183 WARN("Failed to request collection for channel %s. Is the daemon available?", trace
->channels
[i
].channel_name
);
184 /* continue even if fail */
193 void process_blocked_consumers(void)
197 struct blocked_consumer
*bc
;
202 list_for_each_entry(bc
, &blocked_consumers
, list
) {
206 fds
= (struct pollfd
*) malloc(n_fds
* sizeof(struct pollfd
));
208 ERR("malloc returned NULL");
212 list_for_each_entry(bc
, &blocked_consumers
, list
) {
213 fds
[idx
].fd
= bc
->fd_producer
;
214 fds
[idx
].events
= POLLIN
;
215 bc
->tmp_poll_idx
= idx
;
219 while((result
= poll(fds
, n_fds
, 0)) == -1 && errno
== EINTR
)
226 list_for_each_entry(bc
, &blocked_consumers
, list
) {
227 if(fds
[bc
->tmp_poll_idx
].revents
) {
228 long consumed_old
= 0;
231 result
= read(bc
->fd_producer
, &inbuf
, 1);
239 close(bc
->fd_producer
);
243 result
= ustcomm_send_reply(&bc
->server
, "END", &bc
->src
);
245 ERR("ustcomm_send_reply failed");
252 result
= ust_buffers_do_get_subbuf(bc
->buf
, &consumed_old
);
253 if(result
== -EAGAIN
) {
254 WARN("missed buffer?");
257 else if(result
< 0) {
258 DBG("ust_buffers_do_get_subbuf: error: %s", strerror(-result
));
260 asprintf(&reply
, "%s %ld", "OK", consumed_old
);
261 result
= ustcomm_send_reply(&bc
->server
, reply
, &bc
->src
);
263 ERR("ustcomm_send_reply failed");
275 void *listener_main(void *p
)
279 ust_register_thread();
284 char trace_name
[] = "auto";
285 char trace_type
[] = "ustrelay";
288 struct ustcomm_source src
;
290 process_blocked_consumers();
292 result
= ustcomm_app_recv_message(&ustcomm_app
, &recvbuf
, &src
, 5);
294 WARN("error in ustcomm_app_recv_message");
297 else if(result
== 0) {
302 DBG("received a message! it's: %s", recvbuf
);
303 len
= strlen(recvbuf
);
305 if(!strcmp(recvbuf
, "print_markers")) {
306 print_markers(stderr
);
308 else if(!strcmp(recvbuf
, "list_markers")) {
313 fp
= open_memstream(&ptr
, &size
);
317 result
= ustcomm_send_reply(&ustcomm_app
.server
, ptr
, &src
);
321 else if(!strcmp(recvbuf
, "start")) {
322 /* start is an operation that setups the trace, allocates it and starts it */
323 result
= ltt_trace_setup(trace_name
);
325 ERR("ltt_trace_setup failed");
329 result
= ltt_trace_set_type(trace_name
, trace_type
);
331 ERR("ltt_trace_set_type failed");
335 result
= ltt_trace_alloc(trace_name
);
337 ERR("ltt_trace_alloc failed");
341 inform_consumer_daemon(trace_name
);
343 result
= ltt_trace_start(trace_name
);
345 ERR("ltt_trace_start failed");
349 else if(!strcmp(recvbuf
, "trace_setup")) {
352 result
= ltt_trace_setup(trace_name
);
354 ERR("ltt_trace_setup failed");
358 result
= ltt_trace_set_type(trace_name
, trace_type
);
360 ERR("ltt_trace_set_type failed");
364 else if(!strcmp(recvbuf
, "trace_alloc")) {
367 result
= ltt_trace_alloc(trace_name
);
369 ERR("ltt_trace_alloc failed");
373 else if(!strcmp(recvbuf
, "trace_create")) {
376 result
= ltt_trace_setup(trace_name
);
378 ERR("ltt_trace_setup failed");
382 result
= ltt_trace_set_type(trace_name
, trace_type
);
384 ERR("ltt_trace_set_type failed");
388 result
= ltt_trace_alloc(trace_name
);
390 ERR("ltt_trace_alloc failed");
394 inform_consumer_daemon(trace_name
);
396 else if(!strcmp(recvbuf
, "trace_start")) {
399 result
= ltt_trace_start(trace_name
);
401 ERR("ltt_trace_start failed");
405 else if(!strcmp(recvbuf
, "trace_stop")) {
408 result
= ltt_trace_stop(trace_name
);
410 ERR("ltt_trace_stop failed");
414 else if(!strcmp(recvbuf
, "trace_destroy")) {
416 DBG("trace destroy");
418 result
= ltt_trace_destroy(trace_name
);
420 ERR("ltt_trace_destroy failed");
424 else if(nth_token_is(recvbuf
, "get_shmid", 0) == 1) {
425 struct ltt_trace_struct
*trace
;
426 char trace_name
[] = "auto";
432 channel_name
= nth_token(recvbuf
, 1);
433 if(channel_name
== NULL
) {
434 ERR("get_shmid: cannot parse channel");
439 trace
= _ltt_trace_find(trace_name
);
443 ERR("cannot find trace!");
447 for(i
=0; i
<trace
->nr_channels
; i
++) {
448 struct ust_channel
*channel
= &trace
->channels
[i
];
449 struct ust_buffer
*buf
= channel
->buf
;
451 if(!strcmp(trace
->channels
[i
].channel_name
, channel_name
)) {
454 DBG("the shmid for the requested channel is %d", buf
->shmid
);
455 DBG("the shmid for its buffer structure is %d", channel
->buf_shmid
);
456 asprintf(&reply
, "%d %d", buf
->shmid
, channel
->buf_shmid
);
458 result
= ustcomm_send_reply(&ustcomm_app
.server
, reply
, &src
);
460 ERR("listener: get_shmid: ustcomm_send_reply failed");
472 else if(nth_token_is(recvbuf
, "get_n_subbufs", 0) == 1) {
473 struct ltt_trace_struct
*trace
;
474 char trace_name
[] = "auto";
478 DBG("get_n_subbufs");
480 channel_name
= nth_token(recvbuf
, 1);
481 if(channel_name
== NULL
) {
482 ERR("get_n_subbufs: cannot parse channel");
487 trace
= _ltt_trace_find(trace_name
);
491 ERR("cannot find trace!");
495 for(i
=0; i
<trace
->nr_channels
; i
++) {
496 struct ust_channel
*channel
= &trace
->channels
[i
];
498 if(!strcmp(trace
->channels
[i
].channel_name
, channel_name
)) {
501 DBG("the n_subbufs for the requested channel is %d", channel
->subbuf_cnt
);
502 asprintf(&reply
, "%d", channel
->subbuf_cnt
);
504 result
= ustcomm_send_reply(&ustcomm_app
.server
, reply
, &src
);
506 ERR("listener: get_n_subbufs: ustcomm_send_reply failed");
516 else if(nth_token_is(recvbuf
, "get_subbuf_size", 0) == 1) {
517 struct ltt_trace_struct
*trace
;
518 char trace_name
[] = "auto";
522 DBG("get_subbuf_size");
524 channel_name
= nth_token(recvbuf
, 1);
525 if(channel_name
== NULL
) {
526 ERR("get_subbuf_size: cannot parse channel");
531 trace
= _ltt_trace_find(trace_name
);
535 ERR("cannot find trace!");
539 for(i
=0; i
<trace
->nr_channels
; i
++) {
540 struct ust_channel
*channel
= &trace
->channels
[i
];
542 if(!strcmp(trace
->channels
[i
].channel_name
, channel_name
)) {
545 DBG("the subbuf_size for the requested channel is %zd", channel
->subbuf_size
);
546 asprintf(&reply
, "%zd", channel
->subbuf_size
);
548 result
= ustcomm_send_reply(&ustcomm_app
.server
, reply
, &src
);
550 ERR("listener: get_subbuf_size: ustcomm_send_reply failed");
560 else if(nth_token_is(recvbuf
, "load_probe_lib", 0) == 1) {
563 libfile
= nth_token(recvbuf
, 1);
565 DBG("load_probe_lib loading %s", libfile
);
567 else if(nth_token_is(recvbuf
, "get_subbuffer", 0) == 1) {
568 struct ltt_trace_struct
*trace
;
569 char trace_name
[] = "auto";
575 channel_name
= nth_token(recvbuf
, 1);
576 if(channel_name
== NULL
) {
577 ERR("get_subbuf: cannot parse channel");
582 trace
= _ltt_trace_find(trace_name
);
586 ERR("cannot find trace!");
590 for(i
=0; i
<trace
->nr_channels
; i
++) {
591 struct ust_channel
*channel
= &trace
->channels
[i
];
593 if(!strcmp(trace
->channels
[i
].channel_name
, channel_name
)) {
594 struct ust_buffer
*buf
= channel
->buf
;
595 struct blocked_consumer
*bc
;
597 bc
= (struct blocked_consumer
*) malloc(sizeof(struct blocked_consumer
));
599 ERR("malloc returned NULL");
602 bc
->fd_consumer
= src
.fd
;
603 bc
->fd_producer
= buf
->data_ready_fd_read
;
606 bc
->server
= ustcomm_app
.server
;
608 list_add(&bc
->list
, &blocked_consumers
);
614 else if(nth_token_is(recvbuf
, "put_subbuffer", 0) == 1) {
615 struct ltt_trace_struct
*trace
;
616 char trace_name
[] = "auto";
620 char *consumed_old_str
;
625 channel_name
= strdup_malloc(nth_token(recvbuf
, 1));
626 if(channel_name
== NULL
) {
627 ERR("put_subbuf_size: cannot parse channel");
631 consumed_old_str
= strdup_malloc(nth_token(recvbuf
, 2));
632 if(consumed_old_str
== NULL
) {
633 ERR("put_subbuf: cannot parse consumed_old");
636 consumed_old
= strtol(consumed_old_str
, &endptr
, 10);
637 if(*endptr
!= '\0') {
638 ERR("put_subbuf: invalid value for consumed_old");
643 trace
= _ltt_trace_find(trace_name
);
647 ERR("cannot find trace!");
651 for(i
=0; i
<trace
->nr_channels
; i
++) {
652 struct ust_channel
*channel
= &trace
->channels
[i
];
654 if(!strcmp(trace
->channels
[i
].channel_name
, channel_name
)) {
655 struct ust_buffer
*buf
= channel
->buf
;
659 result
= ust_buffers_do_put_subbuf(buf
, consumed_old
);
661 WARN("ust_buffers_do_put_subbuf: error (subbuf=%s)", channel_name
);
662 asprintf(&reply
, "%s", "ERROR");
665 DBG("ust_buffers_do_put_subbuf: success (subbuf=%s)", channel_name
);
666 asprintf(&reply
, "%s", "OK");
669 result
= ustcomm_send_reply(&ustcomm_app
.server
, reply
, &src
);
671 ERR("listener: put_subbuf: ustcomm_send_reply failed");
682 free(consumed_old_str
);
684 else if(nth_token_is(recvbuf
, "enable_marker", 0) == 1) {
685 char *channel_slash_name
= nth_token(recvbuf
, 1);
686 char channel_name
[256]="";
687 char marker_name
[256]="";
689 result
= sscanf(channel_slash_name
, "%255[^/]/%255s", channel_name
, marker_name
);
691 if(channel_name
== NULL
|| marker_name
== NULL
) {
692 WARN("invalid marker name");
695 printf("%s %s\n", channel_name
, marker_name
);
697 result
= ltt_marker_connect(channel_name
, marker_name
, "default");
699 WARN("could not enable marker; channel=%s, name=%s", channel_name
, marker_name
);
702 else if(nth_token_is(recvbuf
, "disable_marker", 0) == 1) {
703 char *channel_slash_name
= nth_token(recvbuf
, 1);
707 result
= sscanf(channel_slash_name
, "%a[^/]/%as", &channel_name
, &marker_name
);
709 if(marker_name
== NULL
) {
711 printf("%s %s\n", channel_name
, marker_name
);
713 result
= ltt_marker_disconnect(channel_name
, marker_name
, "default");
715 WARN("could not disable marker; channel=%s, name=%s", channel_name
, marker_name
);
718 else if(nth_token_is(recvbuf
, "get_pidunique", 0) == 1) {
721 asprintf(&reply
, "%lld", pidunique
);
723 result
= ustcomm_send_reply(&ustcomm_app
.server
, reply
, &src
);
725 ERR("listener: get_pidunique: ustcomm_send_reply failed");
731 // else if(nth_token_is(recvbuf, "get_notifications", 0) == 1) {
732 // struct ltt_trace_struct *trace;
733 // char trace_name[] = "auto";
735 // char *channel_name;
737 // DBG("get_notifications");
739 // channel_name = strdup_malloc(nth_token(recvbuf, 1));
740 // if(channel_name == NULL) {
741 // ERR("put_subbuf_size: cannot parse channel");
745 // ltt_lock_traces();
746 // trace = _ltt_trace_find(trace_name);
747 // ltt_unlock_traces();
749 // if(trace == NULL) {
750 // ERR("cannot find trace!");
754 // for(i=0; i<trace->nr_channels; i++) {
755 // struct rchan *rchan = trace->channels[i].trans_channel_data;
758 // if(!strcmp(trace->channels[i].channel_name, channel_name)) {
759 // struct rchan_buf *rbuf = rchan->buf;
760 // struct ltt_channel_buf_struct *lttbuf = trace->channels[i].buf;
762 // result = fd = ustcomm_app_detach_client(&ustcomm_app, &src);
763 // if(result == -1) {
764 // ERR("ustcomm_app_detach_client failed");
768 // lttbuf->wake_consumer_arg = (void *) fd;
772 // lttbuf->call_wake_consumer = 1;
778 // free(channel_name);
781 ERR("unable to parse message: %s", recvbuf
);
789 volatile sig_atomic_t have_listener
= 0;
791 void create_listener(void)
794 static char listener_stack
[16384];
801 WARN("not creating listener because we already had one");
806 result
= clone((int (*)(void *)) listener_main
, listener_stack
+sizeof(listener_stack
)-1, CLONE_FS
| CLONE_FILES
| CLONE_VM
| CLONE_SIGHAND
| CLONE_THREAD
, NULL
);
813 pthread_create(&thread
, NULL
, listener_main
, NULL
);
819 static int init_socket(void)
821 return ustcomm_init_app(getpid(), &ustcomm_app
);
824 #define AUTOPROBE_DISABLED 0
825 #define AUTOPROBE_ENABLE_ALL 1
826 #define AUTOPROBE_ENABLE_REGEX 2
827 static int autoprobe_method
= AUTOPROBE_DISABLED
;
828 static regex_t autoprobe_regex
;
830 static void auto_probe_connect(struct marker
*m
)
834 char* concat_name
= NULL
;
835 const char *probe_name
= "default";
837 if(autoprobe_method
== AUTOPROBE_DISABLED
) {
840 else if(autoprobe_method
== AUTOPROBE_ENABLE_REGEX
) {
841 result
= asprintf(&concat_name
, "%s/%s", m
->channel
, m
->name
);
843 ERR("auto_probe_connect: asprintf failed (marker %s/%s)",
844 m
->channel
, m
->name
);
847 if (regexec(&autoprobe_regex
, concat_name
, 0, NULL
, 0)) {
854 result
= ltt_marker_connect(m
->channel
, m
->name
, probe_name
);
855 if(result
&& result
!= -EEXIST
)
856 ERR("ltt_marker_connect (marker = %s/%s, errno = %d)", m
->channel
, m
->name
, -result
);
858 DBG("auto connected marker %s (addr: %p) %s to probe default", m
->channel
, m
, m
->name
);
862 static void __attribute__((constructor
)) init()
865 char* autoprobe_val
= NULL
;
867 /* Assign the pidunique, to be able to differentiate the processes with same
868 * pid, (before and after an exec).
870 pidunique
= make_pidunique();
872 /* Initialize RCU in case the constructor order is not good. */
875 /* It is important to do this before events start to be generated. */
876 ust_register_thread();
878 DBG("Tracectl constructor");
880 /* Must create socket before signal handler to prevent races.
882 result
= init_socket();
884 ERR("init_socket error");
890 autoprobe_val
= getenv("UST_AUTOPROBE");
892 struct marker_iter iter
;
894 DBG("Autoprobe enabled.");
896 /* Ensure markers are initialized */
899 /* Ensure marker control is initialized, for the probe */
900 init_marker_control();
902 /* first, set the callback that will connect the
903 * probe on new markers
905 if(autoprobe_val
[0] == '/') {
906 result
= regcomp(&autoprobe_regex
, autoprobe_val
+1, 0);
910 regerror(result
, &autoprobe_regex
, regexerr
, sizeof(regexerr
));
911 ERR("cannot parse regex %s (%s), will ignore UST_AUTOPROBE", autoprobe_val
, regexerr
);
912 /* don't crash the application just for this */
915 autoprobe_method
= AUTOPROBE_ENABLE_REGEX
;
919 /* just enable all instrumentation */
920 autoprobe_method
= AUTOPROBE_ENABLE_ALL
;
923 marker_set_new_marker_cb(auto_probe_connect
);
925 /* Now, connect the probes that were already registered. */
926 marker_iter_reset(&iter
);
927 marker_iter_start(&iter
);
929 DBG("now iterating on markers already registered");
931 DBG("now iterating on marker %s", iter
.marker
->name
);
932 auto_probe_connect(iter
.marker
);
933 marker_iter_next(&iter
);
937 if(getenv("UST_TRACE")) {
938 char trace_name
[] = "auto";
939 char trace_type
[] = "ustrelay";
941 DBG("starting early tracing");
943 /* Ensure marker control is initialized */
944 init_marker_control();
946 /* Ensure relay is initialized */
947 init_ustrelay_transport();
949 /* Ensure markers are initialized */
953 ltt_channels_register("ust");
955 result
= ltt_trace_setup(trace_name
);
957 ERR("ltt_trace_setup failed");
961 result
= ltt_trace_set_type(trace_name
, trace_type
);
963 ERR("ltt_trace_set_type failed");
967 result
= ltt_trace_alloc(trace_name
);
969 ERR("ltt_trace_alloc failed");
973 result
= ltt_trace_start(trace_name
);
975 ERR("ltt_trace_start failed");
979 /* Do this after the trace is started in order to avoid creating confusion
980 * if the trace fails to start. */
981 inform_consumer_daemon(trace_name
);
987 /* should decrementally destroy stuff if error */
991 /* This is only called if we terminate normally, not with an unhandled signal,
992 * so we cannot rely on it. However, for now, LTTV requires that the header of
993 * the last sub-buffer contain a valid end time for the trace. This is done
994 * automatically only when the trace is properly stopped.
996 * If the traced program crashed, it is always possible to manually add the
997 * right value in the header, or to open the trace in text mode.
999 * FIXME: Fix LTTV so it doesn't need this.
1002 static void destroy_traces(void)
1006 /* if trace running, finish it */
1008 DBG("destructor stopping traces");
1010 result
= ltt_trace_stop("auto");
1012 ERR("ltt_trace_stop error");
1015 result
= ltt_trace_destroy("auto");
1017 ERR("ltt_trace_destroy error");
1021 static int trace_recording(void)
1024 struct ltt_trace_struct
*trace
;
1028 list_for_each_entry(trace
, <t_traces
.head
, list
) {
1035 ltt_unlock_traces();
1041 static int have_consumer(void)
1043 return !list_empty(&blocked_consumers
);
1047 int restarting_usleep(useconds_t usecs
)
1053 tv
.tv_nsec
= usecs
* 1000;
1056 result
= nanosleep(&tv
, &tv
);
1057 } while(result
== -1 && errno
== EINTR
);
1062 /* This destructor keeps the process alive for a few seconds in order
1063 * to leave time to ustd to connect to its buffers. This is necessary
1064 * for programs whose execution is very short. It is also useful in all
1065 * programs when tracing is started close to the end of the program
1068 * FIXME: For now, this only works for the first trace created in a
1072 static void __attribute__((destructor
)) keepalive()
1074 if(trace_recording() && buffers_to_export
) {
1076 DBG("Keeping process alive for consumer daemon...");
1077 while(buffers_to_export
) {
1078 const int interv
= 200000;
1079 restarting_usleep(interv
);
1082 if(total
>= 3000000) {
1083 WARN("non-consumed buffers remaining after wait limit; not waiting anymore");
1087 DBG("Finally dying...");
1092 ustcomm_fini_app(&ustcomm_app
);
1095 void ust_potential_exec(void)
1097 trace_mark(ust
, potential_exec
, MARK_NOARGS
);
1104 /* Notify ust that there was a fork. This needs to be called inside
1105 * the new process, anytime a process whose memory is not shared with
1106 * the parent is created. If this function is not called, the events
1107 * of the new process will not be collected.
1112 struct blocked_consumer
*bc
;
1113 struct blocked_consumer
*deletable_bc
= NULL
;
1116 DBG("ust: forking");
1117 ltt_trace_stop("auto");
1118 ltt_trace_destroy("auto");
1119 /* Delete all active connections */
1120 ustcomm_close_all_connections(&ustcomm_app
.server
);
1122 /* Delete all blocked consumers */
1123 list_for_each_entry(bc
, &blocked_consumers
, list
) {
1124 close(bc
->fd_producer
);
1125 close(bc
->fd_consumer
);
1128 list_del(&bc
->list
);
1134 ltt_trace_setup("auto");
1135 result
= ltt_trace_set_type("auto", "ustrelay");
1137 ERR("ltt_trace_set_type failed");
1141 ltt_trace_alloc("auto");
1142 ltt_trace_start("auto");
1143 inform_consumer_daemon("auto");