commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
57bfc2141c8af433e9426122ea0ec35673842bd5
Alex H
2022-10-06T23:06:00
Fix a compile error on Linux if the `apple-sandbox` feature is enabled. That combination is nonsensical, of course, but [it isn't currently possible to enable features only on specific targets][cargo-1197], so any project that targets both Linux and sandboxed macOS will currently fail to build on Linux. [cargo-1197]:...
diff --git a/src/utils.rs b/src/utils.rs index 578ab61..b5dda08 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -27,7 +27,7 @@ pub(crate) fn to_cpath(path: &std::path::Path) -> Vec<u8> { ), feature = "multithread" ), - not(feature = "apple-sandbox"), + not(all(target_os = "macos", feature =...
1
2
2
51bdd5249e1b195ac2a29f81930cbc648e09ad03
Guillaume Gomez
2022-10-01T13:13:03
Greatly simplify linux utils::realpath function
diff --git a/src/linux/utils.rs b/src/linux/utils.rs index d36db13..0c55301 100644 --- a/src/linux/utils.rs +++ b/src/linux/utils.rs @@ -19,39 +19,12 @@ pub(crate) fn get_all_data<P: AsRef<Path>>(file_path: P, size: usize) -> io::Res } #[allow(clippy::useless_conversion)] -pub(crate) fn realpath(original: &Path) ->...
1
5
32
65645520844ca085eb57a2a47ea0f73819885452
Guillaume Gomez
2022-10-01T12:47:33
Move CPU-related code into cpu.rs file for linux
diff --git a/src/linux/cpu.rs b/src/linux/cpu.rs index f3970c3..103f536 100644 --- a/src/linux/cpu.rs +++ b/src/linux/cpu.rs @@ -4,9 +4,209 @@ use std::collections::HashSet; use std::fs::File; -use std::io::Read; +use std::io::{BufRead, BufReader, Read}; -use crate::CpuExt; +use crate::sys::utils::to_u64; +use cr...
3
223
180
e0ecb2d2b0adf54fbecd99b22f1f0e55d9330e74
Guillaume Gomez
2022-10-01T12:53:15
Remove unneeded PathBuf creations
diff --git a/src/linux/process.rs b/src/linux/process.rs index d910f44..b71d97c 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -245,9 +245,7 @@ pub(crate) fn set_time(p: &mut Process, utime: u64, stime: u64) { } pub(crate) fn update_process_disk_activity(p: &mut Process, path: &Path) { - let mut...
1
2
6
602f1753209c24716eee00798200aa775964f38a
Guillaume Gomez
2022-10-01T11:47:57
Improve Path handling in `retrieve_all_new_process_info` function
diff --git a/src/linux/process.rs b/src/linux/process.rs index 1938638..d910f44 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -12,7 +12,9 @@ use std::str::FromStr; use libc::{gid_t, kill, uid_t}; use crate::sys::system::SystemInfo; -use crate::sys::utils::{get_all_data, get_all_data_from_file, rea...
2
44
24
4b658da61ed30f97f72c9d99e56bfdc2914684a3
Guillaume Gomez
2022-09-26T13:15:48
Update crate version to 0.26.4
diff --git a/Cargo.toml b/Cargo.toml index 50ea4a2..cef3263 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.26.3" +version = "0.26.4" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
1596e60620e5afca50a6440882224ce6b0651dec
Alexis (Poliorcetics) Bourget
2022-09-26T07:02:06
deps: Update ntapi to 0.4 This notably fixes a `future-incompatibility` warning on Rust 1.64.0
diff --git a/Cargo.toml b/Cargo.toml index 7400be4..9cfac32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,7 +56,7 @@ winapi = { version = "0.3.9", features = [ "shellapi", "std" ]} -ntapi = "0.3" +ntapi = "0.4" [target.'cfg(not(any(target_os = "unknown", target_arch = "wasm32")))'.dependencies] libc = "^0....
1
1
1
ceef6b05eb1ff5a9518bf3372292c2c3980b8a76
Lisa White
2022-09-24T23:44:14
Add SystemExt::distribution_id() SystemExt::name() returns human-readable distribution name, but there is no machine-readable alternative. SystemExt::distribution_id() returns os-release.ID, or std::env::consts::OS if os-release.ID is unavailable. Fallback behaviour is consistent with the os-release.ID specification ...
diff --git a/src/apple/system.rs b/src/apple/system.rs index bfd3835..05b193f 100644 --- a/src/apple/system.rs +++ b/src/apple/system.rs @@ -605,6 +605,10 @@ impl SystemExt for System { } } } + + fn distribution_id(&self) -> String { + std::env::consts::OS.to_owned() + } } im...
7
77
1
166a84e562e7a7e4c038b0d48ebefabc1e048959
Guillaume Gomez
2022-09-25T15:00:44
Update crate version to 0.26.3
diff --git a/Cargo.toml b/Cargo.toml index 8a6b1a1..7400be4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.26.2" +version = "0.26.3" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
77b729d34595e169cff345985026b4696056c985
Guillaume Gomez
2022-09-03T13:25:04
Update crate version to 0.26.2
diff --git a/Cargo.toml b/Cargo.toml index d0afbfb..3875625 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.26.1" +version = "0.26.2" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
95180032015122567d8c712c2480d8d150c28a08
Guillaume Gomez
2022-09-03T12:48:28
Fix invalid retrieval of information on linux processes
diff --git a/src/lib.rs b/src/lib.rs index 5de3494..8fb045f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -469,4 +469,19 @@ mod test { (new_total - total).abs() ); } + + // We ensure that the `Process` cmd information is retrieved as expected. + #[test] + fn check_cmd_line() { + ...
2
16
1
7d497dbb47802d6ad0206688cc290ef00d15433d
Guillaume Gomez
2022-09-03T12:48:07
Improve refresh_procs indent level by returning early
diff --git a/src/linux/process.rs b/src/linux/process.rs index 3da50d3..8f42118 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -547,65 +547,65 @@ pub(crate) fn refresh_procs( info: &SystemInfo, refresh_kind: ProcessRefreshKind, ) -> bool { - if let Ok(d) = fs::read_dir(path) { - le...
1
57
57
8e95cf8a53e991889673b12e760c4b7f4e19e87f
Axel Viala
2022-09-02T15:03:32
ComponentExt: Add document to Linux details.
diff --git a/src/traits.rs b/src/traits.rs index 096c1bf..1c6c228 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -1486,10 +1486,17 @@ pub trait ComponentExt: Debug { /// println!("{}°C", component.temperature()); /// } /// ``` + /// + /// ## Linux + /// + /// Returns `f32::NAN` if it f...
1
29
0
6eb07169140c8aeeebd413f68ff515a85db1ae66
Axel Viala
2022-08-28T22:51:21
[linux-hwmon] Attempt to read new data from hwmon on linux What it does? Expose new things: (Read only) - Expose a label that mimic `sensors` own (breaking change) - Sensor type - Allow reading of everything with a temp sensor. - Highest form kernel/chip maximum historical read value, is read from hardware OR from...
diff --git a/src/linux/component.rs b/src/linux/component.rs index ffdc7fa..bc7e1f9 100644 --- a/src/linux/component.rs +++ b/src/linux/component.rs @@ -1,144 +1,309 @@ // Take a look at the license at the top of the repository in the LICENSE file. +// Information about values readable from `hwmon` sysfs. +// +// Va...
1
282
111
16532f76cfbc7c4683011dac906b7cb0fcc1daef
Axel Viala
2022-09-02T11:14:06
[linux-hwmon] Remove raspberry-pi special code. Not needed since raspbian 10.
diff --git a/src/linux/component.rs b/src/linux/component.rs index f3a8d60..ffdc7fa 100644 --- a/src/linux/component.rs +++ b/src/linux/component.rs @@ -33,6 +33,7 @@ fn is_file<T: AsRef<Path>>(path: T) -> bool { metadata(path).ok().map(|m| m.is_file()).unwrap_or(false) } + fn append_files(components: &mut Vec...
1
1
9
6f524c46c1d43108efad3a753c1ddf3328c5c161
Axel Viala
2022-09-02T15:57:07
clippy --fix pass (#834) Fix clippy lint error
diff --git a/src/linux/process.rs b/src/linux/process.rs index adfa629..3da50d3 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -653,7 +653,7 @@ fn get_uid_and_gid(file_path: &Path) -> Option<(uid_t, gid_t)> { } } - let status_data = get_all_data(&file_path, 16_385).ok()?; + let st...
2
4
9
edb5075bdcd64f1cbbe05d7bc4352d379a9a156a
changyongyun
2022-09-01T08:20:14
fix: got nvme0n when passing device name 'nvme0n1'
diff --git a/src/linux/disk.rs b/src/linux/disk.rs index 5a313fd..c700a6c 100644 --- a/src/linux/disk.rs +++ b/src/linux/disk.rs @@ -136,9 +136,10 @@ fn find_type_for_device_name(device_name: &OsStr) -> DiskType { real_path = real_path.trim_end_matches(|c| c >= '0' && c <= '9'); } else if device_name_path...
1
8
6
9ab4acc14536cba151e1aafa54f9b63bd436f427
Axel Viala
2022-09-01T17:28:26
Use try in refresh_procs.
diff --git a/src/linux/process.rs b/src/linux/process.rs index e9abdc2..adfa629 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -550,14 +550,11 @@ pub(crate) fn refresh_procs( if let Ok(d) = fs::read_dir(path) { let folders = d .filter_map(|entry| { - if let Ok(...
1
12
20
6e80a172cc9807408a3c1293b2cb5c7b402433bd
Axel Viala
2022-09-01T17:26:45
unwrap_or_return! Replace by ?.
diff --git a/src/linux/process.rs b/src/linux/process.rs index c9b8b08..e9abdc2 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -447,7 +447,7 @@ pub(crate) fn _get_process_data( } else { _get_stat_data(path, &mut entry.stat_file)? }; - let parts = parse_stat_file(&d...
1
8
17
1ec87c919b140a578a1684069857f5512f33dd8c
Guillaume Gomez
2022-08-31T15:15:49
Update crate version to 0.26.1
diff --git a/Cargo.toml b/Cargo.toml index e4ee3f6..d0afbfb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.26.0" +version = "0.26.1" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
dbd169f842547b520c902923cbe8e4a6e06ef833
sangluo
2022-08-31T13:41:00
fix segfault on m1
diff --git a/src/apple/macos/component/arm.rs b/src/apple/macos/component/arm.rs index 5bf8899..776522f 100644 --- a/src/apple/macos/component/arm.rs +++ b/src/apple/macos/component/arm.rs @@ -3,7 +3,7 @@ use std::ffi::CStr; use core_foundation_sys::array::{CFArrayGetCount, CFArrayGetValueAtIndex}; -use core_founda...
1
13
9
b2ccd8b386d5b08301f4b92bc34adf6e13b2cf70
Guillaume Gomez
2022-08-29T12:20:28
Update crate version to 0.26.0
diff --git a/Cargo.toml b/Cargo.toml index cbcc259..e4ee3f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.25.3" +version = "0.26.0" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
a224ee892627a9fc4d22b95c482056657147772b
Guillaume Gomez
2022-08-29T09:53:51
Update Component::new argument to take a PathBuf instead of a Path
diff --git a/src/linux/component.rs b/src/linux/component.rs index 3a10588..f3a8d60 100644 --- a/src/linux/component.rs +++ b/src/linux/component.rs @@ -100,7 +100,7 @@ fn append_files(components: &mut Vec<Component>, folder: &Path) { let crit = get_file_line(p_crit.as_path(), 10).map(|crit| { ...
1
5
5
ef75f5b833cae6188f22f9b165e68c95265e23a1
соджиро кояма
2022-08-24T11:53:55
Show Windows 11 OS according to the build number
diff --git a/src/windows/system.rs b/src/windows/system.rs index d037c8c..e3bca74 100644 --- a/src/windows/system.rs +++ b/src/windows/system.rs @@ -64,6 +64,19 @@ pub struct System { users: Vec<User>, } +static WINDOWS_ELEVEN_BUILD_NUMBER: u32 = 22000; + +impl System { + fn is_windows_eleven(&self) -> bool ...
1
36
13
f3b3bcfaf98225319e316e150850b5f02ecfd5dc
Guillaume Gomez
2022-08-21T13:52:58
Update crate version to 0.25.3
diff --git a/Cargo.toml b/Cargo.toml index 48521f4..cbcc259 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.25.2" +version = "0.25.3" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
1818618f72a900c8fde35d78d090de163d4c244e
Guillaume Gomez
2022-08-21T13:30:19
Greatly improve source code to make it simpler to handle both x86 and arch targets
diff --git a/src/apple/macos/component/arm.rs b/src/apple/macos/component/arm.rs index ebc055b..5bf8899 100644 --- a/src/apple/macos/component/arm.rs +++ b/src/apple/macos/component/arm.rs @@ -1,7 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. use std::ffi::CStr; -use std::o...
4
151
238
f2735af9d21fbe5d5c220ed43cbe547faab0d72a
Guillaume Gomez
2022-08-21T12:24:33
Fix compilation for mac M1 targets
diff --git a/src/apple/macos/component/arm.rs b/src/apple/macos/component/arm.rs index 69a501c..ebc055b 100644 --- a/src/apple/macos/component/arm.rs +++ b/src/apple/macos/component/arm.rs @@ -1,6 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use std::ffi::CStr; +use std::o...
8
108
62
c068e02b76015f2fbcbd2da2cb022dc045cbcb2c
Guillaume Gomez
2022-08-16T10:04:08
Correctly wrap System::session into CFReleaser in macOS
diff --git a/src/apple/macos/disk.rs b/src/apple/macos/disk.rs index 191c1ab..28e49e6 100644 --- a/src/apple/macos/disk.rs +++ b/src/apple/macos/disk.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use super::CFReleaser; +use crate::sys::macos::utils::CFReleaser; ...
4
51
38
ead93675122ce5f542f5b4409ccc3a1c653674f9
Guillaume Gomez
2022-08-16T09:46:31
Create wrapping types for System::connection
diff --git a/src/apple/macos/disk.rs b/src/apple/macos/disk.rs index 87aa8ec..191c1ab 100644 --- a/src/apple/macos/disk.rs +++ b/src/apple/macos/disk.rs @@ -5,7 +5,7 @@ use crate::sys::{ffi, utils}; use crate::utils::to_cpath; use crate::{Disk, DiskType}; -use core_foundation_sys::base::{kCFAllocatorDefault, kCFAll...
5
125
71
1e5d94a8f52c25412b3949da6b58f7275b537411
Guillaume Gomez
2022-08-13T09:24:08
Fix leak in apple disk retrieval
diff --git a/src/apple/macos/disk.rs b/src/apple/macos/disk.rs index 530af85..87aa8ec 100644 --- a/src/apple/macos/disk.rs +++ b/src/apple/macos/disk.rs @@ -94,20 +94,22 @@ unsafe fn get_dict_value<T, F: FnOnce(*const c_void) -> Option<T>>( key: &[u8], callback: F, ) -> Option<T> { - let key = ffi::CFStri...
1
12
10
634ea3d2cf444b16ce6c2f1dbe8c8e61eedd8d52
Mark3K
2022-08-21T11:12:20
Add support for get temperature on m1 (#792) Add support for get temperature on m1 Co-authored-by: sangluo <sangluo@pinduoduo.com>
diff --git a/src/apple/macos/component/arm.rs b/src/apple/macos/component/arm.rs new file mode 100644 index 0000000..69a501c --- /dev/null +++ b/src/apple/macos/component/arm.rs @@ -0,0 +1,172 @@ +// Take a look at the license at the top of the repository in the LICENSE file. + +use std::ffi::CStr; + +use core_foundati...
8
444
34
56e9c29d5784848ba75db91441f2b829a5f09fcb
Guillaume Gomez
2022-08-09T15:45:23
Update crate version to 0.25.2
diff --git a/Cargo.toml b/Cargo.toml index 85657dc..48521f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.25.1" +version = "0.25.2" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
67b68be3ed94cc3953b3c65e90f7aa42609f702b
Guillaume Gomez
2022-08-09T15:04:38
Fix PID owner change on Windows
diff --git a/src/windows/process.rs b/src/windows/process.rs index ae8a39c..e26c36a 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -328,7 +328,7 @@ impl Process { (Vec::new(), Vec::new(), PathBuf::new()) } }; - let (start_time, run_time)...
2
75
30
64986ec4a0e081bdf133562483fa3e50e0bd8b41
Guillaume Gomez
2022-08-08T21:01:15
Correctly handle when a PID owner changes on macOS
diff --git a/src/apple/macos/process.rs b/src/apple/macos/process.rs index fbe0147..323a82b 100644 --- a/src/apple/macos/process.rs +++ b/src/apple/macos/process.rs @@ -292,17 +292,238 @@ fn do_get_env_path(env: &str, root: &mut PathBuf, check: &mut bool) { } } +unsafe fn get_bsd_info(pid: Pid) -> Option<libc::...
1
234
205
e9bec81512df8d25c27a788e37d03f3844746d1f
hamflx
2022-08-06T11:11:42
Remove unnecessary cfg attribute.
diff --git a/tests/process.rs b/tests/process.rs index 6745fc4..c200a60 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -11,7 +11,6 @@ fn test_process() { return; } assert!(!s.processes().is_empty()); - #[cfg(not(windows))] assert!(s .processes() .values()
1
0
1
b7091b36fd27841f9676d57bf377ef5b78ee7866
hamflx
2022-08-06T09:06:46
Fix the problem that exe() is sometimes empty
diff --git a/src/windows/process.rs b/src/windows/process.rs index 1cf41a6..ae8a39c 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -278,11 +278,11 @@ unsafe fn get_h_mod(process_handler: &HandleWrapper, h_mod: &mut *mut c_void) -> ) != 0 } -unsafe fn get_exe(process_handler: &HandleWrapper,...
1
4
10
0d5cac34756388e2910a65e879a6af67f4b8db05
Guillaume Gomez
2022-08-04T16:06:20
Correctly handle when a PID owner changes on FreeBSD
diff --git a/src/freebsd/process.rs b/src/freebsd/process.rs index 8053c13..fd312b4 100644 --- a/src/freebsd/process.rs +++ b/src/freebsd/process.rs @@ -176,23 +176,29 @@ pub(crate) unsafe fn get_process_data( // FIXME: This is to get the "real" run time (in micro-seconds). // let run_time = (kproc.ki_runtime...
1
20
15
2461416b96454dcc3f1516eb776b825dc5beb7cb
Guillaume Gomez
2022-08-04T16:27:27
Improve file counter handling on linux
diff --git a/src/linux/process.rs b/src/linux/process.rs index 1b2905c..74dadcf 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -11,8 +11,8 @@ use std::str::FromStr; use libc::{gid_t, kill, uid_t}; -use crate::sys::system::{SystemInfo, REMAINING_FILES}; -use crate::sys::utils::{get_all_data, get_al...
2
53
32
002c82bf298ffa5ecc8229df28e510222b62887e
Guillaume Gomez
2022-08-04T15:30:22
Correctly handle when a PID owner changes on linux
diff --git a/src/linux/process.rs b/src/linux/process.rs index 7b4573a..1b2905c 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -101,16 +101,11 @@ pub struct Process { } impl Process { - pub(crate) fn new( - pid: Pid, - parent: Option<Pid>, - start_time_without_boot_time: u64...
2
138
87
e6310b04d54fc45d053e21cd8e3925dfdced2894
Guillaume Gomez
2022-07-31T13:18:57
Update crate version to 0.25.1
diff --git a/Cargo.toml b/Cargo.toml index f552f35..85657dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.25.0" +version = "0.25.1" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
505af9fbe53f47827a8d91cb5def4fb359d8885f
Guillaume Gomez
2022-07-31T12:57:03
Add SystemExt::sort_disks_by
diff --git a/src/apple/system.rs b/src/apple/system.rs index b526c36..bd17a3e 100644 --- a/src/apple/system.rs +++ b/src/apple/system.rs @@ -498,6 +498,13 @@ impl SystemExt for System { &mut self.disks } + fn sort_disks_by<F>(&mut self, compare: F) + where + F: FnMut(&Disk, &Disk) -> std::c...
6
58
12
6b5146fd550930aaaf2c8f4eb0eca725a35da835
ComplexSpaces
2022-07-31T00:37:24
Do not fallback to cmd[0] if /proc/pid/exe is unreadable
diff --git a/src/linux/process.rs b/src/linux/process.rs index 0b06e26..7b4573a 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -411,20 +411,20 @@ pub(crate) fn _get_process_data( } else { p.name = name.into(); tmp.pop(); + tmp.push("cmdline"); p.cmd = copy_from_...
2
17
5
6e4f36e5b30cb05eaee202e1c006976d3f508cf4
Guillaume Gomez
2022-07-29T19:34:14
Update crate version to 0.25.0
diff --git a/Cargo.toml b/Cargo.toml index 03ee1d0..f552f35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.24.7" +version = "0.25.0" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
0c133777a1ab2e3f7b61c87633f49c90d45bc92b
Tom Gouville
2022-07-29T18:43:13
don't get cpu frequency by default when using refresh_cpu
diff --git a/src/lib.rs b/src/lib.rs index 257bbb8..c4fb4fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -440,6 +440,10 @@ mod test { assert_eq!(proc_.frequency(), 0); } s.refresh_cpu(); + for proc_ in s.cpus() { + assert_eq!(proc_.frequency(), 0); + } + s.r...
2
6
2
64b31ea6fdc8fee0f59810609b1ab97abf4b10c4
Tom Gouville
2022-07-29T17:55:07
Get CPU frequency only if specifically asked
diff --git a/src/linux/system.rs b/src/linux/system.rs index 7e684f0..7a86413 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -308,7 +308,7 @@ impl System { } } - if refresh_kind.frequency() || !self.got_cpu_frequency { + if refresh_kind.frequency() { ...
1
1
1
56b35f7b3a24e7482fdb2928e78b7a4a231d0a4e
Tom Gouville
2022-07-29T17:32:11
allow refreshing cpu frequency
diff --git a/src/linux/system.rs b/src/linux/system.rs index 7a8d0a0..7e684f0 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -308,7 +308,7 @@ impl System { } } - if refresh_kind.frequency() && !self.got_cpu_frequency { + if refresh_kind.frequency() ||...
1
1
1
07d28e7d00add46e92f9a43413a91c1e6154f8cc
Guillaume Gomez
2022-07-19T15:11:29
Update crate version to 0.24.7
diff --git a/Cargo.toml b/Cargo.toml index a792670..03ee1d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.24.6" +version = "0.24.7" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
c6f4d549a085cb54326a313beaae5a91d505d8c5
daladim
2022-07-19T15:20:45
fix: other operation priorities fix
diff --git a/src/apple/system.rs b/src/apple/system.rs index 9c55f4a..b526c36 100644 --- a/src/apple/system.rs +++ b/src/apple/system.rs @@ -247,16 +247,14 @@ impl SystemExt for System { // * used to hold data that was read speculatively from disk but // * haven't actually been used ...
1
8
10
9cfe9493ec73b456ff11c7321d402a163e87235c
daladim
2022-07-19T14:57:58
fix: fixed Windows boot time That's a fixup of 87773f69e3a128d3071d9d1702fc127083adf72e, which introduced a wrong operation order
diff --git a/src/windows/system.rs b/src/windows/system.rs index 6abd30d..a006602 100644 --- a/src/windows/system.rs +++ b/src/windows/system.rs @@ -73,7 +73,7 @@ unsafe impl<T> Sync for Wrap<T> {} unsafe fn boot_time() -> u64 { match SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) { - Ok(n) => ...
1
1
1
bff5bbc70aeec2009c5c72a366a2b5d53dc0e923
daladim
2022-07-06T15:15:07
[minor] Updated doc
diff --git a/src/common.rs b/src/common.rs index 2f0eae3..2710204 100644 --- a/src/common.rs +++ b/src/common.rs @@ -283,7 +283,7 @@ on Windows as other platforms get this information alongside the Process informa ); } -/// Used to determine what you want to refresh specifically on the [`Process`] type. +/// Us...
2
4
4
9e0bcf8b8d3e29692e89a29b87d57e7c2deb6667
Guillaume Gomez
2022-07-06T09:22:25
Update crate version to 0.24.6
diff --git a/Cargo.toml b/Cargo.toml index d2ad863..a792670 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.24.5" +version = "0.24.6" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
77a6b2d4deaf9f2647275a51ecc64e7df8d7f518
Guillaume Gomez
2022-07-05T20:52:18
Fix memory leak on mac for disk API
diff --git a/src/apple/macos/disk.rs b/src/apple/macos/disk.rs index 7cc5a83..a1f54fe 100644 --- a/src/apple/macos/disk.rs +++ b/src/apple/macos/disk.rs @@ -33,6 +33,31 @@ fn to_path(mount_path: &[c_char]) -> Option<PathBuf> { } } +#[repr(transparent)] +struct CFReleaser<T>(*const T); + +impl<T> CFReleaser<T> {...
1
34
11
43376400a8163eb3f9cc5257b0733373152d5aed
Guillaume Gomez
2022-07-05T22:03:26
Raise the limit a bit for diff of processes
diff --git a/src/lib.rs b/src/lib.rs index 15512e9..257bbb8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -458,8 +458,8 @@ mod test { let new_total = s.processes().len() as isize; // There should be almost no difference in the processes count. assert!( - (new_total - total).abs() < 5...
1
2
2
60d3147a3ccafd8aea636c3dd89b6c3150c255ce
Guillaume Gomez
2022-07-05T20:55:50
Fix invalid cast for C interface
diff --git a/src/c_interface.rs b/src/c_interface.rs index e7cc535..0914a81 100644 --- a/src/c_interface.rs +++ b/src/c_interface.rs @@ -462,7 +462,7 @@ pub extern "C" fn sysinfo_process_current_directory(process: CProcess) -> RStrin pub extern "C" fn sysinfo_rstring_free(s: RString) { if !s.is_null() { ...
1
1
1
fb2366dd691269506a5b295ba92c405f27c69723
sangluo
2022-07-01T07:20:15
fix cpu_usage return 0 on mac m1
diff --git a/src/apple/macos/process.rs b/src/apple/macos/process.rs index 126d297..fbe0147 100644 --- a/src/apple/macos/process.rs +++ b/src/apple/macos/process.rs @@ -202,7 +202,9 @@ pub(crate) fn compute_cpu_usage( .saturating_add(task_info.pti_total_user); let total_time_diff = total...
1
7
6
c2aea9c970915aa1faaca652f26feae08f63ace9
Guillaume Gomez
2022-06-17T14:51:12
Update crate version to 0.24.5
diff --git a/Cargo.toml b/Cargo.toml index dc1deee..d2ad863 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.24.4" +version = "0.24.5" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
3451ee303629e22544edcbec36c4f4e880fe795c
Guillaume Gomez
2022-06-17T09:24:27
Only import `once_cell` on linux and windows
diff --git a/Cargo.toml b/Cargo.toml index 1ded7cd..dc1deee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,8 @@ edition = "2018" [dependencies] cfg-if = "1.0" rayon = { version = "^1.5.1", optional = true } + +[target.'cfg(any(windows, target_os = "linux", target_os = "android"))'.dependencies] once_cell = "...
1
2
0
38b7cd9929342567f8f206990ffda8a318e8c4a9
Arpan Kapoor
2022-06-17T04:22:01
Implement Hash for Uid and Gid
diff --git a/src/common.rs b/src/common.rs index 15cbe87..2f0eae3 100644 --- a/src/common.rs +++ b/src/common.rs @@ -667,7 +667,7 @@ macro_rules! xid { ($(#[$outer:meta])+ $name:ident, $type:ty) => { $(#[$outer])+ #[repr(transparent)] - #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug...
1
1
1
14c73b904e22b0ccd22b8f05d600c4f5cf313107
Guillaume Gomez
2022-06-16T10:57:25
Update crate version to 0.24.4
diff --git a/Cargo.toml b/Cargo.toml index e10833e..1ded7cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.24.3" +version = "0.24.4" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
9cae8c2e1eaf726373036d261295bf1d1f6fe2e8
MarkRx
2022-06-15T18:09:47
Reformat code
diff --git a/src/windows/process.rs b/src/windows/process.rs index b90b20e..1cf41a6 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -48,8 +48,8 @@ use winapi::um::securitybaseapi::GetTokenInformation; use winapi::um::winbase::{GetProcessIoCounters, CREATE_NO_WINDOW}; use winapi::um::winnt::{ ...
1
11
7
784a4a887dea342ec44f3533a0664dfc5746dc8c
MarkRx
2022-06-15T18:04:29
Attempt to open Windows process with PROCESS_QUERY_LIMITED_INFORMATION if elevated access is denied
diff --git a/src/windows/process.rs b/src/windows/process.rs index bdc35c5..b90b20e 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -48,7 +48,7 @@ use winapi::um::securitybaseapi::GetTokenInformation; use winapi::um::winbase::{GetProcessIoCounters, CREATE_NO_WINDOW}; use winapi::um::winnt::{ ...
1
11
3
cf0f49ad18fd6495eed3ddcec44f849883c16e0f
Guillaume Gomez
2022-06-10T14:06:15
Update crate version to 0.24.3
diff --git a/Cargo.toml b/Cargo.toml index a5b062c..e10833e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.24.2" +version = "0.24.3" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
3d3ab9b15df6151eda77a443507e11fd21b0c500
Guillaume Gomez
2022-06-10T12:14:01
Add regression test for System::refresh_processes
diff --git a/src/lib.rs b/src/lib.rs index 977de23..15512e9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -444,4 +444,23 @@ mod test { assert_ne!(proc_.frequency(), 0); } } + + // In case `Process::updated` is misused, `System::refresh_processes` might remove them + // so this test ensure...
1
19
0
1d9581d4751f3c384c2183a8274aeed1e3fa94f9
Guillaume Gomez
2022-06-10T11:37:02
FreeBSD: Improve processes refresh
diff --git a/src/freebsd/process.rs b/src/freebsd/process.rs index b3302ed..8053c13 100644 --- a/src/freebsd/process.rs +++ b/src/freebsd/process.rs @@ -249,6 +249,6 @@ pub(crate) unsafe fn get_process_data( old_read_bytes: 0, written_bytes: kproc.ki_rusage.ru_oublock as _, old_written_bytes:...
2
3
6
d70f36b67f09b5e172efdef02584d7a9682db539
Guillaume Gomez
2022-06-10T11:18:51
macOS: Fix invalid handle of processes refresh
diff --git a/src/apple/macos/process.rs b/src/apple/macos/process.rs index f146126..126d297 100644 --- a/src/apple/macos/process.rs +++ b/src/apple/macos/process.rs @@ -30,7 +30,7 @@ pub struct Process { old_stime: u64, start_time: u64, run_time: u64, - updated: bool, + pub(crate) updated: bool, ...
2
27
34
d321602d5530955befbe6e81c8c0387398d8ed5e
Guillaume Gomez
2022-06-07T10:27:03
Update crate version to 0.24.2
diff --git a/Cargo.toml b/Cargo.toml index ce79559..a5b062c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.24.1" +version = "0.24.2" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
3f01bce6948be27dac81d54f28e43de14de2b795
Guillaume Gomez
2022-06-07T09:26:01
Add test to ensure that the CPU usage is computed
diff --git a/src/lib.rs b/src/lib.rs index 3258a70..977de23 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -258,6 +258,24 @@ mod test { .any(|(_, proc_)| proc_.cpu_usage() > 0.0)); } + #[test] + fn check_cpu_usage() { + if !System::IS_SUPPORTED { + return; + } + le...
1
18
0
525abc780e43d370466312b84c6a4f2c035a2451
Guillaume Gomez
2022-06-07T09:19:50
Fix Windows CPU computation
diff --git a/src/windows/system.rs b/src/windows/system.rs index d14467b..6abd30d 100644 --- a/src/windows/system.rs +++ b/src/windows/system.rs @@ -110,14 +110,14 @@ impl SystemExt for System { self.query = Query::new(); if let Some(ref mut query) = self.query { add_english_c...
1
2
2
ac887dcbbe27660b48f3e2efab2a53b81b5a616c
Guillaume Gomez
2022-06-07T09:09:37
Fix path retrieval on mac
diff --git a/src/apple/macos/process.rs b/src/apple/macos/process.rs index f765c2f..f146126 100644 --- a/src/apple/macos/process.rs +++ b/src/apple/macos/process.rs @@ -247,12 +247,14 @@ pub(crate) fn compute_cpu_usage( p.updated = true; }*/ +#[inline] pub(crate) fn has_been_updated(p: &mut Process) -> bool { ...
1
39
13
f70c6dde91670542d95a7dc12295c8067628b0bf
Guillaume Gomez
2022-06-07T09:00:29
Add missing feature on winapi
diff --git a/Cargo.toml b/Cargo.toml index 6fc6f73..ce79559 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,7 @@ once_cell = "1.0" [target.'cfg(windows)'.dependencies] # FIXME: remove std feature once https://github.com/retep998/winapi-rs/pull/1003 has been merged. winapi = { version = "0.3.9", features = [ + ...
1
1
0
33b5700bbe82248dace47e81981199240ef64abd
Guillaume Gomez
2022-06-04T16:05:24
Update crate version to 0.24.1
diff --git a/Cargo.toml b/Cargo.toml index 079a931..6fc6f73 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.24.0" +version = "0.24.1" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CPU...
1
1
1
87773f69e3a128d3071d9d1702fc127083adf72e
Guillaume Gomez
2022-06-04T15:19:12
Use `saturating_*` for mathematical operations
diff --git a/src/apple/disk.rs b/src/apple/disk.rs index 4e58900..9f0b4a3 100644 --- a/src/apple/disk.rs +++ b/src/apple/disk.rs @@ -56,7 +56,7 @@ impl DiskExt for Disk { let mut stat: statfs = mem::zeroed(); let mount_point_cpath = to_cpath(&self.mount_point); if statfs(mount_poi...
16
99
78
cba2037826465116d3d3410e7a785d7baea537d9
Guillaume Gomez
2022-06-03T23:11:14
Update crate version to 0.24.0
diff --git a/Cargo.toml b/Cargo.toml index cc8411f..079a931 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.23.15" +version = "0.24.0" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, CP...
1
1
1
121f27616344b04aefac8d3339820eec8900bb69
Guillaume Gomez
2022-06-03T23:02:35
Add missing refresh guard for linux user information retrieval
diff --git a/src/linux/process.rs b/src/linux/process.rs index 818d30b..712c163 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -354,6 +354,14 @@ pub(crate) fn _get_process_data( if refresh_kind.disk_usage() { update_process_disk_activity(entry, path); } + if refres...
1
15
5
da1c65c1e34fa2a4bbee441a1616613423217037
Guillaume Gomez
2022-05-18T18:51:00
Create new CpuRefreshKind type, allowing to not retrieve frequency information
diff --git a/src/apple/processor.rs b/src/apple/processor.rs index 38c51e1..ffa32aa 100644 --- a/src/apple/processor.rs +++ b/src/apple/processor.rs @@ -2,7 +2,7 @@ use crate::sys::system::get_sys_value; -use crate::ProcessorExt; +use crate::{CpuRefreshKind, ProcessorExt}; use libc::{c_char, host_processor_info...
13
443
227
138508f60d8cc8dcefa3d4265672bb0d6314fcd2
Guillaume Gomez
2022-06-03T21:47:37
Fix warnings for iOS builds
diff --git a/src/apple/system.rs b/src/apple/system.rs index fd72299..6e59252 100644 --- a/src/apple/system.rs +++ b/src/apple/system.rs @@ -2,6 +2,7 @@ use crate::sys::component::Component; use crate::sys::disk::*; +#[cfg(target_os = "macos")] use crate::sys::ffi; use crate::sys::network::Networks; use crate::s...
3
7
3
3baf4c9d32c01e9a0d217eff3e102cab1fcf4114
Guillaume Gomez
2022-06-03T19:12:00
Add `user` into `ProcessRefreshKind`
diff --git a/src/common.rs b/src/common.rs index b2353bc..55aa98a 100644 --- a/src/common.rs +++ b/src/common.rs @@ -93,9 +93,12 @@ cfg_if::cfg_if! { } macro_rules! impl_get_set { - ($ty_name:ident, $name:ident, $with:ident, $without:ident) => { - #[doc = concat!("Returns the value of the \"", stringify!(...
3
43
9
e0b39fc6c4034bc73a3d0f623d9f6b9855e20f55
Guillaume Gomez
2022-06-03T18:42:46
Simplify mac process source code
diff --git a/src/apple/macos/process.rs b/src/apple/macos/process.rs index 4b78420..6aa3c3d 100644 --- a/src/apple/macos/process.rs +++ b/src/apple/macos/process.rs @@ -76,47 +76,6 @@ impl Process { } } - #[allow(clippy::too_many_arguments)] - pub(crate) fn new_with( - pid: Pid, - pa...
1
9
53
3158b0c3fe85c8a8c8436e91130c8565ee15c28e
Guillaume Gomez
2022-06-03T15:34:20
Support new User API on macOS
diff --git a/src/apple/app_store/process.rs b/src/apple/app_store/process.rs index ca9f78d..8c3348e 100644 --- a/src/apple/app_store/process.rs +++ b/src/apple/app_store/process.rs @@ -2,7 +2,7 @@ use std::path::Path; -use crate::{DiskUsage, Pid, ProcessExt, ProcessStatus, Signal}; +use crate::{DiskUsage, Gid, Pid...
2
29
15
ebf65c92dfa05a73f2085dd64544dbbec471999c
Guillaume Gomez
2022-06-03T15:11:11
Support new User API on unsupported targets
diff --git a/src/unknown/process.rs b/src/unknown/process.rs index 29215e2..c4656d3 100644 --- a/src/unknown/process.rs +++ b/src/unknown/process.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use crate::{DiskUsage, Pid, ProcessExt, ProcessStatus, Signal}; +use cr...
1
9
1
a90d92fb5b8bfdb2135aeda670be253ab2ba5179
Guillaume Gomez
2022-06-03T15:06:18
Support new User API on freebsd
diff --git a/src/freebsd/process.rs b/src/freebsd/process.rs index 2d8c5c4..652cf89 100644 --- a/src/freebsd/process.rs +++ b/src/freebsd/process.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use crate::{DiskUsage, Pid, ProcessExt, ProcessRefreshKind, ProcessStat...
1
13
7
0110c6ce67652f9f2e65021053ffc49f34da3f95
Guillaume Gomez
2022-06-03T14:33:19
Support new User API on windows
diff --git a/Cargo.toml b/Cargo.toml index 0fe51c4..2d2b5b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,37 @@ once_cell = "1.0" [target.'cfg(windows)'.dependencies] # FIXME: remove std feature once https://github.com/retep998/winapi-rs/pull/1003 has been merged. -winapi = { version = "0.3.9", features = [...
9
325
273
a9959e4da39a8a1b6db8ae061f9efe0197fbe275
Guillaume Gomez
2022-06-02T15:52:21
Extend User and Process APIs: * Add `SystemExt::get_user_by_id`. * Rename `UserExt::uid` into `UserExt::id`. * Rename `UserExt::gid` into `UserExt::group_id`. * Add `ProcessExt::user_id`. * Add `ProcessExt::group_id`. Make the updates for Linux.
diff --git a/src/common.rs b/src/common.rs index 48796d7..f14c4c5 100644 --- a/src/common.rs +++ b/src/common.rs @@ -669,11 +669,11 @@ pub struct User { } impl UserExt for User { - fn uid(&self) -> Uid { + fn id(&self) -> Uid { self.uid } - fn gid(&self) -> Gid { + fn group_id(&self) -> ...
4
96
25
1019913cbf050a70891c1b4b7a179551c00304aa
Guillaume Gomez
2022-06-02T14:46:15
Get User ID on windows as well
diff --git a/src/windows/process.rs b/src/windows/process.rs index 3cf1386..d2009f0 100644 --- a/src/windows/process.rs +++ b/src/windows/process.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use crate::{DiskUsage, Pid, ProcessExt, ProcessStatus, Signal}; +use cr...
2
59
4
0b779ef69fa68d0d99e37c8d1f2555fe4cbe0864
Guillaume Gomez
2022-05-29T20:29:46
use SID directly instead of PSID
diff --git a/src/common.rs b/src/common.rs index b77460a..48796d7 100644 --- a/src/common.rs +++ b/src/common.rs @@ -576,7 +576,7 @@ pub struct LoadAvg { macro_rules! xid { ($(#[$outer:meta])+ $name:ident, $type:ty) => { $(#[$outer])+ - #[derive(PartialEq, Eq, PartialOrd, Ord, Debug)] + #[d...
3
56
49
28883163c539d08765f33382515543b105ad9ea3
Guillaume Gomez
2022-05-24T20:24:29
Get Windows Process user
diff --git a/Cargo.toml b/Cargo.toml index f99095a..0fe51c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ once_cell = "1.0" [target.'cfg(windows)'.dependencies] # FIXME: remove std feature once https://github.com/retep998/winapi-rs/pull/1003 has been merged. -winapi = { version = "0.3.9", features = ["...
5
174
46
599475b7d8f298ad614b9f5147e12bd69a04f7fe
Guillaume Gomez
2022-05-24T20:57:28
Update crate version to 0.23.15
diff --git a/Cargo.toml b/Cargo.toml index 2fedfc7..f99095a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.23.14" +version = "0.23.15" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, p...
1
1
1
59918a79e845bc1c6a2217ea8a82e8bc524ebe56
Guillaume Gomez
2022-05-24T14:18:08
Improve retrieval of user ID on linux
diff --git a/src/linux/process.rs b/src/linux/process.rs index fa39b6b..10c0b14 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -5,6 +5,7 @@ use std::collections::HashMap; use std::fmt; use std::fs::{self, File}; use std::io::Read; +use std::mem::MaybeUninit; use std::path::{Path, PathBuf}; use std...
1
25
10
f8c7ae4aecd6c12a1eada045bf95b00c4a9b21fb
Guillaume Gomez
2022-05-24T20:30:47
Add new benchmark for new ProcessList creation
diff --git a/benches/basic.rs b/benches/basic.rs index 0d92aa0..a9771e7 100644 --- a/benches/basic.rs +++ b/benches/basic.rs @@ -48,6 +48,14 @@ fn bench_refresh_processes(b: &mut test::Bencher) { }); } +#[bench] +fn bench_first_refresh_processes(b: &mut test::Bencher) { + b.iter(move || { + let mut s ...
1
8
0
fb2f3d4f75133c8c8212dc7b6eba51f1dac30933
Guillaume Gomez
2022-05-24T14:20:44
Update crate version to 0.23.14
diff --git a/Cargo.toml b/Cargo.toml index 9345a41..2fedfc7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.23.13" +version = "0.23.14" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, p...
1
1
1
649d1d94ac876ab93c5779a909b7a11290df9374
haixuanTao
2022-05-24T13:47:12
Adding comment of the division
diff --git a/src/linux/process.rs b/src/linux/process.rs index 7c5232d..fa39b6b 100644 --- a/src/linux/process.rs +++ b/src/linux/process.rs @@ -456,7 +456,8 @@ fn update_time_and_memory( if entry.memory >= parent_memory { entry.memory -= parent_memory; } - // vsz + // vsz c...
1
2
1
f85179b87e5a8148baba1b899ddd3474b385d981
Xavier Tao
2022-05-24T06:42:05
Dividing Virtual Memory by 1_000 to have kb + Fixing Clippy warnings
diff --git a/src/apple/process.rs b/src/apple/process.rs index 61270d4..e0f005b 100644 --- a/src/apple/process.rs +++ b/src/apple/process.rs @@ -33,7 +33,7 @@ impl fmt::Display for ProcessStatus { } /// Enum describing the different status of a thread. -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, Par...
5
8
8
e5cc6d41a01b11cba6f06f7f9c0757a50a2221f8
Guillaume Gomez
2022-05-20T19:26:24
Update crate version to 0.23.13
diff --git a/Cargo.toml b/Cargo.toml index 0e36c23..9345a41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.23.12" +version = "0.23.13" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, p...
1
1
1
f6aa050732c2ffc9fc1e93979b94df065b661eb6
Guillaume Gomez
2022-05-20T19:18:51
Use HashMap::retain instead of using another Vec to keep track of items to delete
diff --git a/src/linux/system.rs b/src/linux/system.rs index 0b5147a..67124ba 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -210,20 +210,16 @@ impl System { (0., false, 0.) }; - // FIXME: once `retain_mut` has been stabilized, remove `to_delete`. - let mut to_delete...
1
7
11
08f0cbff72098ea0c4b3d91142a5b457d91f7c1c
Guillaume Gomez
2022-05-20T18:55:19
Fix System::refresh_process on freebsd as well
diff --git a/src/freebsd/process.rs b/src/freebsd/process.rs index e5828f2..2d8c5c4 100644 --- a/src/freebsd/process.rs +++ b/src/freebsd/process.rs @@ -144,10 +144,10 @@ pub(crate) unsafe fn get_process_data( fscale: f32, now: u64, refresh_kind: ProcessRefreshKind, -) -> Option<Process> { +) -> Result<O...
2
26
24
30d13968256f5b7cdb54b6b9e0719b9e08886f1f
Guillaume Gomez
2022-05-20T16:06:12
Fix process test
diff --git a/tests/process.rs b/tests/process.rs index 0a8e584..6745fc4 100644 --- a/tests/process.rs +++ b/tests/process.rs @@ -375,7 +375,7 @@ fn test_refresh_process() { // Let's give some time to the system to clean up... std::thread::sleep(std::time::Duration::from_secs(1)); - s.refresh_process(pid)...
1
1
1
6a206ee7f34e3a0c1b251c7d19a553c5b29aefeb
Guillaume Gomez
2022-05-20T16:06:04
Add check to ensure that pid is still alive
diff --git a/src/apple/macos/process.rs b/src/apple/macos/process.rs index 7d1af2e..082ac18 100644 --- a/src/apple/macos/process.rs +++ b/src/apple/macos/process.rs @@ -302,6 +302,14 @@ unsafe fn get_task_info(pid: Pid) -> libc::proc_taskinfo { task_info } +fn check_if_pid_is_alive(pid: Pid) -> bool { + unsa...
1
19
2
7792493e2814d15e820b74a15d6fe1781810310c
Min Kim
2022-05-18T19:09:07
Fix a typo in documentation
diff --git a/src/traits.rs b/src/traits.rs index fd214fd..64d8c32 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -947,7 +947,7 @@ pub trait SystemExt: Sized + Debug + Default + Send + Sync { /// ``` fn available_memory(&self) -> u64; - /// Returns the amound of used RAM in KB. + /// Returns the amo...
1
1
1
ecb201f8f0d79004cc5d5e0ecd38b2dec75852db
Guillaume Gomez
2022-05-10T09:41:37
Update crate version to 0.23.12
diff --git a/Cargo.toml b/Cargo.toml index efa6e68..0e36c23 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sysinfo" -version = "0.23.11" +version = "0.23.12" authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"] description = "Library to get system information such as processes, p...
1
1
1
f37187d0a0db59faea6952f3ce793d101a43f90d
Guillaume Gomez
2022-05-10T09:42:57
Add comment about `get_cpu_frequency` in linux `System::refresh_processors`
diff --git a/src/linux/system.rs b/src/linux/system.rs index 5919bb9..0b5147a 100644 --- a/src/linux/system.rs +++ b/src/linux/system.rs @@ -329,6 +329,7 @@ impl System { val.iter_mut() } + // `get_cpu_frequency` is very slow, so better run it in parallel. self.gl...
1
1
0