diff options
| author | Paul Buetow <paul@buetow.org> | 2025-04-09 23:32:01 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-04-09 23:32:01 +0300 |
| commit | 9572fa5d087731f68d55517847833f6203b9a70d (patch) | |
| tree | 20ecba9b6bda135d27e16d759b157a2afabb215d /internal/flamegraph | |
| parent | d8dc052fbfae7f831f8e665c64bb63969ec70db8 (diff) | |
add mrproper.
Diffstat (limited to 'internal/flamegraph')
| -rw-r--r-- | internal/flamegraph/iordata.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/flamegraph/iordata.go b/internal/flamegraph/iordata.go index b91dbc3..2ba1e9e 100644 --- a/internal/flamegraph/iordata.go +++ b/internal/flamegraph/iordata.go @@ -36,9 +36,15 @@ func newIorData() iorData { return iorData{paths: make(pathMap)} } +func cloneString(s string) string { + // Clone the string by creating a new string with the same content + // This is a workaround to avoid using unsafe package + return string([]byte(s)) +} + func (iod iorData) add(ev *event.Pair) { cnt := counter{count: 1, duration: ev.Duration, durationToPrev: ev.DurationToPrev} - iod.addPath(ev.FileName(), ev.EnterEv.GetTraceId(), ev.Comm, ev.EnterEv.GetPid(), + iod.addPath(ev.FileName(), ev.EnterEv.GetTraceId(), string(ev.Comm), ev.EnterEv.GetPid(), ev.EnterEv.GetTid(), ev.Flags(), cnt) } |
