diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-18 14:14:33 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-18 14:14:33 +0300 |
| commit | 519cd996b5a7fede23b8b23f3c101d10b26111de (patch) | |
| tree | 93f14954325e936d459003f334b667d2afec93b6 /internal/generate/codegen.go | |
| parent | d68e12c92f2aec9b59a849480e0788ab5d798b2a (diff) | |
k6: emit tracepoints for all syscall families
Diffstat (limited to 'internal/generate/codegen.go')
| -rw-r--r-- | internal/generate/codegen.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/generate/codegen.go b/internal/generate/codegen.go index e3ec0ef..3848b93 100644 --- a/internal/generate/codegen.go +++ b/internal/generate/codegen.go @@ -94,7 +94,7 @@ func classifySyscall(sc Syscall) ([]GeneratedTracepoint, string) { allCanGenerate := true if sc.Enter != nil { - enterClass = ClassifyFormat(sc.Enter) + enterClass = classifyEnterForGeneration(sc.Enter) if enterClass.Kind == KindNone { allCanGenerate = false } @@ -113,7 +113,7 @@ func classifySyscall(sc Syscall) ([]GeneratedTracepoint, string) { if !allCanGenerate { names := syscallFormatNames(sc) - return nil, fmt.Sprintf("Ignoring %s as possibly not file I/O related", strings.Join(names, " ")) + return nil, fmt.Sprintf("Skipping %s as incomplete or unclassifiable", strings.Join(names, " ")) } if isEnterRejected(enterClass.Kind) { @@ -131,6 +131,14 @@ func classifySyscall(sc Syscall) ([]GeneratedTracepoint, string) { return result, "" } +func classifyEnterForGeneration(f *Format) ClassificationResult { + classification := ClassifyFormat(f) + if classification.Kind != KindNone || len(f.ExternalFields) == 0 { + return classification + } + return ClassificationResult{Kind: KindNull} +} + // isEnterRejected reports whether kind must not appear on a syscall-enter // tracepoint. The answer comes from the kindRegistry so no switch statement // needs updating when a new TracepointKind is added. |
