resolve_func_ip

Function resolve_func_ip 

Source
pub fn resolve_func_ip(name: &str) -> Option<u64>
Expand description

Resolve a kernel function name to its address via /proc/kallsyms.

The parsed name -> address map is cached on first successful load so later lookups avoid re-reading and re-splitting ~200k lines. Callers that resolve many functions in a batch (auto-probe attach, probe-stack load) drop from O(N*M) line scans to O(N) hash lookups.

A failed load (unreadable /proc/kallsyms — typical for unprivileged processes where the file is either missing or returns zeroed addresses) is rate-limited to one retry per RETRY_MIN_INTERVAL (1 s); calls within that window return None immediately. This matters both for performance — a caller resolving N symbols under a permanently unreadable /proc/kallsyms pays one load attempt, not N — and for privilege-escalation correctness, where a test harness that re-execs under sudo after the first miss still sees a retry within seconds.