Skip to content

Commit

Permalink
Remove unused kernel diagnostic from io-uring-test (#287)
Browse files Browse the repository at this point in the history
* This diagnostic is both unused and unreliable because
  uname may return kernel versions that semver cannot
  parse, such as '6.8.9-300.fc40.x86_64'.
  • Loading branch information
daniel-levin authored May 22, 2024
1 parent 4d73b2a commit 02a27c9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion io-uring-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ anyhow = "1"
tempfile = "3"
once_cell = "1"
socket2 = "0.5"
semver = "1.0.21"

[features]
direct-syscall = [ "io-uring/direct-syscall" ]
Expand Down
19 changes: 0 additions & 19 deletions io-uring-test/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,11 @@ mod tests;

use io_uring::{cqueue, squeue, IoUring, Probe};
use std::cell::Cell;
use std::ffi::CStr;
use std::mem;

pub struct Test {
probe: Probe,
target: Option<String>,
count: Cell<usize>,
kernel_version: semver::Version,
}

impl Test {
fn check_kernel_version(&self, min_version: &str) -> bool {
self.kernel_version >= semver::Version::parse(min_version).unwrap()
}
}

fn main() -> anyhow::Result<()> {
Expand Down Expand Up @@ -72,16 +63,6 @@ fn test<S: squeue::EntryMarker, C: cqueue::EntryMarker>(
probe,
target: std::env::args().nth(1),
count: Cell::new(0),
kernel_version: {
let mut uname: libc::utsname = unsafe { mem::zeroed() };
unsafe {
assert!(libc::uname(&mut uname) >= 0);
}

let version = unsafe { CStr::from_ptr(uname.release.as_ptr()) };
let version = version.to_str().unwrap();
semver::Version::parse(version).unwrap()
},
};

tests::queue::test_nop(&mut ring, &test)?;
Expand Down

0 comments on commit 02a27c9

Please sign in to comment.