On Saturday 05 March 2011 00:55:29 Philippe De Muyter wrote:
I have read with interest your article in lwn, and decided to try your flashbench program to discover the characteristics of the CF card we use.
Unfortunately,
./flashbench -a -b 1K /dev/sdb
fails with endless :
time_read: Invalid argument
Looking with strace, I get e.g.:
pread64(3, 0xb3728000, 1, 1023410175) = -1 EINVAL (Invalid argument)
Is that a behavior you can explain (and fix) ?
Yes, there are two known problems that I need to fix:
1. flashbench uses O_DIRECT for talking to the device, which means that all accesses must be on multiples of full sectors based on the underlying device sector size. It should detect this
2. command line arguments currently need to be natural numbers. There is no parser for interpreting arguments like 1K or 4M as kilobytes and megabytes.
It should work when you do
./flashbench -a -b 1024 /dev/sdb
Arnd