Add governor information#1057
Conversation
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
3231833 to
31dce84
Compare
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
…mExt Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
31dce84 to
6b48f22
Compare
|
@GuillaumeGomez it's ready to review, it appears that the CI error is not from this patch |
| sys.global_cpu_info().frequency() | ||
| ); | ||
| } | ||
| "governor" => { |
There was a problem hiding this comment.
Why not displaying this information as part of the CPUs directly?
| /// ); | ||
| /// println!("{}%", s.global_cpu_info().cpu_usage()); | ||
| /// ``` | ||
| fn governor(&self) -> GovernorKind; |
There was a problem hiding this comment.
Please remove this from SystemExt, it should only be on CpuExt.
| /// println!("{}", cpu.governor()); | ||
| /// } | ||
| /// ``` | ||
| fn governor(&self) -> GovernorKind; |
There was a problem hiding this comment.
It should return an Option in case this information hasn't been retrieved yet.
|
A few things to change but also: I won't merge this PR until this feature is implemented for all supported systems. |
Is this truly necessary ? Can't we make it an optional and have others OSs implementing it and allowing not having support ? I don't have access to all OSs, and that's open source.. others may add this functionality if it's necessary, I'm just creating the background to support it. |
Yes it is.
The only way to have something optional is in case an OS doesn't support this feature. Otherwise it might very well never be implemented. It also forces to add special handling in tests, meaning more code to maintain.
I do everything with VMs. You can always ask help and see if others are interested into this feature and willing to help you implement it. |
Signed-off-by: Patrick José Pereira patrickelectric@gmail.com