Skip to content

Commit 30c5a49

Browse files
committed
Remove support for old performance-mode interface
This interface has been removed a long time ago in favor of the generic platform-profile kernel API. There are no recent kernels using this interface any more, so remove support for it.
1 parent 2555fdc commit 30c5a49

File tree

5 files changed

+3
-277
lines changed

5 files changed

+3
-277
lines changed

src/cli/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
pub mod dgpu;
22
pub mod dtx;
3-
pub mod perf;
43
pub mod profile;
54
pub mod status;
65

@@ -24,7 +23,6 @@ impl Registry {
2423
pub fn build() -> Self {
2524
let list: Vec<Box<dyn Command>> = vec![
2625
Box::new(status::Command),
27-
Box::new(perf::Command),
2826
Box::new(profile::Command),
2927
Box::new(dtx::Command),
3028
Box::new(dgpu::Command),

src/cli/perf.rs

Lines changed: 0 additions & 92 deletions
This file was deleted.

src/cli/status.rs

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,11 @@ impl DynCommand for Command {
3030

3131

3232
struct Stats {
33-
perf: PerfStats,
3433
prof: ProfileStats,
3534
dgpu: DgpuStats,
3635
dtx: DtxStats,
3736
}
3837

39-
struct PerfStats {
40-
mode: Option<sys::perf::Mode>,
41-
}
42-
4338
struct ProfileStats {
4439
current: String,
4540
supported: Vec<String>,
@@ -63,35 +58,20 @@ struct DtxStats {
6358

6459
impl Stats {
6560
fn load() -> Self {
66-
let perf = PerfStats::load();
6761
let prof = ProfileStats::load();
6862
let dgpu = DgpuStats::load();
6963
let dtx = DtxStats::load();
7064

71-
Stats { perf, prof, dgpu, dtx }
65+
Stats { prof, dgpu, dtx }
7266
}
7367

7468
fn available(&self) -> bool {
75-
self.perf.available()
76-
|| self.prof.available()
69+
self.prof.available()
7770
|| self.dgpu.available()
7871
|| self.dtx.available()
7972
}
8073
}
8174

82-
impl PerfStats {
83-
fn load() -> Self {
84-
let mode = sys::perf::Device::open().ok()
85-
.and_then(|device| device.get_mode().ok());
86-
87-
PerfStats { mode }
88-
}
89-
90-
fn available(&self) -> bool {
91-
self.mode.is_some()
92-
}
93-
}
94-
9575
impl ProfileStats {
9676
fn load() -> Self {
9777
let dev = sys::profile::Device::open().ok();
@@ -163,17 +143,7 @@ impl DtxStats {
163143

164144
impl std::fmt::Display for Stats {
165145
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
166-
write!(f, "{}{}{}{}", self.perf, self.prof, self.dgpu, self.dtx)
167-
}
168-
}
169-
170-
impl std::fmt::Display for PerfStats {
171-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
172-
if let Some(mode) = self.mode {
173-
writeln!(f, "Performance Mode: {}\n", mode)
174-
} else {
175-
Ok(())
176-
}
146+
write!(f, "{}{}{}", self.prof, self.dgpu, self.dtx)
177147
}
178148
}
179149

src/sys/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
pub mod pci;
2-
pub mod perf;
32
pub mod profile;
43

54
use thiserror::Error;
@@ -20,9 +19,6 @@ pub enum Error {
2019

2120
#[error("SysFS error")]
2221
SysFs { source: pci::SysFsError },
23-
24-
#[error("Invalid data")]
25-
InvalidData,
2622
}
2723

2824
pub type Result<T> = std::result::Result<T, Error>;

src/sys/perf.rs

Lines changed: 0 additions & 146 deletions
This file was deleted.

0 commit comments

Comments
 (0)