diff options
| author | Ethan Graham <ethangraham@google.com> | 2025-07-16 12:46:20 +0000 |
|---|---|---|
| committer | Alexander Potapenko <glider@google.com> | 2025-08-04 12:25:52 +0000 |
| commit | f5bcc8dc6eb21df90aeb443032779df3e73c53a1 (patch) | |
| tree | f0a3e78563638e5e8418f604c7700449e7624d64 /pkg/csource/options.go | |
| parent | abdcb21383cc97dd3eb98eaa27189415be7d8199 (diff) | |
pkg/csource: add call argument annotations to generated C-source files
The structure of arguments passed into syscalls is often hard to parse
since it is memcpy'd into mmap'd regions. Structural relations are often
lost in translation, resulting in reproducers that take longer for a
developer to understand.
This patch adds functionality for parsing syscall arguments semantically and
emitting a structured and human-readable comment which is inserted before each
syscall in the resulting C-source.
Diffstat (limited to 'pkg/csource/options.go')
| -rw-r--r-- | pkg/csource/options.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/pkg/csource/options.go b/pkg/csource/options.go index 74d4a587a..4438e5df2 100644 --- a/pkg/csource/options.go +++ b/pkg/csource/options.go @@ -50,6 +50,9 @@ type Options struct { HandleSegv bool `json:"segv,omitempty"` Trace bool `json:"trace,omitempty"` + + CallComments bool `json:"callcomments,omitempty"` + LegacyOptions } @@ -160,13 +163,14 @@ func (opts Options) checkLinuxOnly(OS string) error { func DefaultOpts(cfg *mgrconfig.Config) Options { opts := Options{ - Threaded: true, - Repeat: true, - Procs: cfg.Procs, - Slowdown: cfg.Timeouts.Slowdown, - Sandbox: cfg.Sandbox, - UseTmpDir: true, - HandleSegv: true, + Threaded: true, + Repeat: true, + Procs: cfg.Procs, + Slowdown: cfg.Timeouts.Slowdown, + Sandbox: cfg.Sandbox, + UseTmpDir: true, + HandleSegv: true, + CallComments: true, } if cfg.TargetOS == targets.Linux { opts.NetInjection = true |
