Skip to content

Commit c014d1e

Browse files
authored
Merge pull request #6486 from ipfs/fix/6457
document the debug script
2 parents 70e499a + 20f7ce8 commit c014d1e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

bin/collect-profiles.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ tmpdir=$(mktemp -d)
88
export PPROF_TMPDIR="$tmpdir"
99
pushd "$tmpdir"
1010

11+
IPFS_BIN=$(which ipfs)
12+
if [[ -e "$IPFS_BIN" ]]; then
13+
cp "$IPFS_BIN" ipfs
14+
fi
15+
1116
echo Collecting goroutine stacks
1217
curl -o goroutines.stacks "http://$HTTP_API"'/debug/pprof/goroutine?debug=2'
1318

docs/debug-guide.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ When you see ipfs doing something (using lots of CPU, memory, or otherwise
1515
being weird), the first thing you want to do is gather all the relevant
1616
profiling information.
1717

18+
There's a script (`bin/collect-profiles.sh`) that will do this for you and
19+
bundle the results up into a tarball, ready to be attached to a bug report.
20+
21+
If you feel intrepid, you can dump this information and investigate it yourself:
22+
1823
- goroutine dump
1924
- `curl localhost:5001/debug/pprof/goroutine\?debug=2 > ipfs.stacks`
2025
- 30 second cpu profile
@@ -26,10 +31,6 @@ profiling information.
2631
- system information
2732
- `ipfs diag sys > ipfs.sysinfo`
2833

29-
Bundle all that up and include a copy of the ipfs binary that you are running
30-
(having the exact same binary is important, it contains debug info).
31-
32-
You can investigate yourself if you feel intrepid:
3334

3435
### Analyzing the stack dump
3536

0 commit comments

Comments
 (0)