Eunomia  0.1.0
A lightweight eBPF-based CloudNative Monitor tool for Container Security and Observability
uprobe_helpers.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
2 /* Copyright (c) 2021 Google LLC. */
3 #ifndef __UPROBE_HELPERS_H
4 #define __UPROBE_HELPERS_H
5 
6 #include <sys/types.h>
7 #include <unistd.h>
8 #include <gelf.h>
9 
10 int get_pid_binary_path(pid_t pid, char *path, size_t path_sz);
11 int get_pid_lib_path(pid_t pid, const char *lib, char *path, size_t path_sz);
12 int resolve_binary_path(const char *binary, pid_t pid, char *path, size_t path_sz);
13 off_t get_elf_func_offset(const char *path, const char *func);
14 Elf *open_elf(const char *path, int *fd_close);
15 Elf *open_elf_by_fd(int fd);
16 void close_elf(Elf *e, int fd_close);
17 
18 #endif /* __UPROBE_HELPERS_H */
open_elf
Elf * open_elf(const char *path, int *fd_close)
Definition: uprobe_helpers.c:174
resolve_binary_path
int resolve_binary_path(const char *binary, pid_t pid, char *path, size_t path_sz)
Definition: uprobe_helpers.c:143
get_pid_lib_path
int get_pid_lib_path(pid_t pid, const char *lib, char *path, size_t path_sz)
Definition: uprobe_helpers.c:55
open_elf_by_fd
Elf * open_elf_by_fd(int fd)
Definition: uprobe_helpers.c:208
close_elf
void close_elf(Elf *e, int fd_close)
Definition: uprobe_helpers.c:234
get_elf_func_offset
off_t get_elf_func_offset(const char *path, const char *func)
Definition: uprobe_helpers.c:241
get_pid_binary_path
int get_pid_binary_path(pid_t pid, char *path, size_t path_sz)
Definition: uprobe_helpers.c:24