diff options
| author | David S. Miller <davem@davemloft.net> | 2015-06-15 15:53:50 -0700 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-06-15 15:58:26 -0700 |
| commit | 9f42c8b3ebc80e8a544bcf726689d51c7e1e0fc8 (patch) | |
| tree | 6b4c9543550d114d75fad4362c6ef526a0d24b77 /include/uapi | |
| parent | ada6c1de9ecabcfc5619479bcd29a208f2e248a0 (diff) | |
| parent | ab1973d3258aa8c40d153dc12bbb1aac56731e47 (diff) | |
Merge branch 'bpf-share-helpers'
Alexei Starovoitov says:
====================
v1->v2: switched to init_user_ns from current_user_ns as suggested by Andy
Introduce new helpers to access 'struct task_struct'->pid, tgid, uid, gid, comm
fields in tracing and networking.
Share bpf_trace_printk() and bpf_get_smp_processor_id() helpers between
tracing and networking.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi')
| -rw-r--r-- | include/uapi/linux/bpf.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 602f05b7a275..29ef6f99e43d 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -230,6 +230,25 @@ enum bpf_func_id { * Return: 0 on success */ BPF_FUNC_clone_redirect, + + /** + * u64 bpf_get_current_pid_tgid(void) + * Return: current->tgid << 32 | current->pid + */ + BPF_FUNC_get_current_pid_tgid, + + /** + * u64 bpf_get_current_uid_gid(void) + * Return: current_gid << 32 | current_uid + */ + BPF_FUNC_get_current_uid_gid, + + /** + * bpf_get_current_comm(char *buf, int size_of_buf) + * stores current->comm into buf + * Return: 0 on success + */ + BPF_FUNC_get_current_comm, __BPF_FUNC_MAX_ID, }; |
