Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys/shell/vfs: make output of vfs df human readable #18550

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Sep 4, 2022

Contribution description

Currently vfs df outputs size as filesystem blocks. It is not clear how big a filesystem block is, so the output is hard to interpret.

Instead, output the sizes in Bytes like df -h.

Testing procedure

Run e.g. examples/filesystem:

2022-09-04 12:46:51,962 # > vfs df
2022-09-04 12:46:51,967 # Mountpoint              Total         Used    Available     Capacity
2022-09-04 12:46:51,973 # /sd0                   15223M      129912k    15458440k       0%
2022-09-04 12:46:52,006 # /nvm0                     32M         220k       32548k       0%
2022-09-04 12:46:52,011 # /const                     27           27            0     100%

Issues/PRs references

@github-actions github-actions bot added the Area: sys Area: System label Sep 4, 2022
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 4, 2022
Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Since you are touching the code anyway: Care to replace "Capacity" in the table header by something more sensible? E.g. when capacity is at 100%, I would assume an empty file storage. I think df is showing Use% there, if I recall correctly

sys/shell/commands/sc_vfs.c Outdated Show resolved Hide resolved
sys/shell/commands/sc_vfs.c Outdated Show resolved Hide resolved
sys/shell/commands/sc_vfs.c Outdated Show resolved Hide resolved
sys/shell/commands/sc_vfs.c Show resolved Hide resolved
sys/shell/commands/sc_vfs.c Show resolved Hide resolved
@benpicco
Copy link
Contributor Author

benpicco commented Sep 7, 2022

Looks like this now

2022-09-07 22:09:16,902 # Mountpoint              Total         Used    Available     Use%
2022-09-07 22:09:16,908 # /sd0                15223 MiB   131288 kiB 15457064 kiB       0%
2022-09-07 22:09:16,940 # /nvm0                  32 MiB      220 kiB    32548 kiB       0%
2022-09-07 22:09:16,946 # /const                   27 B         27 B          0 B     100%

Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx :)

sys/shell/commands/sc_vfs.c Outdated Show resolved Hide resolved
@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 8, 2022
@maribu maribu merged commit 1066195 into RIOT-OS:master Sep 8, 2022
@benpicco benpicco deleted the sc_vfs-human branch September 9, 2022 00:15
@maribu maribu added this to the Release 2022.10 milestone Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants