Skip to content

Commit

Permalink
bugtool: Dump tracefs log
Browse files Browse the repository at this point in the history
Dump tracefs log to trace file.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
  • Loading branch information
olsajiri authored and kkourt committed Nov 5, 2024
1 parent 069c90f commit 6a4b47a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/bugtool/bugtool.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ func doBugtool(info *InitInfo, outFname string) error {
si.addPmapOut(tarWriter)
si.addMemCgroupStats(tarWriter)
si.addBPFMapsStats(tarWriter)
si.addTracefsTraceFile(tarWriter)
return nil
}

Expand Down Expand Up @@ -773,3 +774,10 @@ func (s bugtoolInfo) addBPFMapsStats(tarWriter *tar.Writer) error {
s.multiLog.WithField("file", file).Info("BPF maps checks added")
return nil
}

func (s *bugtoolInfo) addTracefsTraceFile(tarWriter *tar.Writer) {
err := s.execCmd(tarWriter, "trace", "cat", "/sys/kernel/tracing/trace")
if err != nil {
s.multiLog.Warnf("failed to get trace file: %v", err)
}
}

0 comments on commit 6a4b47a

Please sign in to comment.