summaryrefslogtreecommitdiff
path: root/internal/event.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-03-06 21:08:47 +0200
committerPaul Buetow <paul@buetow.org>2025-03-06 21:08:47 +0200
commitfe7f16e4fcf7ee13f55321691072bf02071df58c (patch)
treee521e5205dd181c966f486cef2089aa15aae77bb /internal/event.go
parent90d59424ad047dd9fd58ee11c5b04383be4995f8 (diff)
refactor
Diffstat (limited to 'internal/event.go')
-rw-r--r--internal/event.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/internal/event.go b/internal/event.go
index bce60fa..f0d81b6 100644
--- a/internal/event.go
+++ b/internal/event.go
@@ -51,31 +51,34 @@ func (e *eventPair) is(id TraceId) bool {
return e.enterEv.GetTraceId() == id
}
+const eventStreamHeader = "durationToPrevNs,durationNs,comm,pid.tid,name,ret,notice,file"
+
func (e *eventPair) String() string {
var sb strings.Builder
- sb.WriteString(fmt.Sprintf("%08dns %08dns", e.durationToPrev, e.duration))
+ sb.WriteString(fmt.Sprintf("%08d,%08d", e.durationToPrev, e.duration))
- sb.WriteString(" comm:")
+ sb.WriteString(",")
sb.WriteString(e.comm)
- sb.WriteString(" pidtid:")
+ sb.WriteString(",")
sb.WriteString(strconv.FormatInt(int64(e.enterEv.GetPid()), 10))
sb.WriteString(".")
sb.WriteString(strconv.FormatInt(int64(e.enterEv.GetTid()), 10))
- sb.WriteString(" name:")
+ sb.WriteString(",")
sb.WriteString(e.enterEv.GetTraceId().Name())
+
+ sb.WriteString(",")
if retEv, ok := e.exitEv.(*RetEvent); ok {
- sb.WriteString(":")
sb.WriteString(strconv.FormatInt(int64(retEv.Ret), 10))
}
- sb.WriteString(" ")
+ sb.WriteString(",")
sb.WriteString(e.file.String())
if e.tracepointMismatch {
- sb.WriteString(" MISMATCH")
+ sb.WriteString(",MISMATCH")
}
return sb.String()
}