Make sure to flush the stdout stream when exiting, before outputting the
end-of-run stats. This avoids output being interleaved because the stats
are written to stderr before stdout has finished flushing.
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
}
exit_pcap = NULL;
rc = true;
+ fflush(stdout);
fprintf(stderr, "\n%"PRIu64" packets captured\n", captured_packets);
if (pcap_stats(pcap, &ps) == 0) {
perf_buffer__consume(perf_buf);
#endif
+ fflush(stdout);
fprintf(stderr, "\n%"PRIu64" packets captured\n",
perf_ctx.captured_packets);
fprintf(stderr, "%"PRIu64" packets dropped by perf ring\n",