MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / privilege_status

Method privilege_status

src/executor/memory/executor.rs:122–141  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

120 }
121
122 fn privilege_status(&self) -> Option<PrivilegeStatus> {
123 if is_root_user() {
124 return Some(PrivilegeStatus::Satisfied {
125 detail: "running as root".to_string(),
126 });
127 }
128 if has_delegated_bpf_token() {
129 return Some(PrivilegeStatus::Satisfied {
130 detail: "delegated BPF token".to_string(),
131 });
132 }
133 if has_memtrack_capabilities() {
134 return Some(PrivilegeStatus::Satisfied {
135 detail: "capabilities granted".to_string(),
136 });
137 }
138 Some(PrivilegeStatus::Missing {
139 message: "capabilities missing, run `codspeed setup --mode memory`".to_string(),
140 })
141 }
142
143 fn support_level(&self, system_info: &SystemInfo) -> ExecutorSupport {
144 match &system_info.os {

Callers

nothing calls this directly

Calls 3

is_root_userFunction · 0.85
has_delegated_bpf_tokenFunction · 0.85

Tested by

no test coverage detected