Skip to content

Commit

Permalink
[CWS-2966] add missing cws-instrumentation flags in attach mode (#31637)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux authored Dec 2, 2024
1 parent bbc4570 commit d06ed83
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions cmd/cws-instrumentation/subcommands/tracecmd/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,27 +149,39 @@ func Command() []*cobra.Command {
go func(set []int) {
defer wg.Done()

args := []string{"trace"}

if params.ProcScanDisabled {
args = append(args, fmt.Sprintf(`--%s`, disableProcScanOpt))
}
if params.Async {
args = append(args, fmt.Sprintf(`--%s`, asyncOpt))
args := []string{
"trace",
fmt.Sprintf(`--%s`, probeAddrOpt),
params.ProbeAddr,
}

if params.Verbose {
args = append(args, fmt.Sprintf(`--%s`, verboseOpt))
}
if params.StatsDisabled {
args = append(args, fmt.Sprintf(`--%s`, disableStatsOpt))
if params.Debug {
args = append(args, fmt.Sprintf(`--%s`, debugOpt))
}
if params.UID != -1 {
args = append(args, fmt.Sprintf(`--%s`, uidOpt), fmt.Sprintf(`%d`, params.UID))
}
if params.GID != -1 {
args = append(args, fmt.Sprintf(`--%s`, gidOpt), fmt.Sprintf(`%d`, params.GID))
}
args = append(args, fmt.Sprintf(`--%s`, probeAddrOpt), params.ProbeAddr)
if params.Async {
args = append(args, fmt.Sprintf(`--%s`, asyncOpt))
}
if params.StatsDisabled {
args = append(args, fmt.Sprintf(`--%s`, disableStatsOpt))
}
if params.ProcScanDisabled {
args = append(args, fmt.Sprintf(`--%s`, disableProcScanOpt))
}
if params.ScanProcEvery != "" {
args = append(args, fmt.Sprintf(`--%s`, scanProcEveryOpt), params.ScanProcEvery)
}
if params.SeccompDisabled {
args = append(args, fmt.Sprintf(`--%s`, disableSeccompOpt))
}

for _, pid := range set {
args = append(args, fmt.Sprintf(`--%s`, pidOpt), fmt.Sprintf(`%d`, pid))
Expand Down

0 comments on commit d06ed83

Please sign in to comment.