Pass config from main to the relevant places
This commit is contained in:
@@ -30,7 +30,6 @@ struct PerfEventAttr {
|
||||
sig_data: u64,
|
||||
}
|
||||
|
||||
const PERF_TYPE_RAW: u32 = 4;
|
||||
const PERF_FORMAT_TOTAL_TIME_ENABLED: u64 = 1;
|
||||
const PERF_FORMAT_TOTAL_TIME_RUNNING: u64 = 2;
|
||||
|
||||
@@ -95,8 +94,8 @@ impl I915Engine {
|
||||
fn open(name: &str) -> io::Result<Self> {
|
||||
let base = "/sys/bus/event_source/devices/i915";
|
||||
|
||||
let pmu_type = read_number(&format!("{base}/type")).unwrap() as u32;
|
||||
let config = read_config(&format!("{base}/events/{name}")).unwrap();
|
||||
let pmu_type = read_number(&format!("{base}/type"))? as u32;
|
||||
let config = read_config(&format!("{base}/events/{name}"))?;
|
||||
|
||||
let mut attr = PerfEventAttr::default();
|
||||
attr.type_ = pmu_type;
|
||||
|
||||
Reference in New Issue
Block a user