summaryrefslogtreecommitdiff
path: root/internal/event
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-04-06 21:27:31 +0300
committerPaul Buetow <paul@buetow.org>2025-04-06 21:27:31 +0300
commit6ca3491f421e8506fa3ff832a51b3a7d8a5c7ef6 (patch)
tree701d955b507929c8cb4b21c2fd40fe1ca12f3b0c /internal/event
parent70d0c28c24dd7b69b3d711574574f8b2a1d8ad0c (diff)
initial dumping in new ior data format
Diffstat (limited to 'internal/event')
-rw-r--r--internal/event/event.go18
1 files changed, 15 insertions, 3 deletions
diff --git a/internal/event/event.go b/internal/event/event.go
index f835aaf..684761a 100644
--- a/internal/event/event.go
+++ b/internal/event/event.go
@@ -28,9 +28,7 @@ type Pair struct {
File file.File
Comm string
Duration uint64
-
- // To calculate the time difference from the previoud event.
- DurationToPrev uint64
+ DurationToPrev uint64
}
func NewPair(enterEv Event) *Pair {
@@ -83,6 +81,20 @@ func (e *Pair) String() string {
return sb.String()
}
+func (e *Pair) FlagsString() string {
+ if e.File == nil {
+ return "N:flags"
+ }
+ return e.File.FlagsString()
+}
+
+func (e *Pair) FileName() string {
+ if e.File == nil {
+ return "N:file"
+ }
+ return e.File.Name()
+}
+
func (e *Pair) Dump() string {
return fmt.Sprintf("%v with enterEv(%v) and exitEv(%v)", e, e.EnterEv, e.ExitEv)
}