Skip to content

Commit

Permalink
chore: strace klib temporary backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
rinor committed Jun 7, 2024
1 parent bdeb7c5 commit 1f520fb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmd/flags_run_local_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import (
"debug/elf"
"fmt"
"net"
"os"
"os/exec"
"path/filepath"
"slices"
"strconv"
"strings"
Expand Down Expand Up @@ -79,7 +81,15 @@ func (flags *RunLocalInstanceCommandFlags) MergeToConfig(c *types.Config) error
}

if (flags.Trace || flags.SyscallSummary) && !slices.Contains(c.Klibs, "strace") {
c.Klibs = append(c.Klibs, "strace") // debugsyscalls, notrace, tracelist, syscall_summary
// temporary backward compatibility
_, err := os.Stat(filepath.Join(c.KlibDir, "strace"))
if err != nil && flags.Trace {
c.Debugflags = append(c.Debugflags, "futex_trace")
}
// new strace klib
if err == nil {
c.Klibs = append(c.Klibs, "strace") // debugsyscalls, notrace, tracelist, syscall_summary
}
}

if flags.MissingFiles {
Expand Down

0 comments on commit 1f520fb

Please sign in to comment.