summaryrefslogtreecommitdiff
path: root/internal/flamegraph
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-04-11 22:26:00 +0300
committerPaul Buetow <paul@buetow.org>2025-04-11 22:26:00 +0300
commitdd73ed4678a3623f1c71ceb88aec481de5b9d64e (patch)
tree342e62c9480bc1cacd20b270e6bb15906ddce406 /internal/flamegraph
parent0124c447f15539c24d1987f5339caa01ca5e9020 (diff)
jo
Diffstat (limited to 'internal/flamegraph')
-rw-r--r--internal/flamegraph/collapsed.go12
-rw-r--r--internal/flamegraph/iordata.go4
-rw-r--r--internal/flamegraph/tool.go9
3 files changed, 18 insertions, 7 deletions
diff --git a/internal/flamegraph/collapsed.go b/internal/flamegraph/collapsed.go
index 68090b8..d3a690a 100644
--- a/internal/flamegraph/collapsed.go
+++ b/internal/flamegraph/collapsed.go
@@ -8,10 +8,16 @@ import (
"github.com/DataDog/zstd"
)
+// Collapsed represents a structure used to process and store information
+// related to a collapsed flamegraph. It includes the following fields:
+// - iorFile: The path to the input/output report file.
+// - fields: A list of field names used in the flamegraph processing.
+// - countField: The name of the field that represents the count or weight
+// in the flamegraph data.
type Collapsed struct {
- iorFile string
- fields []string
- countField string
+ iorFile string // Path to the input/output report file.
+ fields []string // List of field names used in processing.
+ countField string // Field name representing the count or weight.
}
func NewCollapsed(iorFile string, fields []string, countField string) Collapsed {
diff --git a/internal/flamegraph/iordata.go b/internal/flamegraph/iordata.go
index cef01ff..1c2b0f4 100644
--- a/internal/flamegraph/iordata.go
+++ b/internal/flamegraph/iordata.go
@@ -26,8 +26,10 @@ type tidType = uint32
type flagsType = file.Flags
type pathMap map[pathType]map[traceIdType]map[commType]map[pidType]map[tidType]map[flagsType]Counter
+// iorData is a structure that holds data related to I/O operations.
+// It contains a map of paths, which is used to manage and store path-related information.
type iorData struct {
- paths pathMap // Make sure this field is accessible from outside
+ paths pathMap // paths is a map that stores path-related data. Note: This field is currently unexported.
}
func newIorData() iorData {
diff --git a/internal/flamegraph/tool.go b/internal/flamegraph/tool.go
index 6840e35..0ce33e3 100644
--- a/internal/flamegraph/tool.go
+++ b/internal/flamegraph/tool.go
@@ -11,10 +11,13 @@ import (
"github.com/DataDog/zstd"
)
+// Tool represents a utility for generating flamegraphs.
+// It contains the path to the flamegraph tool, the arguments to be passed to it,
+// and the output file where the generated flamegraph will be stored.
type Tool struct {
- flamegraphTool string
- args []string
- outFile string
+ flamegraphTool string // Path to the flamegraph tool executable.
+ args []string // Arguments to be passed to the flamegraph tool.
+ outFile string // Path to the output file where the flamegraph will be saved.
}
func NewTool(collapsedFile string) (Tool, error) {