aya-rs/aya

Add a `sycall_fnname` function (in user-space)

vadorovsky opened this issue · 3 comments

Kernel symbols representing syscalls have architecture-specific prefixes. For example, for x86_64 it's __x64 (so sys_execve syscall is evaluated to __x64_sys_execve).

BCC provides a function for resolving syscall names (get_sycall_fnname). It would be nice to have it in Aya as well (with a more Rusty name like syscall_fname or something better). Currently, developers using Aya need to resolve those name manually per architecture, which adds boilerplate code to their projects.

We should definitely not have anything called get_sycall_fnname in our API, but I'm open to a better name 😋

I think we should have something like fn syscall_prefix() -> &str { ... } instead of syscall_fname. syscall_fname("lol") succeeds but isn't really a syscall. Then people would do let syscall_name = format!("{}execve", syscall_prefix());

Done in #625