diff options
| author | Paul Buetow <paul@buetow.org> | 2025-04-10 23:02:35 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-04-10 23:02:35 +0300 |
| commit | 9525794dc529c66642db8e9bbfe4ea357cdce909 (patch) | |
| tree | e908225816ddd77b82492ffed2521dcd0331920a /internal/flags | |
| parent | 1eeae89f5b1fcff41694b311fe699a65788cef6b (diff) | |
fixes
Diffstat (limited to 'internal/flags')
| -rw-r--r-- | internal/flags/flags.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/internal/flags/flags.go b/internal/flags/flags.go index 120d8fe..36911d8 100644 --- a/internal/flags/flags.go +++ b/internal/flags/flags.go @@ -55,6 +55,9 @@ type Flags struct { IorDataFile string CollapsedFields []string CountField string + + // To generate the Flamegraph SVGs + FlamegraphTool string } func Parse() { @@ -78,13 +81,17 @@ func parse() { tracepointsToExclude := flag.String("tpsExclude", "", "Comma separated list regexes for tracepoints to exclude") flag.BoolVar(&singleton.FlamegraphEnable, "flamegraph", false, "Enable flamegraph builder") - flag.StringVar(&singleton.FlamegraphName, "name", "foo", "Name of the flamegraph data output") + flag.StringVar(&singleton.FlamegraphName, "name", "default", "Name of the flamegraph, used to generate the SVG file") flag.StringVar(&singleton.IorDataFile, "ior", "", "IOR data file to convert into collapsed format") fields := flag.String("fields", "", fmt.Sprintf("Comma separated list of fields to collapse, valid are: %v", validCollapsedFields)) flag.StringVar(&singleton.CountField, "count", "count", fmt.Sprintf("Count field to collaps, valid are: %v", validCollapsedCounts)) + + // https://github.com/brendangregg/FlameGraph + flag.StringVar(&singleton.FlamegraphTool, "flamegraphTool", + os.Getenv("HOME")+"/git/FlameGraph/flamegraph.pl", "Path to the flamegraph tool") flag.Parse() singleton.TracepointsToAttach = extractTracepointFlags(*tracepointsToAttach) @@ -102,6 +109,11 @@ func parse() { os.Exit(2) } } + + if !slices.Contains(validCollapsedCounts, singleton.CountField) { + fmt.Println("Invalid count field:", singleton.CountField) + os.Exit(2) + } } func extractTracepointFlags(tracepoints string) (regexes []*regexp.Regexp) { |
