struct stat sb;
unsigned int ready;
- wait_for_data(tip, -1);
+ wait_for_data(tip, 250);
if (fstat(tip->fd, &sb) < 0) {
perror("trace stat");
return -1;
}
+
ready = sb.st_size - tip->data_queued;
if (!ready) {
usleep(1000);
struct device_information *dip;
struct thread_information *tip;
- nc->ncpus = bnh->max_cpus;
dip = net_get_dip(nc, bnh->buts_name, bnh->cl_id);
if (!dip->trace_started) {
fprintf(stderr, "Events for closed devices %s\n", dip->buts_name);
return NULL;
}
-/*
- * finalize a net client: truncate files, show stats, cleanup, etc
- */
static void net_client_host_done(struct cl_host *ch)
{
free(ch->device_information);
if (!data_is_native) {
bnh.magic = be32_to_cpu(bnh.magic);
bnh.cpu = be32_to_cpu(bnh.cpu);
+ bnh.max_cpus = be32_to_cpu(bnh.max_cpus);
bnh.len = be32_to_cpu(bnh.len);
bnh.cl_id = be32_to_cpu(bnh.cl_id);
}
return 1;
}
+ if (nc->ncpus == -1)
+ nc->ncpus = bnh.max_cpus;
+
/*
* len == 0 means that the other end signalled end-of-run
*/
dip->trace_started = 0;
printf("server: end of run for %s\n", dip->buts_name);
+
device_done(nc, dip);
if (++nc->ch->ndevs_done == nc->ch->ndevs)
net_client_host_done(nc->ch);
+
return 0;
}
time(&nc->connect_time);
nc->ch = ch;
nc->in_fd = in_fd;
+ nc->ncpus = -1;
net_connects++;
}