Skip to content

Commit

Permalink
tetragon: rename pprof flag for consistency
Browse files Browse the repository at this point in the history
The flag was previously hidden so I don't think it's a huge deal, we
keep compatibility anyway.

Signed-off-by: Mahe Tardy <[email protected]>
  • Loading branch information
mtardy committed Aug 28, 2024
1 parent a6113d5 commit fe78328
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 3 additions & 1 deletion docs/data/tetragon_flags.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions pkg/option/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ const (
KeyTracingPolicy = "tracing-policy"
KeyTracingPolicyDir = "tracing-policy-dir"

KeyCpuProfile = "cpuprofile"
KeyMemProfile = "memprofile"
KeyPprofAddr = "pprof-addr"
KeyCpuProfile = "cpuprofile"
KeyMemProfile = "memprofile"
KeyPprofAddr = "pprof-address"
KeyDeprecatedPprofAddr = "pprof-addr"

KeyExportFilename = "export-filename"
KeyExportFileMaxSizeMB = "export-file-max-size-mb"
Expand Down Expand Up @@ -184,6 +185,7 @@ func ReadAndSetFlags() error {

Config.CpuProfile = viper.GetString(KeyCpuProfile)
Config.MemProfile = viper.GetString(KeyMemProfile)
Config.PprofAddr = viper.GetString(KeyDeprecatedPprofAddr)
Config.PprofAddr = viper.GetString(KeyPprofAddr)

Config.EventQueueSize = viper.GetUint(KeyEventQueueSize)
Expand Down Expand Up @@ -326,8 +328,9 @@ func AddFlags(flags *pflag.FlagSet) {
flags.String(KeyMemProfile, "", "Store MEM profile into provided file")
flags.MarkHidden(KeyMemProfile)

flags.String(KeyPprofAddr, "", "Profile via pprof http")
flags.MarkHidden(KeyPprofAddr)
flags.String(KeyPprofAddr, "", "Serves runtime profile data via HTTP (e.g. 'localhost:6060'). Disabled by default")
flags.String(KeyDeprecatedPprofAddr, "", "")
flags.MarkDeprecated(KeyDeprecatedPprofAddr, "please use --pprof-address")

// JSON export aggregation options.
flags.Bool(KeyEnableExportAggregation, false, "Enable JSON export aggregation")
Expand Down

0 comments on commit fe78328

Please sign in to comment.