CPUProfilestring`long:"cpuprofile" description:"Write CPU profile to the specified file"`
Profilestring`long:"profile" description:"Enable HTTP profiling on either a port or host:port"`
BlockingProfileint`long:"blockingprofile" description:"Used to enable a blocking profile to be served on the profiling port. This takes a value from 0 to 1, with 1 including every blocking event, and 0 including no events."`
MutexProfileint`long:"mutexprofile" description:"Used to Enable a mutex profile to be served on the profiling port. This takes a value from 0 to 1, with 1 including every mutex event, and 0 including no events."`
}
// Validate checks the values configured for the profiler.
func(p*Pprof)Validate()error{
ifp.BlockingProfile>0{
log.Warn("Blocking profile enabled only useful for "+
"debugging because of significant performance impact")
}
ifp.MutexProfile>0{
log.Warn("Mutex profile enabled only useful for "+
"debugging because of significant performance impact")
}
ifp.CPUProfile!=""{
log.Warn("CPU profile enabled only useful for "+
"debugging because of significant performance impact")
}
ifp.Profile!=""{
str:="%v: The profile port must be between 1024 and 65535"