mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 07:58:22 -05:00
Deprecate broken and unused debug flags in favor of --pprof (#15083)
* deprecating the trace and cpuprofile flags in favor of pprof * gaz * fixing change log title * added hidden tags
This commit is contained in:
@@ -78,15 +78,17 @@ var (
|
||||
Name: "blockprofilerate",
|
||||
Usage: "Turns on block profiling with the given rate.",
|
||||
}
|
||||
// CPUProfileFlag to specify where to write the CPU profile.
|
||||
// deprecated: CPUProfileFlag
|
||||
CPUProfileFlag = &cli.StringFlag{
|
||||
Name: "cpuprofile",
|
||||
Usage: "Writes CPU profile to the given file.",
|
||||
Name: "cpuprofile",
|
||||
Hidden: true,
|
||||
Usage: "Do not use, deprecated",
|
||||
}
|
||||
// TraceFlag to specify where to write the trace execution profile.
|
||||
// deprecated: TraceFlag
|
||||
TraceFlag = &cli.StringFlag{
|
||||
Name: "trace",
|
||||
Usage: "Writes execution trace to the given file.",
|
||||
Name: "trace",
|
||||
Hidden: true,
|
||||
Usage: "Do not use, deprecated",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -328,17 +330,6 @@ func Setup(ctx *cli.Context) error {
|
||||
if ctx.IsSet(MutexProfileFractionFlag.Name) {
|
||||
runtime.SetMutexProfileFraction(ctx.Int(MutexProfileFractionFlag.Name))
|
||||
}
|
||||
if traceFile := ctx.String(TraceFlag.Name); traceFile != "" {
|
||||
if err := Handler.StartGoTrace(TraceFlag.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if cpuFile := ctx.String(CPUProfileFlag.Name); cpuFile != "" {
|
||||
if err := Handler.StartCPUProfile(cpuFile); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// pprof server
|
||||
if ctx.Bool(PProfFlag.Name) {
|
||||
address := fmt.Sprintf("%s:%d", ctx.String(PProfAddrFlag.Name), ctx.Int(PProfPortFlag.Name))
|
||||
@@ -359,18 +350,3 @@ func startPProf(address string) {
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// Exit stops all running profiles, flushing their output to the
|
||||
// respective file.
|
||||
func Exit(ctx *cli.Context) {
|
||||
if traceFile := ctx.String(TraceFlag.Name); traceFile != "" {
|
||||
if err := Handler.StopGoTrace(); err != nil {
|
||||
log.WithError(err).Error("Failed to stop go tracing")
|
||||
}
|
||||
}
|
||||
if cpuFile := ctx.String(CPUProfileFlag.Name); cpuFile != "" {
|
||||
if err := Handler.StopCPUProfile(); err != nil {
|
||||
log.WithError(err).Error("Failed to stop CPU profiling")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user