feat(main): change pprof flag to IPFS_PROF
@jbenet @whyrusleeping thoughts?
Brian Tiger Chow committed
Jan 12, 2015 at 21:30 UTC
097c8a1166113490a28e760a7c5475575250d979
1 file changed
+5
-6
cmd/ipfs/main.go
+5
-6
@@ -35,9 +35,10 @@ var log = eventlog.Logger("cmd/ipfs")
35
var errHelpRequested = errors.New("Help Requested")
36
37
const (
38
- cpuProfile = "ipfs.cpuprof"
39
- heapProfile = "ipfs.memprof"
40
- errorFormat = "ERROR: %v\n\n"
38
+ EnvEnableProfiling = "IPFS_PROF"
39
+ cpuProfile = "ipfs.cpuprof"
40
+ heapProfile = "ipfs.memprof"
41
+ errorFormat = "ERROR: %v\n\n"
42
)
43
44
type cmdInvocation struct {
@@ -512,9 +513,7 @@ func allInterruptSignals() chan os.Signal {
513
func profileIfEnabled() (func(), error) {
514
// FIXME this is a temporary hack so profiling of asynchronous operations
515
// works as intended.
515
- if u.GetenvBool("DEBUG") || os.Getenv("IPFS_LOGGING") == "debug" {
516
- u.Debug = true
517
- u.SetDebugLogging()
516
+ if os.Getenv(EnvEnableProfiling) != "" {
517
stopProfilingFunc, err := startProfiling() // TODO maybe change this to its own option... profiling makes it slower.
518
if err != nil {
519
return nil, err