summaryrefslogtreecommitdiff
path: root/samples/bpf/bpf_helpers.h
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@fb.com>2016-07-06 22:38:36 -0700
committerMichael Bestas <mkbestas@lineageos.org>2022-04-19 00:50:27 +0300
commitc80f66cc54b24c560703b97ffbc289b524b29159 (patch)
treed9b0cf5c9cffcd41de59911ed62bb7cb52419996 /samples/bpf/bpf_helpers.h
parent8dbaaca1649bf054d16c3b63107ce28c493cc2f7 (diff)
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 <brendan.d.gregg@gmail.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Chatur27 <jasonbright2709@gmail.com>
Diffstat (limited to 'samples/bpf/bpf_helpers.h')
0 files changed, 0 insertions, 0 deletions