mirror of
https://github.com/NotAShelf/microfetch.git
synced 2025-11-25 16:52:50 +00:00
treewide: set up Hotpath for benchmarking individual allocations
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I0351e5753996e6d0391fc9e2f329878a6a6a6964
This commit is contained in:
parent
9bd4c9a70a
commit
2a6fe2a3f1
8 changed files with 1075 additions and 3 deletions
|
|
@ -6,6 +6,7 @@ use std::{
|
|||
use nix::sys::utsname::UtsName;
|
||||
|
||||
#[must_use]
|
||||
#[cfg_attr(feature = "hotpath", hotpath::measure)]
|
||||
pub fn get_system_info(utsname: &UtsName) -> String {
|
||||
format!(
|
||||
"{} {} ({})",
|
||||
|
|
@ -15,6 +16,7 @@ pub fn get_system_info(utsname: &UtsName) -> String {
|
|||
)
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "hotpath", hotpath::measure)]
|
||||
pub fn get_os_pretty_name() -> Result<String, io::Error> {
|
||||
let file = File::open("/etc/os-release")?;
|
||||
let reader = BufReader::new(file);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue