diff options
author | Carlos Neira <cneirabustos@gmail.com> | 2020-03-04 21:41:56 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-03-13 01:33:11 +0100 |
commit | b4490c5c4e023f09b7d27c9a9d3e7ad7d09ea6bf (patch) | |
tree | 2a1bcba2ff5a85b3fb0e0013b01ac25eef4cc6fa /kernel/trace | |
parent | fs/nsfs.c: Added ns_match (diff) | |
download | linux-b4490c5c4e023f09b7d27c9a9d3e7ad7d09ea6bf.tar.xz linux-b4490c5c4e023f09b7d27c9a9d3e7ad7d09ea6bf.zip |
bpf: Added new helper bpf_get_ns_current_pid_tgid
New bpf helper bpf_get_ns_current_pid_tgid,
This helper will return pid and tgid from current task
which namespace matches dev_t and inode number provided,
this will allows us to instrument a process inside a container.
Signed-off-by: Carlos Neira <cneirabustos@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200304204157.58695-3-cneirabustos@gmail.com
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/bpf_trace.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 6a490d8ce9de..b5071c7e93ca 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -843,6 +843,8 @@ tracing_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) return &bpf_send_signal_thread_proto; case BPF_FUNC_perf_event_read_value: return &bpf_perf_event_read_value_proto; + case BPF_FUNC_get_ns_current_pid_tgid: + return &bpf_get_ns_current_pid_tgid_proto; default: return NULL; } |