- ltt_lock_traces();
-
- trace = _ltt_trace_find(trace_name);
- if(trace == NULL) {
- WARN("inform_consumer_daemon: could not find trace \"%s\"; it is probably already destroyed", trace_name);
- goto finish;
- }
-
- for(i=0; i < trace->nr_channels; i++) {
- /* iterate on all cpus */
- for(j=0; j<trace->channels[i].n_cpus; j++) {
- char *buf;
- asprintf(&buf, "%s_%d", trace->channels[i].channel_name, j);
- result = ustcomm_request_consumer(pid, buf);
- if(result == -1) {
- WARN("Failed to request collection for channel %s. Is the daemon available?", trace->channels[i].channel_name);
- /* continue even if fail */
- }
- free(buf);
- buffers_to_export++;
- }
- }
-
- finish:
- ltt_unlock_traces();
-}
-
-void process_blocked_consumers(void)
-{
- int n_fds = 0;
- struct pollfd *fds;
- struct blocked_consumer *bc;
- int idx = 0;
- char inbuf;
- int result;
-
- list_for_each_entry(bc, &blocked_consumers, list) {
- n_fds++;
- }
-
- fds = (struct pollfd *) malloc(n_fds * sizeof(struct pollfd));
- if(fds == NULL) {
- ERR("malloc returned NULL");
- return;
- }
-
- list_for_each_entry(bc, &blocked_consumers, list) {
- fds[idx].fd = bc->fd_producer;
- fds[idx].events = POLLIN;
- bc->tmp_poll_idx = idx;
- idx++;
- }
-
- while((result = poll(fds, n_fds, 0)) == -1 && errno == EINTR)
- /* nothing */;
- if(result == -1) {
- PERROR("poll");