diff options
| author | Paul Buetow <paul@buetow.org> | 2025-04-10 21:28:45 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-04-10 21:28:45 +0300 |
| commit | 017494938f061fd1276f2a54b1df0e7002655e9f (patch) | |
| tree | 9c98fbf31b524233b637079a0482b4255eb6e388 /internal/ior.go | |
| parent | 9572fa5d087731f68d55517847833f6203b9a70d (diff) | |
can serialize and deserialize to/from gob
Diffstat (limited to 'internal/ior.go')
| -rw-r--r-- | internal/ior.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/ior.go b/internal/ior.go index c2f2f02..2aff207 100644 --- a/internal/ior.go +++ b/internal/ior.go @@ -12,6 +12,7 @@ import ( "time" "ior/internal/flags" + "ior/internal/flamegraph" "ior/internal/tracepoints" bpf "github.com/aquasecurity/libbpfgo" @@ -44,6 +45,16 @@ func attachTracepoints(bpfModule *bpf.Module) error { } func Run() error { + iorFile := flags.Get().IorDataFile + + if iorFile != "" { + return flamegraph.NewCollapsed(iorFile, flags.Get().CollapsedFields).Generate(iorFile) + } + + return runTrace() +} + +func runTrace() error { bpfModule, err := bpf.NewModuleFromFile("ior.bpf.o") if err != nil { return err |
