+ while (!quit) {
+ reload_trace = 0;
+ live_consume(&bt_ctx);
+ iter_trace(bt_ctx);
+ ret = bt_context_remove_trace(bt_ctx, 0);
+ if (ret != 0)
+ fprintf(stderr, "error removing trace\n");
+ if (bt_ctx) {
+ bt_context_put(bt_ctx);
+ }
+
+ /*
+ * since we receive all FDs every time there is an
+ * update and the FD number is different every time,
+ * we don't know which one are valid.
+ * so we check if all FDs are usable with a simple
+ * ioctl call.
+ */
+ bt_list_for_each_entry(mmap_info, &mmap_list.head, list) {
+ ret = helper_kernctl_get_mmap_len(mmap_info->fd, &mmap_len);
+ if (ret != 0) {
+ ret = errno;
+ bt_list_del(&mmap_info->list);
+ }
+ }
+ sem_post(&metadata_available);
+ }