Skip to content

Commit d9ab514

Browse files
committed
chore(memtrack): remove unused execve event
1 parent 6545b69 commit d9ab514

4 files changed

Lines changed: 6 additions & 15 deletions

File tree

crates/memtrack/src/ebpf/c/event.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
#define EVENT_TYPE_MALLOC 1
55
#define EVENT_TYPE_FREE 2
6-
#define EVENT_TYPE_EXECVE 3
7-
#define EVENT_TYPE_CALLOC 4
8-
#define EVENT_TYPE_REALLOC 5
9-
#define EVENT_TYPE_ALIGNED_ALLOC 6
10-
#define EVENT_TYPE_MMAP 7
11-
#define EVENT_TYPE_MUNMAP 8
12-
#define EVENT_TYPE_BRK 9
6+
#define EVENT_TYPE_CALLOC 3
7+
#define EVENT_TYPE_REALLOC 4
8+
#define EVENT_TYPE_ALIGNED_ALLOC 5
9+
#define EVENT_TYPE_MMAP 6
10+
#define EVENT_TYPE_MUNMAP 7
11+
#define EVENT_TYPE_BRK 8
1312

1413
/* Event structure - shared between BPF and userspace */
1514
struct event {

crates/memtrack/src/ebpf/c/memtrack.bpf.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,6 @@ UPROBE_WITH_ARGS(aligned_alloc, PT_REGS_PARM2(ctx), PT_REGS_RC(ctx), EVENT_TYPE_
195195
/* memalign: allocates with alignment and size (legacy interface) */
196196
UPROBE_WITH_ARGS(memalign, PT_REGS_PARM2(ctx), PT_REGS_RC(ctx), EVENT_TYPE_ALIGNED_ALLOC)
197197

198-
SEC("tracepoint/syscalls/sys_enter_execve")
199-
int tracepoint_sys_execve(struct trace_event_raw_sys_enter* ctx) { return submit_event(0, 0, EVENT_TYPE_EXECVE); }
200-
201198
/* Map to store mmap parameters between entry and return */
202199
struct mmap_args {
203200
__u64 addr;

crates/memtrack/src/ebpf/events.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use bindings::*;
1717
pub enum EventType {
1818
Malloc = EVENT_TYPE_MALLOC as u8,
1919
Free = EVENT_TYPE_FREE as u8,
20-
Execve = EVENT_TYPE_EXECVE as u8,
2120
Calloc = EVENT_TYPE_CALLOC as u8,
2221
Realloc = EVENT_TYPE_REALLOC as u8,
2322
AlignedAlloc = EVENT_TYPE_ALIGNED_ALLOC as u8,
@@ -31,7 +30,6 @@ impl From<u8> for EventType {
3130
match val as u32 {
3231
bindings::EVENT_TYPE_MALLOC => EventType::Malloc,
3332
bindings::EVENT_TYPE_FREE => EventType::Free,
34-
bindings::EVENT_TYPE_EXECVE => EventType::Execve,
3533
bindings::EVENT_TYPE_CALLOC => EventType::Calloc,
3634
bindings::EVENT_TYPE_REALLOC => EventType::Realloc,
3735
bindings::EVENT_TYPE_ALIGNED_ALLOC => EventType::AlignedAlloc,
@@ -66,7 +64,6 @@ impl From<Event> for MemtrackEvent {
6664
EventType::Mmap => MemtrackEventKind::Mmap { size: val.size },
6765
EventType::Munmap => MemtrackEventKind::Munmap { size: val.size },
6866
EventType::Brk => MemtrackEventKind::Brk { size: val.size },
69-
_ => panic!("This event isn't meant to be used outside of memtrack"),
7067
};
7168

7269
MemtrackEvent {

crates/memtrack/src/ebpf/memtrack.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,9 @@ impl MemtrackBpf {
350350
Ok(())
351351
}
352352
attach_tracepoint!(sched_fork);
353-
attach_tracepoint!(sys_execve);
354353

355354
pub fn attach_tracepoints(&mut self) -> Result<()> {
356355
self.attach_sched_fork()?;
357-
self.attach_sys_execve()?;
358356
Ok(())
359357
}
360358

0 commit comments

Comments
 (0)