Pull request:* all: replace our pprof fork with net/http/pprof

Merge in DNS/adguard-home from 2239-remove-pprof-fork to master

Squashed commit of the following:

commit eefcaae015292768b26a70a27d352d3e2aa3f9ef
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Fri Oct 30 20:00:05 2020 +0300

    * all: replace our pprof fork with net/http/pprof

    Closes .
This commit is contained in:
Eugene Burkov 2020-11-02 16:32:33 +03:00
parent 812b43a4b3
commit 8afdc049ef
2 changed files with 6 additions and 351 deletions
internal/home

View file

@ -9,6 +9,7 @@ import (
"io/ioutil"
"net"
"net/http"
"net/http/pprof"
"net/url"
"os"
"os/signal"
@ -265,7 +266,11 @@ func run(args options) {
if config.DebugPProf {
mux := http.NewServeMux()
util.PProfRegisterWebHandlers(mux)
mux.HandleFunc("/debug/pprof/", pprof.Index)
mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
mux.HandleFunc("/debug/pprof/profile", pprof.Profile)
mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
mux.HandleFunc("/debug/pprof/trace", pprof.Trace)
go func() {
log.Info("pprof: listening on localhost:6060")
err := http.ListenAndServe("localhost:6060", mux)