diff options
| author | Paul Buetow <paul@buetow.org> | 2025-03-26 22:11:40 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-03-26 22:11:40 +0200 |
| commit | 55276cd2a2ea3e918d2c625a384c7fa99fee9295 (patch) | |
| tree | 27921147381238a273f11bf03c31c4b1213568d5 /internal/c/generate_tracepoints_c.raku | |
| parent | f085f544e1d4df985e9c3bd394398547a8888e0f (diff) | |
initial io_ async tracepoints
Diffstat (limited to 'internal/c/generate_tracepoints_c.raku')
| -rw-r--r-- | internal/c/generate_tracepoints_c.raku | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/internal/c/generate_tracepoints_c.raku b/internal/c/generate_tracepoints_c.raku index b3f1a59..9f31d2b 100644 --- a/internal/c/generate_tracepoints_c.raku +++ b/internal/c/generate_tracepoints_c.raku @@ -48,6 +48,7 @@ role TracepointTemplate { my Str @parts; @parts.push: qq:to/BPF_C_CODE/; + /// {%vals<name>.lc} is a struct {%vals<event-struct>} SEC("tracepoint/syscalls/{%vals<name>}") int handle_{%vals<name>.lc}(struct {ctx-struct} *ctx) \{ __u32 pid, tid; @@ -194,6 +195,9 @@ class Format { multi method set-format-impl($, 'filename', 'const char *') { $!format-impl = PathnameTracepoint.new('filename') } multi method set-format-impl($, 'ret', 'long') { $!format-impl = RetTracepoint.new } + # Async I/O, at least capture the count and the durations + multi method set-format-impl(Str $s where /^sys_enter_io_/, $, $) { $!format-impl = NullTracepoint.new } + # All remaining tracepoints are ignored multi method set-format-impl($, $, $) { } @@ -204,7 +208,7 @@ class Format { method can-generate returns Bool { so $!format-impl.^can('generate-bpf-c-tracepoint') } method enter-reject returns Bool { $!format-impl !~~ any( - FdTracepoint, NameTracepoint, OpenTracepoint, PathnameTracepoint, FcntlTracepoint + FdTracepoint, NameTracepoint, OpenTracepoint, PathnameTracepoint, FcntlTracepoint, NullTracepoint ) } } @@ -244,10 +248,10 @@ my Format @formats = gather for SysTraceFormat.parse($*IN.slurp, actions => SysTraceFormatActions.new).made.values -> %syscall { if !all(%syscall.values.map(*.can-generate)) { - say "// Ignoring {%syscall.values.map(*.name).sort} as possibly not file I/O related"; + say "/// Ignoring {%syscall.values.map(*.name).sort} as possibly not file I/O related"; next; } elsif %syscall<enter>.enter-reject { - say "// Ignoring {%syscall.values.map(*.name).sort} as enter-rejected"; + say "/// Ignoring {%syscall.values.map(*.name).sort} as enter-rejected"; next; } |
