aboutsummaryrefslogtreecommitdiff
path: root/tests/mtd-tests/flash_speed.c
AgeCommit message (Collapse)Author
2023-08-24Remove unused symbolsDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-05-30mtd-utils: Add new syntax to get devices by nameBrandon Maier
This introduces a new feature to the MTD command line utilities that allows MTD devices to be referenced by name instead of device node. For example this looks like: > # Display info for the MTD device with name "data" > mtdinfo mtd:data > # Copy file to MTD device with name "data" > flashcp /my/file mtd:data This follows the syntax supported by the kernel which allows MTD device's to be mounted by name[1]. Add the function mtd_find_dev_node() that accepts an MTD "identifier" and returns the MTD's device node. The function accepts a string starting with "mtd:" which it treats as the MTD's name. It then attempts to search for the MTD, and if found maps it back to the /dev/mtdX device node. If the string does not start with "mtd:", then assume it's the old style and refers directly to a MTD device node. The function is then hooked into existing tools like flashcp, mtdinfo, flash_unlock, etc. To load in the new MTD parsing code in a consistent way across programs. [1] http://www.linux-mtd.infradead.org/faq/jffs2.html#L_mtdblock Signed-off-by: Brandon Maier <brandon.maier@collins.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-18mtd-utils: flash_speed: Measure read while write latencyMiquel Raynal
The Read While Write (RWW) feature allows to perform reads from the flash array into cache while a program (from cache) or an erase operation happens, provided that the two areas are located on different banks. The main benefit is the possible reduced latency when requesting to read a page while a much longer operation is ongoing, like a write or an erase. We can try to compare the positive impact of such a feature by enhancing the flash_speed test tool with the following test: - Measure the time taken by an eraseblock write in parallel with an eraseblock read. - Measure when the read operation ends. - Compare the two to get the latency saved with the RWW feature. To be sure the mtd_write actually starts (and acquires the necessary locks) before the mtd_read does, we use SCHED_FIFO at rather high (arbitrary) priorities, respectively 42 and 41. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2022-11-18mtd-utils: flash_speed: Rework the time counting helpersMiquel Raynal
In order to be able to have interleaved measures, let's not use the start and finish global variables from the time helpers directly, provide parameters for these variables so that we can provide either the global entries, or more specific ones when relevant. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2021-10-13mtd-tests: Read and write pages during speed testsMiquel Raynal
The speed test does reads and writes of different sizes: - eraseblock - page - two pages At least this is the theory because, as opposed to the legacy kernel module doing the same measurement, the userspace tool uses the subpage size (hence accessing the same page 4, 8 or 16 times depending on the subpage setting). Of course if the controller does not support subpages, this issue is not visible. Use mtd.min_io_size instead for non-NOR devices in order to get the right bandwidth (at least one that fits the logs). Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2017-11-02Add no-return attribute to usage() style functionsDavid Oberhollenzer
A common pattern in command line processing is having a usage() function that prints out how to use the command line options and then terminates. The function is typically used inside a switch block for command line options like `-h' or unknown options. In a lot of places, the break keyword is omitted, because the function exits anyway. However, this triggers gcc warnings about implicit fall-through. Rather than adding a phony "/* fall-through */" this patch flags the usage() style function with a gcc attribute, indicating that they do not return and removes further superfluous break statements. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2016-11-17mtd-utils: Add flash speed test utilityDavid Oberhollenzer
Basically a user space port of the mtd speed test kernel module. In addition to the block offset and count module parameters, the utility supports a block stride and can restore the block contents after test. Furthermore, a flag can be used to disable destructive tests (i.e. only perform read speed tests). Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at> Signed-off-by: Richard Weinberger <richard@nod.at>