summaryrefslogtreecommitdiff
path: root/internal/flamegraph/flamegraph.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/flamegraph/flamegraph.go')
-rw-r--r--internal/flamegraph/flamegraph.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/internal/flamegraph/flamegraph.go b/internal/flamegraph/flamegraph.go
index 1bfd82e..85b6a5c 100644
--- a/internal/flamegraph/flamegraph.go
+++ b/internal/flamegraph/flamegraph.go
@@ -15,9 +15,11 @@ type counter struct {
duration uint64
}
-// TODO: Profile for CPU usage
+// TODO: Profile for CPU usage. If too slow, can fan out into multiple maps and
+// then merge at the end the maps.
type Flamegraph struct {
- // Collapsed flamegraph stats collector
+ // TODO: Keep al lthe individual files at the leaf in a map as well.
+ // And when dumped, only dump the N "highest" and summarize the other ones.
collapsed map[string]map[types.TraceId]counter
inCh chan *event.Pair
Done chan struct{}
@@ -97,7 +99,7 @@ func (f Flamegraph) dumpBy(outfile string, by func(counter) uint64) {
}
for traceId, cnt := range value {
- _, err := fmt.Fprintf(file, "%s;syscall`%s %v\n", sb.String(), traceId, by(cnt))
+ _, err := fmt.Fprintf(file, "%s;syscall`%s %v\n", sb.String(), traceId.Name(), by(cnt))
if err != nil {
panic(err)
}