From 421e1cbedb47cb499201512defc2baf79d7b87f7 Mon Sep 17 00:00:00 2001 From: Pimyn Girgis Date: Tue, 6 Aug 2024 14:10:45 +0000 Subject: pkg/mgrconfig, prog, tools: allow automatically generated or manually written descriptions or both Add "Auto" type and allow to choose descriptions mode in configurations. Defaults to using manual only. --- pkg/vminfo/syscalls.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'pkg/vminfo/syscalls.go') diff --git a/pkg/vminfo/syscalls.go b/pkg/vminfo/syscalls.go index 178e5d52c..707ab6543 100644 --- a/pkg/vminfo/syscalls.go +++ b/pkg/vminfo/syscalls.go @@ -161,7 +161,7 @@ func (ctx *checkContext) supportedSyscalls(names []string) string { } func supportedOpenat(ctx *checkContext, call *prog.Syscall) string { - fname, ok := extractStringConst(call.Args[1].Type) + fname, ok := extractStringConst(call.Args[1].Type, call.Attrs.Automatic) if !ok || fname[0] != '/' { return "" } @@ -277,7 +277,10 @@ func alwaysSupported(ctx *checkContext, call *prog.Syscall) string { return "" } -func extractStringConst(typ prog.Type) (string, bool) { +func extractStringConst(typ prog.Type, isAutomatic bool) (string, bool) { + if isAutomatic { + return "", false + } ptr, ok := typ.(*prog.PtrType) if !ok { panic("first open arg is not a pointer to string const") -- cgit mrf-deployment