Include perfstats and heap profiles in standard build

This commit is contained in:
Jakob Borg
2014-08-13 14:38:23 +02:00
parent 58381496a2
commit 213acaee3b
3 changed files with 17 additions and 12 deletions

View File

@@ -104,9 +104,6 @@ The following enviroment variables are interpreted by syncthing:
Set this variable when running under a service manager such as
runit, launchd, etc.
STPROFILER Set to a listen address such as "127.0.0.1:9090" to start the
profiler with HTTP access.
STTRACE A comma separated string of facilities to trace. The valid
facility strings:
- "beacon" (the beacon package)
@@ -120,10 +117,18 @@ The following enviroment variables are interpreted by syncthing:
- "xdr" (the xdr package)
- "all" (all of the above)
STCPUPROFILE Write CPU profile to the specified file.
STGUIASSETS Directory to load GUI assets from. Overrides compiled in assets.
STPROFILER Set to a listen address such as "127.0.0.1:9090" to start the
profiler with HTTP access.
STCPUPROFILE Write a CPU profile to cpu-$pid.pprof on exit.
STHEAPPROFILE Write heap profiles to heap-$pid-$timestamp.pprof each time
heap usage increases.
STPERFSTATS Write running performance statistics to perf-$pid.csv.
STDEADLOCKTIMEOUT Alter deadlock detection timeout (seconds; default 1200).`
)
@@ -498,7 +503,7 @@ nextRepo:
}
if cpuprof := os.Getenv("STCPUPROFILE"); len(cpuprof) > 0 {
f, err := os.Create(cpuprof)
f, err := os.Create(fmt.Sprintf("cpu-%d.pprof", os.Getpid()))
if err != nil {
log.Fatal(err)
}