History

bpf: Expose bpf_get_socket_cookie to tracing programs

This needs a new helper that: - can work in a sleepable context (using sock_gen_cookie) - takes a struct sock pointer and checks that it's not NULL

Florent Revest committed 5 years ago

Commit c5dbb891 parent 07881cc5 files · +31 −0Browse files

Showing the changes to tools/include/uapi/linux (1 of 5 files). Show all

Unified · Split

tools/include/uapi/linux/bpf.h+8−0
@@ -1673,6 +1673,14 @@ union bpf_attr { · 1672 unmodified lines
16731673 * Return
16741674 * A 8-byte long unique number.
16751675 *
1676+ * u64 bpf_get_socket_cookie(struct sock *sk)
1677+ * Description
1678+ * Equivalent to **bpf_get_socket_cookie**\ () helper that accepts
1679+ * *sk*, but gets socket from a BTF **struct sock**. This helper
1680+ * also works for sleepable programs.
1681+ * Return
1682+ * A 8-byte long unique number or 0 if *sk* is NULL.
1683+ *
16761684 * u32 bpf_get_socket_uid(struct sk_buff *skb)
16771685 * Return
16781686 * The owner UID of the socket associated to *skb*. If the socket