Re:Raspberry Pi microSD card performance comparison
by michaelt on Saturday April 07, 2018 @03:25AM
(#16779782)
How does one tap all the reads and writes to a card?
[ Parent
| on HN ]
Re:Raspberry Pi microSD card performance comparison
by hazeii on Saturday April 07, 2018 @05:00AM
(#16779991)
Just intercept the read and write calls! On linux you can just use 'strace $prog'; try it on a minimsal program that reads and writes a file. For a custom approach, this can be done with a library (using LD_PRELOAD). Plenty of articles about how to do this, e.g. http://www.linuxjournal.com/node/7795 (essentially the same technique on Windows, or other OS with shared libs). Slightly more hardcore is to hook the kernel syscalls; not normally necessary (on linux this is effectively hooking the other side of glibc, where it talks to the kernel) but if all you've got a static binary it's one approach.
Note that all these techniques only show you the read and write calls made to the library/OS and - importantly - not what actually happens to the card. To see that, the next level down is to instrument the card driver to track the actual I/O operations (i.e. so you see what the card is really being asked to do, sans all the caching and buffering).
Note that's not the end of the story; there's what the hardware controller decides to do and when the hardware actually reads/writes the flash array. That's the level where the quality of the firmware in the controller(s) matters.
Re:Raspberry Pi microSD card performance comparison
by monocasa on Saturday April 07, 2018 @01:50PM
(#16781791)
I suspected the filesystem driver itself, so I had to modify the driver rather than strace (also this was WinCE quite unfortunately).
Re:Raspberry Pi microSD card performance comparison
by michaelt on Saturday April 07, 2018 @11:07AM
(#16781037)
Doesn't that mean you then have to write an event to disk for every write-to-disk event?
Re:Raspberry Pi microSD card performance comparison
by sowbug on Saturday April 07, 2018 @11:30AM
(#16781154)
I would log by RPC or whatever to a remote computer.
Re:Raspberry Pi microSD card performance comparison
by monocasa on Saturday April 07, 2018 @01:48PM
(#16781776)
Modify the SD card driver to open a socket to a computer in the lab, and just log it's commands and responses over TCP with timestamps. The network was orders of magnitude faster than the crappy SDIO interface, so it was easy this time. I've had to do a similar thing with SAS, and you basically just have to pay tens of thousands for a special purpose protocol analyzer, or build your own with an FPGA.