test/vfs_stress: prevent division by zero

Issue #3090
This commit is contained in:
Norman Feske 2018-12-19 10:49:59 +01:00
parent ca6ee2d91a
commit b7cb5839eb

View File

@ -569,9 +569,10 @@ void Component::construct(Genode::Env &env)
vfs_root_sync(); vfs_root_sync();
log("created ",count," empty directories, ", if (count > 0)
(elapsed_ms*1000)/count,"μs/op , ", log("created ",count," empty directories, ",
env.ram().used_ram().value/1024,"KiB consumed"); (elapsed_ms*1000)/count,"μs/op , ",
env.ram().used_ram().value/1024,"KiB consumed");
} }
@ -593,9 +594,10 @@ void Component::construct(Genode::Env &env)
vfs_root_sync(); vfs_root_sync();
log("created ",count," empty files, ", if (count > 0)
(elapsed_ms*1000)/count,"μs/op, ", log("created ",count," empty files, ",
env.ram().used_ram().value/1024,"KiB consumed"); (elapsed_ms*1000)/count,"μs/op, ",
env.ram().used_ram().value/1024,"KiB consumed");
} }
@ -624,9 +626,13 @@ void Component::construct(Genode::Env &env)
vfs_root_sync(); vfs_root_sync();
log("wrote ",count," bytes ", if (elapsed_ms > 0)
count/elapsed_ms,"kB/s, ", log("wrote ",count," bytes, ",
env.ram().used_ram().value/1024,"KiB consumed"); count/elapsed_ms,"kB/s, ",
env.ram().used_ram().value/1024,"KiB consumed");
else
log("wrote ",count," bytes, ",
env.ram().used_ram().value/1024,"KiB consumed");
} }
@ -655,9 +661,13 @@ void Component::construct(Genode::Env &env)
vfs_root_sync(); vfs_root_sync();
log("read ",count," bytes, ", if (elapsed_ms > 0)
count/elapsed_ms,"kB/s, ", log("read ",count," bytes, ",
env.ram().used_ram().value/1024,"KiB consumed"); count/elapsed_ms,"kB/s, ",
env.ram().used_ram().value/1024,"KiB consumed");
else
log("read ",count," bytes, ",
env.ram().used_ram().value/1024,"KiB consumed");
} }