Factor out print_io_stats