@@ -26,7 +26,7 @@ BEGIN {
26
26
// netavark and aardvark-dns as they have podman in the path as well but this is
27
27
// good so we can see any errors there as well.
28
28
tracepoint:syscalls:sys_enter_exec*
29
- / strcontains(str(args.argv[0]), "podman") || strcontains(str(args.argv[0]), "conmon") /
29
+ / strcontains(str(args.argv[0], 128), "podman") || strcontains(str(args.argv[0], 128 ), "conmon") /
30
30
{
31
31
32
32
// create entry in pid map so we can check the pid later
@@ -36,7 +36,7 @@ tracepoint:syscalls:sys_enter_exec*
36
36
// I tried matching argv but there seems to be no way to iterate over it.
37
37
// In practise parent name conmon and argv0 podman should contain all the
38
38
// cleanup processes we care about.
39
- if (comm == "conmon" && strcontains(str(args.argv[0]), "podman")) {
39
+ if (comm == "conmon" && strcontains(str(args.argv[0], 128 ), "podman")) {
40
40
@cleanupPids[pid] = 1;
41
41
}
42
42
@@ -89,7 +89,9 @@ tracepoint:sched:sched_process_exit
89
89
90
90
// process is done remove pid from map
91
91
delete(@pids[pid]);
92
- delete(@cleanupPids[pid]);
92
+ if (@cleanupPids[pid]) {
93
+ delete(@cleanupPids[pid]);
94
+ }
93
95
}
94
96
95
97
// Trace all kill calls that target our pids.
@@ -133,19 +135,5 @@ tracepoint:syscalls:sys_enter_write
133
135
comm
134
136
);
135
137
136
- // String size limit is is 64 by default, this includes the 0 byte and when we
137
- // hit the string limit it also adds "..." when using 63 so we use 63 as len here.
138
- // While upstream fixed these low string limits (https://github.com/bpftrace/bpftrace/issues/305)
139
- // it is not yet in older distro version we use so we cannot use that yet.
140
- // Thus manually print several times.
141
- $len = 62;
142
- $offset = 62;
143
- printf("%s", str(args.buf, $len));
144
-
145
- unroll(10) {
146
- if ((int64)args.count > $offset ) {
147
- printf("%s", str(args.buf + $offset, $len));
148
- }
149
- $offset += $len
150
- }
138
+ printf("%s", str(args.buf, args.count));
151
139
}
0 commit comments