Compare commits

...
Sign in to create a new pull request.

20 commits

Author SHA1 Message Date
Benjamin A. Beasley
dd5a0ac0e4 Allow procfs 0.18 2026-01-05 10:01:36 +00:00
Fedora Release Engineering
05ee9e5059 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-25 16:13:57 +00:00
Fedora Release Engineering
484fc87604 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-19 06:49:49 +00:00
Benjamin A. Beasley
86131092cf Deduplicate the License expression 2024-12-05 15:37:02 -05:00
Benjamin A. Beasley
b70659717f Update License
Use the latest %cargo_license_summary output.
2024-12-05 11:46:09 -05:00
Benjamin A. Beasley
ccad1edf86 Use consistent style when branching on bconds
[skip changelog]
2024-12-05 11:39:05 -05:00
Benjamin A. Beasley
fea015f647 Use the same bcond style for selinux that rust2rpm 27 uses for check
This works in EPEL9 and later, and is less confusing than
bcond_with/bcond_without.

[skip changelog]
2024-12-05 11:38:56 -05:00
Benjamin A. Beasley
ce2b59face Allow procfs 0.17 2024-12-05 11:36:22 -05:00
Fedora Release Engineering
1299546269 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-20 01:49:51 +00:00
Fabio Valentini
d2b07b02d4
Rebuild with Rust 1.78 to fix incomplete debuginfo and backtraces 2024-05-23 19:12:28 +02:00
Davide Cavalca
d417f923f0 Rebuild for rd-util update 2024-05-02 14:21:38 -07:00
Davide Cavalca
f37de2156f Update to 2.2.5; Fixes: RHBZ#2081989, RHBZ#2214221 2024-05-01 14:18:32 -07:00
Fedora Release Engineering
0b560a2998 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-26 23:28:16 +00:00
Fabio Valentini
097546cd95
Regenerate with rust2rpm v24 2023-08-07 23:41:43 +02:00
Fedora Release Engineering
70f4fac598 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-21 23:03:12 +00:00
Fabio Valentini
7b8e4d4e21
Rebuild for CVE-2022-24765 and CVE-2022-29187 in libgit2 2023-01-28 17:02:38 +01:00
Fedora Release Engineering
928ee5981b Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-21 00:58:45 +00:00
Fedora Release Engineering
80ecb4dc53 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-23 06:11:01 +00:00
Zbigniew Jędrzejewski-Szmek
7e953e5ebb Rebuild with package notes 2022-02-15 16:31:42 +01:00
Fedora Release Engineering
e0566eba03 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-21 22:42:12 +00:00
6 changed files with 131 additions and 45 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
/linux-5.8.11.tar.xz
/rd-agent-2.1.2.crate
/rd-agent-2.1.2-vendor.tar.gz
/rd-agent-2.2.5.crate

View file

@ -1,3 +0,0 @@
# rust-rd-agent
The rust-rd-agent package

View file

