-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonitor_syscalls.bt
executable file
·56 lines (45 loc) · 1 KB
/
monitor_syscalls.bt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/bpftrace
tracepoint:syscalls:sys_enter_io_uring_setup
{
@sys_enter_io_uring_setup[comm] = count();
}
tracepoint:syscalls:sys_enter_io_uring_enter
{
@sys_enter_io_uring_enter[comm] = count();
}
tracepoint:syscalls:sys_enter_openat
{
@sys_enter_openat[comm] = count();
}
tracepoint:syscalls:sys_enter_read
{
@sys_enter_read[comm] = count();
}
tracepoint:syscalls:sys_enter_write
{
@sys_enter_write[comm] = count();
}
tracepoint:syscalls:sys_enter_fsync
{
@sys_enter_fsync[comm] = count();
}
tracepoint:syscalls:sys_enter_close
{
@sys_enter_close[comm] = count();
}
tracepoint:syscalls:sys_enter_mmap
{
@sys_enter_mmap[comm] = count();
}
// Programs are executed by first making execve syscall
tracepoint:syscalls:sys_enter_execve
{
@execve_call_time[tid] = nsecs;
}
// All test programs must call getpid first so we know we have hit main()
tracepoint:syscalls:sys_exit_getpid
/@execve_call_time[tid]/
{
@time_to_main[comm] = (nsecs - @execve_call_time[tid]);
delete(@execve_call_time[tid]);
}