JonMagon / KDiskMark

A simple open-source disk benchmark tool for Linux distros

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android Support

mokurin000 opened this issue · comments

As far as I know, Qt supports Android natively

execute fio

To call binary on TargetSdk >= 29, Android 10, we need call JNI to get our library path, then execute [lib_path]/libfio.so e.g.
This is a future-proof method12. by one line of java3,

getContext().getApplicationInfo().nativeLibraryDir;

First, in AndroidManifest.xml:

android:extractNativeLibs = "true"

(This is already set by Qt I think)

Then, in lib/ARCH/, we place libfio.so

fio for android can be build with either NDK-clang or musl

But this means we need to repackage KDiskMark when updates it's fio binary, and users may not update/select their fio executable. With TargetSdk set to 28 (like termux), everything will be easy and great

performance issues

Additionally, after SDCardFS deprecation, I/O performance on android is largely degraded.
FUSE Passthrough, which was introduced in Android 12, is yet experimental on 5.4+ android common kernel
KDiskMark should optionally requires root to avoid multilayer buffering

Lastly, neither posixaio, nor libaio or io_uring is avaliable on Android.
posixaio: not provided by bionic, musl implements this though, thread-pool based I/O is certainly behaves poor
libaio: no upstream android support, existing android ports are unmaintained
io_uring: disabled by Google for Security reason4

By the way, the test files should be placed under KDiskMark app home, as the internal storage may not support the O_DIRECT flag

Footnotes

  1. https://stackoverflow.com/a/62730836

  2. https://stackoverflow.com/a/58748468

  3. https://stackoverflow.com/a/16806802

  4. https://www.phoronix.com/news/Google-Restricting-IO_uring