-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
not so hard in C but tricky in rust. needed for flamegraphing kprobe's and tracepoint and adding the kernel part to profile.
struct task_struct* __current = (struct task_struct*)bpf_get_current_task();
void* __current_stack_page = __current->stack;
void* __ptr = __current_stack_page + THREAD_SIZE - TOP_OF_KERNEL_STACK_PADDING;
struct pt_regs* _tctx = ((struct pt_regs *)__ptr) - 1;THREAD_SIZE should be 2 * PAGE_SIZE and PAGE_SIZE 4096
TOP_OF_KERNEL_STACK_PADDING should be 0 on x86_64