+ goto metadata_error;
+ }
+
+ /* Create thread to manage the polling/writing of trace data */
+ ret = pthread_create(&data_thread, NULL, consumer_thread_data_poll,
+ (void *) ctx);
+ if (ret != 0) {
+ perror("pthread_create");
+ goto data_error;
+ }
+
+ /* Create the thread to manage the receive of fd */
+ ret = pthread_create(&sessiond_thread, NULL, consumer_thread_sessiond_poll,
+ (void *) ctx);
+ if (ret != 0) {
+ perror("pthread_create");
+ goto sessiond_error;
+ }
+
+ /*
+ * Create the thread to manage the UST metadata periodic timer and
+ * live timer.
+ */
+ ret = pthread_create(&metadata_timer_thread, NULL,
+ consumer_timer_thread, (void *) ctx);
+ if (ret != 0) {
+ perror("pthread_create");
+ goto metadata_timer_error;
+ }
+
+ ret = pthread_detach(metadata_timer_thread);
+ if (ret) {
+ errno = ret;
+ perror("pthread_detach");
+ }
+
+metadata_timer_error:
+ ret = pthread_join(sessiond_thread, &status);
+ if (ret != 0) {
+ perror("pthread_join");