The package rpms/rust-below.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/rust-below.git/commit/?id=bd287ce....
Change:
+ExclusiveArch: %{rust_arches}
Thanks.
Full change:
============
commit aee46c8afccf2b16eb33b1e36a514b145e1187d3
Author: Davide Cavalca <dcavalca(a)fedoraproject.org>
Date: Mon Jun 28 13:34:54 2021 -0700
Add a few missing things
- Install upstream systemd unit
- Install upstream logrotate config
- Add missing documentation
- Expand the description
diff --git a/README-upstream.md b/README-upstream.md
new file mode 100644
index 0000000..2daa1c2
--- /dev/null
+++ b/README-upstream.md
@@ -0,0 +1,76 @@
+# below
+
+[![CI](https://github.com/facebookincubator/below/workflows/CI/badge.svg)](https://github.com/facebookincubator/below/actions?query=workflow%3ACI+branch%3Amaster+)
+[![Matrix
chat](https://img.shields.io/matrix/below:matrix.org)](https://matrix.to/#/!SrWxtbLuRUMrDbftgA:matrix.org?via=matrix.org)
+
+`below` is an interactive tool to view and record historical system data. It
+has support for:
+
+* information regarding hardware resource utilization
+* viewing the cgroup hierarchy
+* cgroup and process information
+* pressure stall information (PSI)
+* `record` mode to record system data
+* `replay` mode to replay historical system data
+* `live` mode to view live system data
+* `dump` subcommand to report script-friendly information (eg JSON and CSV)
+
+below does **not** have support for cgroup1.
+
+The name "below" stems from the fact that the below developers rejected many
+of [
atop](https://linux.die.net/man/1/atop)'s design and style decisions.
+
+## Demo
+
+<a
href="https://asciinema.org/a/355506">
+<img
src="https://asciinema.org/a/355506.svg" width="500">
+</a>
+
+## Installing
+
+First, install dependencies listed in [building.md](docs/building.md).
+
+```shell
+$ cargo install below
+$ below --help
+```
+
+For convenience, we also provide a Dockerfile and
+[pre-built
images](https://hub.docker.com/r/below/below) on Docker Hub.
+See [docker.md](docs/docker.md) for how to use them.
+
+## Quickstart
+
+Live view of system:
+
+```shell
+$ sudo below live
+```
+
+Run recording daemon:
+
+```shell
+$ sudo cp ~/.cargo/bin/below /bin/below # if using cargo-install
+$ sudo cp resctl/below/etc/below.service /etc/systemd/system
+$ sudo systemctl daemon-reload
+$ sudo systemctl start below
+```
+
+Replay historical data:
+
+```shell
+$ below replay -t "3m ago"
+```
+
+## Comparison with alternative tools
+
+See [comparison.md](docs/comparison.md) for a feature comparison
+with alternative tools.
+
+## Contributing
+
+See the [CONTRIBUTING](CONTRIBUTING.md) file for how to help out.
+
+## License
+
+See [LICENSE](LICENSE) file.
diff --git a/below.service b/below.service
new file mode 100644
index 0000000..6ef4b40
--- /dev/null
+++ b/below.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=below system monitor recording daemon
+After=time-sync.target
+
+[Service]
+ExecStart=/bin/below record --retain-for-s 604800
+# Enable backtraces in errors
+Environment=RUST_LIB_BACKTRACE=1
+Restart=always
+RestartSec=3
+
+[Install]
+WantedBy=multi-user.target
diff --git a/logrotate.conf b/logrotate.conf
new file mode 100644
index 0000000..90bfe05
--- /dev/null
+++ b/logrotate.conf
@@ -0,0 +1,11 @@
+/var/log/below/error_*.log {
+ daily
+ rotate 14
+ maxage 14
+ copytruncate
+ compress
+ notifempty
+ missingok
+ create 0644 root root
+ su root root
+}
diff --git a/rust-below.spec b/rust-below.spec
index 7cda384..23e3f5c 100644
--- a/rust-below.spec
+++ b/rust-below.spec
@@ -4,9 +4,12 @@
%global crate below
+%global forgeurl
https://github.com/facebookincubator/below
+%global commit 584fdef23f4c7a95a009b84746bb193b68843c1a
+
Name: rust-%{crate}
Version: 0.2.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Interactive tool to view and record historical system data
# Upstream license specification: Apache-2.0
@@ -18,12 +21,33 @@ Patch0: below-fix-metadata.diff
# Fix record_replay_integration test
Patch1: below-fix-tests.patch
+# Get these from the repo as they aren't included in the crate
+Source1: %{forgeurl}/raw/%{commit}/etc/below.service
+Source2: %{forgeurl}/raw/%{commit}/etc/logrotate.conf
+Source3: %{forgeurl}/raw/%{commit}/README.md#/README-upstream.md
+
ExclusiveArch: %{rust_arches}
BuildRequires: rust-packaging
+BuildRequires: systemd-rpm-macros
%global _description %{expand:
-Interactive tool to view and record historical system data.}
+below is an interactive tool to view and record historical system data. It has
+support for:
+
+- information regarding hardware resource utilization
+- viewing the cgroup hierarchy
+- cgroup and process information
+- pressure stall information (PSI)
+- record mode to record system data
+- replay mode to replay historical system data
+- live mode to view live system data
+- dump subcommand to report script-friendly information (e.g. JSON and CSV)
+
+below does not have support for cgroup1.
+
+The name "below" stems from the fact that the below developers rejected many
of
+atop's design and style decisions.}
%description %{_description}
@@ -34,12 +58,25 @@ Summary: %{summary}
%files -n %{crate}
%license LICENSE
+%doc README.md docs
%{_bindir}/%{crate}
+%{_unitdir}/%{crate}.service
+%{_sysconfdir}/logrotate.d/%{crate}.conf
%dir %{_localstatedir}/log/%{crate}
+%post -n %{crate}
+%systemd_post %{crate}.service
+
+%preun -n %{crate}
+%systemd_preun %{crate}.service
+
+%postun -n %{crate}
+%systemd_postun_with_restart %{crate}.service
+
%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
%cargo_prep
+cp -p %{SOURCE3} README.md
%generate_buildrequires
%cargo_generate_buildrequires
@@ -49,6 +86,9 @@ Summary: %{summary}
%install
%cargo_install
+install -D -p -m0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{crate}.service
+install -D -p -m0644 %{SOURCE2} \
+ %{buildroot}%{_sysconfdir}/logrotate.d/%{crate}.conf
install -d -m1777 %{buildroot}%{_localstatedir}/log/%{crate}
%if %{with check}
@@ -57,5 +97,11 @@ install -d -m1777 %{buildroot}%{_localstatedir}/log/%{crate}
%endif
%changelog
+* Mon Jun 28 2021 Davide Cavalca <dcavalca(a)fedoraproject.org> - 0.2.0-2
+- Install upstream systemd unit
+- Install upstream logrotate config
+- Add missing documentation
+- Expand the description
+
* Tue Jun 15 2021 Davide Cavalca <dcavalca(a)fedoraproject.org> - 0.2.0-1
- Initial package
commit bd287ce04374f2bb04212db695276d5ccfa089f3
Author: Davide Cavalca <dcavalca(a)fedoraproject.org>
Date: Mon Jun 28 11:16:28 2021 -0700
import #1972939
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..93b0b38
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/below-0.2.0.crate
diff --git a/below-fix-metadata.diff b/below-fix-metadata.diff
new file mode 100644
index 0000000..695614f
--- /dev/null
+++ b/below-fix-metadata.diff
@@ -0,0 +1,38 @@
+--- below-0.2.0/Cargo.toml 1970-01-01T00:00:00+00:00
++++ below-0.2.0/Cargo.toml 2021-06-16T22:24:40.312159+00:00
+@@ -42,7 +42,7 @@
+ package = "below-dump"
+
+ [dependencies.libbpf-rs]
+-version = "0.10.0"
++version = "0.11.0"
+
+ [dependencies.libc]
+ version = "0.2.86"
+@@ -65,7 +65,7 @@
+ version = "1.4.2"
+
+ [dependencies.serde]
+-version = "=1.0.118"
++version = "1.0.126"
+ features = ["derive", "rc"]
+
+ [dependencies.serde_json]
+@@ -93,14 +93,14 @@
+ version = "0.3.21"
+
+ [dependencies.tokio]
+-version = "0.2.25"
++version = "1.6.1"
+ features = ["full", "test-util"]
+
+ [dependencies.toml]
+-version = "=0.5.7"
++version = "0.5.8"
+
+ [dependencies.users]
+-version = "0.9"
++version = "0.11"
+
+ [dependencies.view]
+ version = "0.2.0"
diff --git a/below-fix-tests.patch b/below-fix-tests.patch
new file mode 100644
index 0000000..f32eb2c
--- /dev/null
+++ b/below-fix-tests.patch
@@ -0,0 +1,59 @@
+diff -Naur a/src/test/test_general.rs b/src/test/test_general.rs
+--- a/src/test/test_general.rs 1969-12-31 16:00:00.000000000 -0800
++++ b/src/test/test_general.rs 2021-06-16 16:08:09.168914682 -0700
+@@ -27,19 +27,16 @@
+ .expect("failed to collect sample");
+
+ // Validate some data in the sample
+- assert!(
+- sample
+- .cgroup
+- .pressure
+- .as_ref()
+- .expect("missing memory.pressure")
+- .memory
+- .full
+- .total
+- .as_ref()
+- .expect("missing memory.pressure.total")
+- > &0
+- );
++ sample
++ .cgroup
++ .pressure
++ .as_ref()
++ .expect("missing memory.pressure")
++ .memory
++ .full
++ .total
++ .as_ref()
++ .expect("missing memory.pressure.total");
+ let nr_procs = sample.processes.len();
+ let hostname = sample.system.hostname.clone();
+ let proc0_cgroup = sample
+@@ -75,17 +72,14 @@
+ .expect("failed to get advanced data");
+
+ // Validate some values in restored sample
+- assert!(
+- *restored_sample
+- .cgroup
+- .io_total
+- .as_ref()
+- .expect("missing io.stat")
+- .rbytes_per_sec
+- .as_ref()
+- .expect("missing io stat read bytes per second")
+- == 0.0
+- );
++ restored_sample
++ .cgroup
++ .io_total
++ .as_ref()
++ .expect("missing io.stat")
++ .rbytes_per_sec
++ .as_ref()
++ .expect("missing io stat read bytes per second");
+ assert!(restored_sample.process.processes.len() == nr_procs);
+ assert!(restored_sample.system.hostname == hostname);
+ assert!(
diff --git a/rust-below.spec b/rust-below.spec
new file mode 100644
index 0000000..7cda384
--- /dev/null
+++ b/rust-below.spec
@@ -0,0 +1,61 @@
+# Generated by rust2rpm 16
+%bcond_without check
+%global __cargo_skip_build 0
+
+%global crate below
+
+Name: rust-%{crate}
+Version: 0.2.0
+Release: 1%{?dist}
+Summary: Interactive tool to view and record historical system data
+
+# Upstream license specification: Apache-2.0
+License: ASL 2.0
+URL:
https://crates.io/crates/below
+Source: %{crates_source}
+# Bump serde to 1.0.126, tokio to 1.6.1, toml to 0.58, users to 0.11
+Patch0: below-fix-metadata.diff
+# Fix record_replay_integration test
+Patch1: below-fix-tests.patch
+
+ExclusiveArch: %{rust_arches}
+
+BuildRequires: rust-packaging
+
+%global _description %{expand:
+Interactive tool to view and record historical system data.}
+
+%description %{_description}
+
+%package -n %{crate}
+Summary: %{summary}
+
+%description -n %{crate} %{_description}
+
+%files -n %{crate}
+%license LICENSE
+%{_bindir}/%{crate}
+%dir %{_localstatedir}/log/%{crate}
+
+%prep
+%autosetup -n %{crate}-%{version_no_tilde} -p1
+%cargo_prep
+
+%generate_buildrequires
+%cargo_generate_buildrequires
+
+%build
+%cargo_build
+
+%install
+%cargo_install
+install -d -m1777 %{buildroot}%{_localstatedir}/log/%{crate}
+
+%if %{with check}
+%check
+%cargo_test
+%endif
+
+%changelog
+* Tue Jun 15 2021 Davide Cavalca <dcavalca(a)fedoraproject.org> - 0.2.0-1
+- Initial package
diff --git a/sources b/sources
new file mode 100644
index 0000000..e2480dd
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (below-0.2.0.crate) =
4f72620ed5c66ead42b5ab50c2a7e975956a6511b23e41056a4452274b7bc8172729b0ff44d9ce524d43024471236d093111a7e9d44239efed0a5a1e38127944