]> Git Repo - linux.git/commit
bpf: introduce bpf_get_current_task() helper
authorAlexei Starovoitov <[email protected]>
Thu, 7 Jul 2016 05:38:36 +0000 (22:38 -0700)
committerDavid S. Miller <[email protected]>
Sat, 9 Jul 2016 04:00:16 +0000 (00:00 -0400)
commit606274c5abd8e245add01bc7145a8cbb92b69ba8
tree762718058c0cf327284f07fa6c1eb2410ee3e0b7
parentd390238c4fba7c87a3bcd859ce3373c864eb7b02
bpf: introduce bpf_get_current_task() helper

over time there were multiple requests to access different data
structures and fields of task_struct current, so finally add
the helper to access 'current' as-is. Tracing bpf programs will do
the rest of walking the pointers via bpf_probe_read().
Note that current can be null and bpf program has to deal it with,
but even dumb passing null into bpf_probe_read() is still safe.

Suggested-by: Brendan Gregg <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
include/uapi/linux/bpf.h
kernel/trace/bpf_trace.c
This page took 0.066372 seconds and 4 git commands to generate.