Debian Codegraph @

internal/internaltest/static_panicweb.sh

raw
1 #!/bin/bash
2 # Copyright 2020 Marc-Antoine Ruel. All rights reserved.
3 # Use of this source code is governed under the Apache License, Version 2.0
4 # that can be found in the LICENSE file.
5
6 set -eu
7
8 eval `go env | grep 'GOROOT\|GOPATH'`
9 go install github.com/maruel/panicparse/cmd/panicweb
10 panicweb -port 1212 &
11 trap "trap - TERM && kill -- -$$" INT TERM EXIT
12 sleep 1
13 echo "Sleeping 2 minutes..."
14 sleep 124
15 curl -sS 'http://localhost:1212/debug/pprof/goroutine?debug=2' \
16 | sed -e "s#\t$GOROOT/#\t/goroot/#g" \
17 | sed -e "s#\t$GOPATH/#\t/gopath/#g" > static_panicweb.txt
18 echo "Copied $(cat static_panicweb.txt | wc -l) lines into static_panicweb.txt."
19 echo "Add static_panicweb.txt content into static_panicweb.go."