summaryrefslogtreecommitdiff
path: root/internal/generate/codegen.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/generate/codegen.go')
-rw-r--r--internal/generate/codegen.go12
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.