probe: sysfs helpers don't need to be public

pull/1/head
Alessandro Decina 4 years ago
parent 54637eab04
commit e83a26b307

@ -291,7 +291,7 @@ fn resolve_symbol(path: &str, symbol: &str) -> Result<u64, ResolveSymbolError> {
.ok_or_else(|| ResolveSymbolError::Unknown(symbol.to_string())) .ok_or_else(|| ResolveSymbolError::Unknown(symbol.to_string()))
} }
pub fn read_sys_fs_perf_type(pmu: &str) -> Result<u32, ProgramError> { fn read_sys_fs_perf_type(pmu: &str) -> Result<u32, ProgramError> {
let file = format!("/sys/bus/event_source/devices/{}/type", pmu); let file = format!("/sys/bus/event_source/devices/{}/type", pmu);
let perf_ty = fs::read_to_string(&file).map_err(|e| ProgramError::Other { let perf_ty = fs::read_to_string(&file).map_err(|e| ProgramError::Other {
@ -307,7 +307,7 @@ pub fn read_sys_fs_perf_type(pmu: &str) -> Result<u32, ProgramError> {
Ok(perf_ty) Ok(perf_ty)
} }
pub fn read_sys_fs_perf_ret_probe(pmu: &str) -> Result<u32, ProgramError> { fn read_sys_fs_perf_ret_probe(pmu: &str) -> Result<u32, ProgramError> {
let file = format!("/sys/bus/event_source/devices/{}/format/retprobe", pmu); let file = format!("/sys/bus/event_source/devices/{}/format/retprobe", pmu);
let data = fs::read_to_string(&file).map_err(|e| ProgramError::Other { let data = fs::read_to_string(&file).map_err(|e| ProgramError::Other {

@ -159,6 +159,7 @@ pub(crate) fn bpf_map_get_next_key<K>(
} }
} }
// since kernel 5.7
pub(crate) fn bpf_link_create( pub(crate) fn bpf_link_create(
prog_fd: RawFd, prog_fd: RawFd,
target_fd: RawFd, target_fd: RawFd,

Loading…
Cancel
Save