[U-Boot] [PATCH] common/cmd_ext_common: measure throughput

Andreas Bießmann
2012-10-17T10:16:14Z

Dear Wolfgang Denk,

On 17.10.2012 12:05, Wolfgang Denk wrote:
> Dear Andreas Bie?mann,
>
> In message <1350467910-2014-1-git-send-email-andreas.devel@googlemail.com> you wrote:
>> This patch adds time measurement and throughput calculation for the ext2load and
>> ext4load commands.
> ...
>> + unsigned long time_start;
> ...
>> + time_start = get_timer(0);
>> if (ext4fs_read((char *)addr, filelen) != filelen) {
>> printf("** Unable to read \"%s\" from %s %d:%d **\n",
>> filename, argv[1], dev, part);
>> ext4fs_close();
>> goto fail;
>> }
>> + time_start = get_timer(time_start);
>
> There, "time_start" is clearly a mis-nomer. How about
> s/time_start/time/ ?

sounds better, however this is a plane copy from Simons tftp measurement
patch.

>> + print_size(filelen / time_start * 1000, "/s");
>
> Does this give reasonable results for small files, say when loading a
> 20 byte file ?

Well, possible no:

---8<---
U-Boot> ext2load mmc 0 10020000 /etc/hosts
Loading file "/etc/hosts" from mmc device 0:1
20 bytes read in 0 ms
U-Boot> ext2load mmc 0 10020000 /etc/shadow
Loading file "/etc/shadow" from mmc device 0:1
95 bytes read in 0 ms
U-Boot> ext2load mmc 0 10020000 /etc/passwd
Loading file "/etc/passwd" from mmc device 0:1
366 bytes read in 0 ms
U-Boot> ext2load mmc 0 10020000 /etc/services
Loading file "/etc/services" from mmc device 0:1
18465 bytes read in 3 ms (5.9 MiB/s)
U-Boot>
--->8---

But as you see extremely short transfers are omitted due to time
difference of '0' (at least on my avr32 system here).
The main aim for this patch was to measure performance gain of Josh Wu's
gen_atmel_mci patch for multiple block access, hopefully this is useful
for others.
I would like to have some feedback how the measurement is for very small
files on other systems. Then I could provide a v2 which uses another
variable name for the time.

Best regards

Andreas Bie?mann