Skip to content

[sd_bench|sd_stress]: Compatible Sd Test Printing#2431

Merged
xiaoxiang781216 merged 1 commit intoapache:masterfrom
TE-7000026184:compatible-sd-test
Jul 4, 2024
Merged

[sd_bench|sd_stress]: Compatible Sd Test Printing#2431
xiaoxiang781216 merged 1 commit intoapache:masterfrom
TE-7000026184:compatible-sd-test

Conversation

@TE-7000026184
Copy link
Copy Markdown
Contributor

@TE-7000026184 TE-7000026184 commented Jul 3, 2024

Title

testing/[sd_bench|sd_stress]: Make Printing Compatible for Both 32-bit and 64-bit Environments.

Summary

Currently, on 64-bit environment, for example, qemu-armv8a, compilation of sd_bench and sd_stress are broken due to type errors.

testing/sd_bench/sd_bench_main.c:
testing/sd_stress/sd_stress_main.c: size_t type should be printed with %zu instead of %u.

Impact

Bugs fixed.

Testing

Verify compilation with:

  • 32-bit environment configuration: esp32s3-devkit:smp
  • 64-bit environment configuration: qemu-armv8a:netnsh

Run sdstress and sdbench test in virtual environment:

qemu-system-aarch64 \
-cpu cortex-a53 \
-smp 4 \
-nographic \
-machine virt,virtualization=on,gic-version=3 \
-chardev stdio,id=con,mux=on \
-serial chardev:con \
-global virtio-mmio.force-legacy=false \
-netdev user,id=u1,hostfwd=tcp:127.0.0.1:10023-10.0.2.15:23,hostfwd=tcp:127.0.0.1:15001-10.0.2.15:5001 \
-device virtio-net-device,netdev=u1,bus=virtio-mmio-bus.0 \
-drive file=/home/windrow/code/nuttx/2GB.img,format=raw,id=hd,if=none \
-device virtio-blk-device,bus=virtio-mmio-bus.1,drive=hd \
-mon chardev=con,mode=readline \
-kernel \
./nuttx

NuttShell (NSH)
nsh> 
nsh> mount -t vfat /dev/virtblk0 /mnt
nsh> sdstress
Start stress test with 64 files, 4096 bytes and 32 iterations.
iteration 0 took 190.000 ms: OK
iteration 1 took 190.000 ms: OK
iteration 2 took 180.000 ms: OK
iteration 3 took 180.000 ms: OK
iteration 4 took 170.000 ms: OK
iteration 5 took 180.000 ms: OK
iteration 6 took 190.000 ms: OK
iteration 7 took 180.000 ms: OK
iteration 8 took 180.000 ms: OK
iteration 9 took 170.000 ms: OK
iteration 10 took 170.000 ms: OK
iteration 11 took 180.000 ms: OK
iteration 12 took 180.000 ms: OK
iteration 13 took 180.000 ms: OK
iteration 14 took 170.000 ms: OK
iteration 15 took 180.000 ms: OK
iteration 16 took 180.000 ms: OK
iteration 17 took 200.000 ms: OK
iteration 18 took 180.000 ms: OK
iteration 19 took 170.000 ms: OK
iteration 20 took 180.000 ms: OK
iteration 21 took 170.000 ms: OK
iteration 22 took 180.000 ms: OK
iteration 23 took 170.000 ms: OK
iteration 24 took 170.000 ms: OK
iteration 25 took 180.000 ms: OK
iteration 26 took 170.000 ms: OK
iteration 27 took 170.000 ms: OK
iteration 28 took 180.000 ms: OK
iteration 29 took 170.000 ms: OK
iteration 30 took 170.000 ms: OK
iteration 31 took 170.000 ms: OK
Test OK: Average time: 177.500 ms
nsh> sdbench -k
Using block size = 512 bytes, sync = false

Testing Sequential Write Speed...
  Run  1:   2263.8 KB/s, max write time: 10.000 ms (50.0 KB/s), fsync: 0.000 ms
  Run  2:   2275.8 KB/s, max write time: 10.000 ms (50.0 KB/s), fsync: 0.000 ms
  Run  3:   2268.5 KB/s, max write time: 20.000 ms (25.0 KB/s), fsync: 0.000 ms
  Run  4:   2274.3 KB/s, max write time: 10.000 ms (50.0 KB/s), fsync: 0.000 ms
  Run  5:   2279.3 KB/s, max write time: 10.000 ms (50.0 KB/s), fsync: 0.000 ms
  Avg   :   2272.3 KB/s, 22.190 MB written.

Testing Sequential Read Speed...
  Run  1:  40576.8 KB/s, max read/verify time: 10.0000 ms (50.0 KB/s)
  Avg   :  40576.8 KB/s, 22.190 MB and verified
nsh> mount -t vfat /dev/virtblk0 /mnt
nsh> sdbench -b 2
Using block size = 8 bytes, sync = false

Testing Sequential Write Speed...
  Run  1:   1356.3 KB/s, max write time: 10.000 ms (0.8 KB/s), fsync: 0.000 ms
  Run  2:   1186.4 KB/s, max write time: 20.000 ms (0.4 KB/s), fsync: 0.000 ms
  Run  3:   1281.3 KB/s, max write time: 10.000 ms (0.8 KB/s), fsync: 0.000 ms
  Run  4:   1291.0 KB/s, max write time: 20.000 ms (0.4 KB/s), fsync: 0.000 ms
  Run  5:   1298.0 KB/s, max write time: 10.000 ms (0.8 KB/s), fsync: 0.000 ms
  Avg   :   1282.6 KB/s, 12.525 MB written.

Testing Sequential Read Speed...
  Run  1:  11555.0 KB/s, max read/verify time: 10.0000 ms (0.8 KB/s)
  Avg   :  11555.0 KB/s, 12.525 MB and verified

@TE-7000026184
Copy link
Copy Markdown
Contributor Author

@JackyCaoYJ

@TE-7000026184 TE-7000026184 reopened this Jul 3, 2024
@TE-7000026184 TE-7000026184 marked this pull request as draft July 3, 2024 07:55
@davids5 davids5 changed the title Compatible Sd Test Printing [sd_bench|sd_stress]: Compatible Sd Test Printing Jul 3, 2024
…nd 64-bit environment.

Use size_t and %zu in printf of sd modules to fix compilation errors in 64-bit environment.

Signed-off-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Jacky Cao <Jacky.Cao@sony.com>
Tested-by: Yinzhe Wu <Yinzhe.Wu@sony.com>
@TE-7000026184 TE-7000026184 marked this pull request as ready for review July 4, 2024 03:03
@xiaoxiang781216 xiaoxiang781216 merged commit 0989d82 into apache:master Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants