summaryrefslogtreecommitdiff
path: root/maps.bpf.h
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-02-13 10:26:47 +0200
committerPaul Buetow <paul@buetow.org>2024-02-13 10:26:47 +0200
commita1b917899d564d681f0dce682583d951e0c8a3ae (patch)
treefa7a7594a5a855d4f5019543827f7a4e783e2d56 /maps.bpf.h
parente43fba8ef47a7a435809ebc09c799254c1c1fcf7 (diff)
collect enter and exit times of the syscall tracepoints
Diffstat (limited to 'maps.bpf.h')
-rw-r--r--maps.bpf.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/maps.bpf.h b/maps.bpf.h
index 3cdfe25..d0bcb2f 100644
--- a/maps.bpf.h
+++ b/maps.bpf.h
@@ -1,11 +1,13 @@
//+build ignore
+#define TEMP_MAP_SIZES 1024 // Adjust size as needed
+
struct open_event {
int fd;
int op_id;
u32 tid;
- long enter_time;
- long exit_time;
+ __u64 enter_time;
+ __u64 exit_time;
char filename[256];
char comm[16];
};
@@ -21,15 +23,15 @@ struct {
__uint(type, BPF_MAP_TYPE_HASH);
__uint(key_size, sizeof(u32));
__uint(value_size, sizeof(struct open_event));
- __uint(max_entries, 128); // Adjust size as needed
+ __uint(max_entries, TEMP_MAP_SIZES);
} open_event_temp_map SEC(".maps");
struct fd_event {
int fd;
int op_id;
u32 tid;
- long enter_time;
- long exit_time;
+ __u64 enter_time;
+ __u64 exit_time;
};
struct {
@@ -38,3 +40,10 @@ struct {
__uint(value_size, sizeof(u32));
} fd_event_map SEC(".maps");
+// Map to temporarily store info from the enter tracepoinut for the exit one
+struct {
+ __uint(type, BPF_MAP_TYPE_HASH);
+ __uint(key_size, sizeof(u32));
+ __uint(value_size, sizeof(struct fd_event));
+ __uint(max_entries, TEMP_MAP_SIZES);
+} fd_event_temp_map SEC(".maps");