@ -0,0 +1,68 @@
diff --git a/src/report.rs b/src/report.rs
index 4d825fd9..cebdfd7f 100644
--- a/src/report.rs
+++ b/src/report.rs
@@ -2,7 +2,6 @@
use anyhow::{anyhow, bail, Result};
use chrono::prelude::*;
use crossbeam::channel::{self, select, Receiver, Sender};
-use enum_iterator::IntoEnumIterator;
use log::{debug, error, info, trace, warn};
use nix::sys::signal::{kill, Signal};
use nix::unistd::Pid;
@@ -266,7 +265,7 @@ impl UsageTracker {
};
us.usages.insert(ROOT_SLICE.into(), Default::default());
- for slice in Slice::into_enum_iter() {
+ for slice in enum_iterator::all::<Slice>() {
us.usages.insert(slice.name().into(), Default::default());
}
@@ -281,7 +280,7 @@ impl UsageTracker {
let (us, cpu_total) = read_system_usage(self.devnr)?;
usages.insert(ROOT_SLICE.into(), us);
- for slice in Slice::into_enum_iter() {
+ for slice in enum_iterator::all::<Slice>() {
usages.insert(
slice.name().to_string(),
read_cgroup_usage(slice.cgrp(), self.devnr),
diff --git a/src/slices.rs b/src/slices.rs
index 2053e7bb..b575cc8b 100644
--- a/src/slices.rs
+++ b/src/slices.rs
@@ -1,6 +1,5 @@
// Copyright (c) Facebook, Inc. and its affiliates.
use anyhow::{Context, Result};
-use enum_iterator::IntoEnumIterator;
use glob::glob;
use log::{debug, error, info, trace, warn};
use scan_fmt::scan_fmt;
@@ -246,7 +245,7 @@ pub fn apply_slices(knobs: &mut SliceKnobs, hashd_mem_size: u64, cfg: &Config) -
}
let mut updated = false;
- for slice in Slice::into_enum_iter() {
+ for slice in enum_iterator::all::<Slice>() {
let enforce_mem = slice_enforce_mem(&cfg.enforce, slice);
if !cfg.enforce.cpu && !enforce_mem && !cfg.enforce.io {
@@ -353,7 +352,7 @@ fn clear_one_slice(slice: Slice, ecfg: &EnforceConfig) -> Result<bool> {
pub fn clear_slices(ecfg: &EnforceConfig) -> Result<()> {
let mut updated = false;
- for slice in Slice::into_enum_iter() {
+ for slice in enum_iterator::all::<Slice>() {
let enforce_mem = slice_enforce_mem(ecfg, slice);
if !ecfg.cpu && !enforce_mem && !ecfg.io {
@@ -597,7 +596,7 @@ pub fn verify_and_fix_slices(
let recursive_mem_prot = cfg.memcg_recursive_prot();
- for slice in Slice::into_enum_iter() {
+ for slice in enum_iterator::all::<Slice>() {
let sk = knobs.slices.get(slice.name()).unwrap();
let path = slice.cgrp();

View file

@ -0,0 +1,20 @@
--- rd-agent-2.2.5/Cargo.toml 1970-01-01T00:00:01+00:00
+++ rd-agent-2.2.5/Cargo.toml 2026-01-05T10:01:01.383431+00:00
@@ -30,7 +30,7 @@
version = "0.8"
[dependencies.enum-iterator]
-version = "0.7"
+version = "2.0"
[dependencies.glob]
version = "0.3"
@@ -61,7 +61,7 @@
version = "0.3"
[dependencies.procfs]
-version = "0.16"
+version = ">=0.16, <0.19"
[dependencies.rd-agent-intf]
version = "2.2.5"

View file

@ -1,46 +1,37 @@
# Generated by rust2rpm 18
%bcond_without check
%global __cargo_skip_build 0
# Generated by rust2rpm 28
%bcond check 1
%global crate rd-agent
%if 0%{?el8}
# el8 doesn't have these macros
%global __crates_url https://crates.io/api/v1/crates/
%global crates_source %{__crates_url}%{crate}/%{version}/download#/%{crate}-%{version}.crate
%global version_no_tilde %{version}
%endif
%global selinuxtype targeted
%bcond_without selinux
%bcond selinux 1
Name: rust-%{crate}
Version: 2.1.2
Name: rust-rd-agent
Version: 2.2.5
Release: %autorelease
Summary: Management agent for resctl-demo
# Upstream license specification: Apache-2.0
License: ASL 2.0 and MIT
License: Apache-2.0
URL: https://crates.io/crates/rd-agent
Source: %{crates_source}
# Used as a data file by rd-agent for the compile sideload
Source1: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.8.11.tar.xz
# Vendored dependencies for EPEL, update with ./update-vendor-tarball.sh
Source2: %{crate}-%{version}-vendor.tar.gz
Source: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.8.11.tar.xz
# Manually created patch for downstream crate metadata changes
# * bump enum-iterator to 2.0
# * allow procfs 0.17,
# https://github.com/facebookexperimental/resctl-demo/pull/326, and 0.18,
# https://github.com/facebookexperimental/resctl-demo/pull/335
Patch: rd-agent-fix-metadata.diff
# https://github.com/facebookexperimental/resctl-demo/commit/f65eedf9017332255ef0a48649664c26b45b9c07
Patch: rd-agent-enum-iterator.patch
# SELinux policy
Source10: %{crate}.fc
Source11: %{crate}.if
Source12: %{crate}.te
ExclusiveArch: %{rust_arches}
BuildRequires: cargo-rpm-macros >= 24
%if 0%{?el8}
BuildRequires: rust-toolset
%else
BuildRequires: rust-packaging
%endif
%if 0%{?with_selinux}
%if %{with selinux}
BuildRequires: selinux-policy-devel
%endif
@ -51,8 +42,22 @@ Management agent for resctl-demo.}
%package -n %{crate}
Summary: %{summary}
# (MIT OR Apache-2.0) AND Unicode-DFS-2016
# 0BSD
# 0BSD OR MIT OR Apache-2.0
# Apache-2.0
# Apache-2.0 OR BSL-1.0
# Apache-2.0 OR MIT
# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
# BSD-2-Clause OR Apache-2.0 OR MIT
# MIT
# MIT OR Apache-2.0
# MIT OR Zlib OR Apache-2.0
# Unlicense OR MIT
License: 0BSD AND Apache-2.0 AND MIT AND Unicode-DFS-2016 AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT)
# LICENSE.dependencies contains a full license breakdown
%if 0%{?with_selinux}
%if %{with selinux}
Requires: (%{crate}-selinux if selinux-policy-%{selinuxtype})
%endif
Recommends: rd-hashd = %{version}
@ -69,6 +74,7 @@ Recommends: xz
%files -n %{crate}
%license LICENSE
%license LICENSE.dependencies
%doc README.md
%{_bindir}/rd-agent
%attr(2775, root, wheel) %dir %{_sharedstatedir}/resctl-demo
@ -83,7 +89,7 @@ This package contains data files for %{crate}.
%files -n %{crate}-data
%{_datadir}/resctl-demo
%if 0%{?with_selinux}
%if %{with selinux}
%package -n %{crate}-selinux
Summary: SELinux policy for %{crate}
BuildArch: noarch
@ -113,26 +119,21 @@ fi
%endif
%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
%if 0%{?with_selinux}
%autosetup -n %{crate}-%{version} -p1
%cargo_prep
%if %{with selinux}
mkdir selinux
cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} selinux
%endif
%if 0%{?el8}
%cargo_prep -V 2
%else
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
%endif
%build
%cargo_build
%if 0%{?with_selinux}
%{cargo_license_summary}
%{cargo_license} > LICENSE.dependencies
%if %{with selinux}
make -C selinux -f %{_datadir}/selinux/devel/Makefile %{crate}.pp
bzip2 -9 selinux/%{crate}.pp
%endif
@ -142,7 +143,7 @@ bzip2 -9 selinux/%{crate}.pp
install -Dpm0644 %SOURCE1 %{buildroot}%{_datadir}/resctl-demo/linux.tar.xz
mkdir -p %{buildroot}%{_sharedstatedir}/resctl-demo
%if 0%{?with_selinux}
%if %{with selinux}
install -Dm0644 selinux/%{crate}.pp.bz2 \
%{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{crate}.pp.bz2
%endif

View file

@ -1,3 +1,2 @@
SHA512 (rd-agent-2.1.2.crate) = 15dae4e8d6cb2466130eeb208e387e5cc2bc1c0179dd1261057f657738c7f1dc5b54cb29d4a37074aba7196d535b91ee5058b90403c27a12115dfa1ce87712d0
SHA512 (rd-agent-2.2.5.crate) = c06d65a1b6bc94e3dea8b006a5418d2d336b0521e24caa1bbfa4b75375249d47487e379383a9a303236f40ab8e494a1b78d8c1bb80182f587bb105407cad6e81
SHA512 (linux-5.8.11.tar.xz) = bb6994f09aabfb0076f3023dd8359c5c569a4b398d3a3c3c8d6b27052092cab56ad675f45dd6ceba7fe431f2a6a587858f3c21415b5a00adb346bd2c68d85b0f
SHA512 (rd-agent-2.1.2-vendor.tar.gz) = 67bbbd761c7788c3689f1d67e720e4cafc38442b2f64e3ff384927a90ccad458b0e648224e1fa46c41550a554e17819cc7a23606d2598d1e40589fe02377ed39