-
Notifications
You must be signed in to change notification settings - Fork 3
Description
I've been trying to play with uruntime
in combination with some new DwarFS features and I'm trying to figure out the best way get debug output from the DwarFS FUSE driver.
Essentially, what I've done:
- cloned the
uruntime
repo - checked that
cargo xtask appimage-dwarfs-x86_64
works - replaced
assets/dwarfs-universal-upx
with my new binary - applied the following changes:
diff --git a/src/main.rs b/src/main.rs
index 22e8bbb..6ac33c3 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -435,10 +435,10 @@ fn mount_image(embed: &Embed, image: &Image, mount_dir: PathBuf) {
{
embed.dwarfs(vec!["-f".into(),
"-o".into(), "ro,nodev,noatime,clone_fd".into(),
- "-o".into(), "cache_files,no_cache_image".into(),
+ "-o".into(), "cache_files,no_cache_image,preload_category=hotness".into(),
"-o".into(), format!("cachesize={}", get_dwfs_cachesize()),
"-o".into(), format!("blocksize={}", get_dwfs_blocksize()),
- "-o".into(), "tidy_strategy=time,tidy_interval=500ms,tidy_max_age=1s".into(),
+ "-o".into(), "tidy_strategy=time,tidy_interval=5s,tidy_max_age=10s".into(),
"-o".into(), format!("workers={}", get_dwfs_workers()),
"-o".into(), format!("uid={uid},gid={gid}"),
"-o".into(), format!("offset={}", image.offset),
(Side note: I think the tidy_interval
/tidy_max_age
defaults are too short)
- rebuilt with
cargo xtask appimage-dwarfs-x86_64
- I assumed (I didn't find any documentation) that I can build an
AppImage
by just doing:
$ cat ~/git/github/uruntime/dist/uruntime-appimage-dwarfs-x86_64 libre-hot-new.dwarfs >libre-hot-new-dwarfs.AppImage
$ chmod a+x libre-hot-new-dwarfs.AppImage
Interestingly, according to the benchmark-startup
script, this actually starts the application (LibreOffice) significantly faster than the original AppImage:
$ ./benchmark-startup ./LibreOffice-25.2.full-x86_64.AppImage LibreOffice
Time taken: 1238 milliseconds
$ ./benchmark-startup ./libre-hot-new-dwarfs.AppImage LibreOffice
Time taken: 945 milliseconds
However: After the benchmark script finishes, it still takes a significant amount of time for the LibreOffice window to appear, and that time feels a lot longer than with the original (non-dwarfs) AppImage. Also, if I manually mount the DwarFS image and then run the benchmark:
$ ~/git/github/dwarfs/build-clang/dwarfs libre-hot-new.dwarfs mnt -opreload_category=hotness,debuglevel=verbose
$ ./benchmark-startup mnt/AppRun LibreOffice
Time taken: 889 milliseconds
I see a reasonable startup time and don't see the same long wait time before the window appears.
Maybe you can already tell from the above commands that I've done something silly. :)
I'd find it extremely helpful if there was something like a "foreground mode", similar to the -f
flag of the FUSE driver, where I could see the log output of dwarfs
. Is there something like this that I just didn't see?