Skip to content

Commit 529798a

Browse files
authored
Separate flag for reading trace pipe to logging (#3139)
2 parents afb96f1 + a5428e9 commit 529798a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

flags/flags.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ type FlagsHidden struct {
391391
}
392392

393393
type FlagsBPF struct {
394-
VerboseLogging bool `help:"Enable verbose BPF logging."`
394+
VerboseLogging bool `help:"Enable verbose BPF logging from eBPF code to ebpf trace_pipe."`
395+
LogTracePipe bool `help:"Copy bpf trace_pipe to info logging."`
395396
EventsBufferSize uint32 `default:"8192" help:"Size in pages of the events buffer."`
396397
MapScaleFactor int `default:"${default_map_scale_factor}" help:"Scaling factor for eBPF map sizes. Every increase by 1 doubles the map size. Increase if you see eBPF map size errors. Default is ${default_map_scale_factor} corresponding to 4GB of executable address space, max is ${max_map_scale_factor}."`
397398
VerifierLogLevel uint32 `default:"0" help:"Log level of the eBPF verifier output (0,1,2). Default is 0."`

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ func mainWithExitCode() flags.ExitCode {
536536
return flags.Failure("Failed to start trace handler: %v", err)
537537
}
538538

539-
if f.BPF.VerboseLogging {
539+
if f.BPF.LogTracePipe {
540540
go readTracePipe(mainCtx)
541541
}
542542

@@ -656,7 +656,7 @@ func readTracePipe(ctx context.Context) {
656656
}
657657
line = strings.TrimSpace(line)
658658
if len(line) > 0 {
659-
log.Debugf("%s", line)
659+
log.Infof("bpf: %s", line)
660660
}
661661
}
662662
}

0 commit comments

Comments
 (0)