Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daemon part of FD tracking #218

Merged
merged 5 commits into from
Jan 21, 2025
Merged

Daemon part of FD tracking #218

merged 5 commits into from
Jan 21, 2025

Conversation

Mr-Kanister
Copy link
Contributor

Adds the daemon part of fd tracking. This includes the proto specs, the feature, the collector, the client bindings and the necessary frontend classes.

Bases on #217 so wait until that's merged and change target branch

Closes #207

Mr-Kanister and others added 5 commits January 19, 2025 17:14
Signed-off-by: Mr-Kanister <68117355+Mr-Kanister@users.noreply.github.com>
Co-Authored-by: ffranzgitHub <franz.schlicht@gmail.com>
Signed-off-by: Mr-Kanister <68117355+Mr-Kanister@users.noreply.github.com>
Co-Authored-by: ffranzgitHub <franz.schlicht@gmail.com>
Signed-off-by: Mr-Kanister <68117355+Mr-Kanister@users.noreply.github.com>
Co-Authored-by: ffranzgitHub <franz.schlicht@gmail.com>
Signed-off-by: Mr-Kanister <68117355+Mr-Kanister@users.noreply.github.com>
Co-Authored-by: ffranzgitHub <franz.schlicht@gmail.com>
Signed-off-by: Mr-Kanister <68117355+Mr-Kanister@users.noreply.github.com>
Co-Authored-by: Tom Weisshuhn <tom.weisshuhn@fau.de>
Base automatically changed from 210-ebpf-fds to dev January 21, 2025 14:32
Copy link
Contributor

@der-whity der-whity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@der-whity der-whity merged commit 860ea40 into dev Jan 21, 2025
@der-whity der-whity deleted the 207-daemon-fds branch January 21, 2025 14:35
Comment on lines +98 to +189
self.trace_link_open
.get_or_insert(Self::try_attach_open(&mut self.trace_create_fd, "open")?);
self.trace_link_creat
.get_or_insert(Self::try_attach_open(&mut self.trace_create_fd, "creat")?);
self.trace_link_socket
.get_or_insert(Self::try_attach_open(&mut self.trace_create_fd, "socket")?);
self.trace_link_accept
.get_or_insert(Self::try_attach_open(&mut self.trace_create_fd, "accept")?);
self.trace_link_socketpair
.get_or_insert(Self::try_attach_open(
&mut self.trace_create_fd,
"socketpair",
)?);
self.trace_link_pipe
.get_or_insert(Self::try_attach_open(
&mut self.trace_create_fd,
"pipe",
)?);
self.trace_link_epoll_create
.get_or_insert(Self::try_attach_open(
&mut self.trace_create_fd,
"epoll_create",
)?);
self.trace_link_signalfd
.get_or_insert(Self::try_attach_open(
&mut self.trace_create_fd,
"signalfd",
)?);
self.trace_link_eventfd
.get_or_insert(Self::try_attach_open(&mut self.trace_create_fd, "eventfd")?);
self.trace_link_timerfd_create
.get_or_insert(Self::try_attach_open(
&mut self.trace_create_fd,
"timerfd_create",
)?);
self.trace_link_memfd_create
.get_or_insert(Self::try_attach_open(
&mut self.trace_create_fd,
"memfd_create",
)?);
self.trace_link_userfaultfd
.get_or_insert(Self::try_attach_open(
&mut self.trace_create_fd,
"userfaultfd",
)?);
self.trace_link_fanotify_init
.get_or_insert(Self::try_attach_open(
&mut self.trace_create_fd,
"fanotify_init",
)?);
self.trace_link_inotify_init
.get_or_insert(Self::try_attach_open(
&mut self.trace_create_fd,
"inotify_init",
)?);
self.trace_link_clone
.get_or_insert(Self::try_attach_open(&mut self.trace_create_fd, "clone")?);
self.trace_link_pidfd_open
.get_or_insert(Self::try_attach_open(
&mut self.trace_create_fd,
"pidfd_open",
)?);
self.trace_link_open_by_handle_at
.get_or_insert(Self::try_attach_open(
&mut self.trace_create_fd,
"open_by_handle_at",
)?);

self.trace_link_close
.get_or_insert(Self::try_attach_destroy(
&mut self.trace_destroy_fd,
"close",
)?);
self.trace_link_closefrom
.get_or_insert(Self::try_attach_destroy(
&mut self.trace_destroy_fd,
"closefrom",
)?);
self.trace_link_close_range
.get_or_insert(Self::try_attach_destroy(
&mut self.trace_destroy_fd,
"close_range",
)?);
self.trace_link_dup.get_or_insert(Self::try_attach_open(
&mut self.trace_create_fd,
"dup",
)?);

self.trace_link_openat.get_or_insert(Self::try_attach_open(
&mut self.trace_create_fd,
"openat",
)?);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these exist, use bpftrace -l to find a list of all supported ones or /sys/kernel/debug/tracing/events/syscalls

@der-whity der-whity restored the 207-daemon-fds branch January 22, 2025 08:00
@der-whity der-whity deleted the 207-daemon-fds branch January 23, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Daemon: Integrate File Descriptor Monitoring
4 participants