… | |
… | |
53 | |
53 | |
54 | IO::AIO::poll_cb; |
54 | IO::AIO::poll_cb; |
55 | |
55 | |
56 | if ($opt_progress and $n_last + 1 < Time::HiRes::time) { |
56 | if ($opt_progress and $n_last + 1 < Time::HiRes::time) { |
57 | $n_last = Time::HiRes::time; |
57 | $n_last = Time::HiRes::time; |
58 | printf STDERR "\r%d dirs %d files %d stats %g stats/s ", $n_dirs, $n_files, $n_stats, $n_stats / ($n_last - $n_start) |
58 | my $d = $n_last - $n_start; |
|
|
59 | printf STDERR "\r%d dirs (%g/s) %d files (%g/s) %d stats (%g/s) ", |
|
|
60 | $n_dirs, $n_dirs / $d, |
|
|
61 | $n_files, $n_files / $d, |
|
|
62 | $n_stats, $n_stats / $d |
59 | if $opt_progress; |
63 | if $opt_progress; |
60 | } |
64 | } |
61 | |
65 | |
62 | aioreq_pri -1; |
66 | aioreq_pri -1; |
63 | ++$n_dirs; |
67 | ++$n_dirs; |
… | |
… | |
86 | IO::AIO::max_outstanding 100; # two fds per directory, so limit accordingly |
90 | IO::AIO::max_outstanding 100; # two fds per directory, so limit accordingly |
87 | IO::AIO::min_parallel 20; |
91 | IO::AIO::min_parallel 20; |
88 | |
92 | |
89 | for my $seed (@ARGV) { |
93 | for my $seed (@ARGV) { |
90 | $seed =~ s/\/+$//; |
94 | $seed =~ s/\/+$//; |
91 | ++$n_stats; |
|
|
92 | aio_lstat "$seed/.", sub { |
95 | aio_lstat "$seed/.", sub { |
93 | if ($_[0]) { |
96 | if ($_[0]) { |
94 | print STDERR "$seed: $!\n"; |
97 | print STDERR "$seed: $!\n"; |
95 | } elsif (-d _) { |
98 | } elsif (-d _) { |
96 | scan $seed; |
99 | scan $seed; |