forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpf: Expose a bpf_sock_from_file helper to tracing programs
eBPF programs can already check whether a file is a socket using file->f_op == &socket_file_ops but they can not convert file->private_data into a struct socket with BTF information. For that, we need a new helper that is essentially just a wrapper for sock_from_file. sock_from_file can set an err value but this is only set to -ENOTSOCK when the return value is NULL so it's useless superfluous information. Signed-off-by: Florent Revest <revest@google.com>
- Loading branch information
1 parent
09a3dac
commit 7fd0725
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters