diff --git a/pkg/tracepipe/trace_pipe.go b/pkg/tracepipe/trace_pipe.go index 821d8b65..389e613a 100644 --- a/pkg/tracepipe/trace_pipe.go +++ b/pkg/tracepipe/trace_pipe.go @@ -65,7 +65,8 @@ func New() (*TracePipe, error) { // A line from trace_pipe looks like (leading spaces included): // ` chromium-15581 [000] d... 92783.722567: : Hello, World!` -var traceLineRegexp = regexp.MustCompile(`(.{16})-(\d+) +\[(\d{3})\] (.{4}) +(\d+\.\d+)\: (.*?)\: (.*)`) +// ` chromium-15581 [000] d...1 92783.722567: : Hello, World!` +var traceLineRegexp = regexp.MustCompile(`(.{16})-(\d+) +\[(\d{3})\] (.{4,5}) +(\d+\.\d+)\: (.*?)\: (.*)`) func parseTraceLine(raw string) (*TraceEvent, error) { fields := traceLineRegexp.FindStringSubmatch(raw) diff --git a/pkg/tracepipe/trace_pipe_test.go b/pkg/tracepipe/trace_pipe_test.go index 7c5f6cfd..1f00b1f3 100644 --- a/pkg/tracepipe/trace_pipe_test.go +++ b/pkg/tracepipe/trace_pipe_test.go @@ -40,6 +40,14 @@ func TestParseTraceLine(t *testing.T) { Function: "sys_enter", Message: "hello: world", }, + }, + { + " systemd-1 [001] d...1 223345.525322: bpf_trace_printk: hello world!!!\n", + TraceEvent{ + Task: "systemd", + Function: "bpf_trace_printk", + Message: "hello world!!!", + }, }, } for _, testEvent := range testEvents {