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

Implement support for FreeBSD #766

Merged
merged 10 commits into from
Jul 24, 2022
Merged

Conversation

wezm
Copy link
Contributor

@wezm wezm commented Jul 16, 2022

Description

Adds support for running bottom on FreeBSD.

Screenshot from 2022-07-16 12-54-40

wmoore@freebsd13:~ $ freebsd-version; uname -a
13.1-RELEASE
FreeBSD freebsd13 13.1-RELEASE FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC amd64

Notes

  • The implementation was achieved though a mix of using sysinfo and some FreeBSD specific code.
  • I/O read/write stats are not implemented as I don't believe sysinfo makes this information available at this time.
  • The commit history is pretty messy but it shows the process I went though. I would recommend squash merging it, or if preferred I can squash all the commits myself.
  • A new dependency on serde_json is added for FreeBSD targets as this code makes use of the ability for some commands in the FreeBSD base system to emit machine readable output in JSON via the libxo library.

Issue

Closes: #480

Testing

I ran this branch of the code on FreeBSD (amd64) and Linux (x86_64). I Checked that it compiles for x86_64 macOS (cargo check --target x86_64-apple-darwin). I have not tested Windows as I do not use it.

  • Windows
  • macOS
  • Linux
  • FreeBSD

Checklist

If relevant, ensure the following have been met:

  • Areas your change affects have been linted using rustfmt (cargo fmt)
  • The change has been tested and doesn't appear to cause any unintended breakage
  • Documentation has been added/updated if needed (README.md, help menu, etc.)
  • The pull request passes the provided CI pipeline
  • There are no merge conflicts

@codecov-commenter
Copy link

Codecov Report

Merging #766 (9f2f8fd) into master (e33603d) will decrease coverage by 0.14%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #766      +/-   ##
==========================================
- Coverage   24.26%   24.12%   -0.15%     
==========================================
  Files          57       60       +3     
  Lines       12907    12982      +75     
==========================================
  Hits         3132     3132              
- Misses       9775     9850      +75     
Impacted Files Coverage Δ
src/app.rs 0.04% <ø> (ø)
src/app/data_harvester.rs 0.00% <0.00%> (ø)
src/app/data_harvester/cpu.rs 0.00% <0.00%> (ø)
src/app/data_harvester/cpu/heim.rs 0.00% <ø> (ø)
src/app/data_harvester/disks.rs 0.00% <0.00%> (ø)
src/app/data_harvester/disks/heim.rs 0.00% <ø> (ø)
src/app/data_harvester/memory/general.rs 100.00% <ø> (+99.12%) ⬆️
src/app/data_harvester/memory/general/heim.rs 0.00% <0.00%> (ø)
src/app/data_harvester/network.rs 20.00% <ø> (ø)
src/app/data_harvester/processes.rs 0.00% <ø> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e33603d...9f2f8fd. Read the comment docs.

@ClementTsang
Copy link
Owner

ClementTsang commented Jul 24, 2022

Finally got some time to look at it, looks good to me. I tested compilation/running on Windows and it works fine too.

I'll add CI for testing/building FreeBSD in a separate PR when I have some time.

Repository owner deleted a comment from allcontributors bot Jul 24, 2022
@ClementTsang ClementTsang merged commit 577fda9 into ClementTsang:master Jul 24, 2022
@ClementTsang
Copy link
Owner

@all-contributors please add @wezm for code

@allcontributors
Copy link
Contributor

@ClementTsang

I've put up a pull request to add @wezm! 🎉

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.

FreeBSD support
3 participants