From 77e6dc181c8014e18cd496d82c6830bf9d4a8e85 Mon Sep 17 00:00:00 2001 From: thinkAfCod Date: Mon, 4 Nov 2024 17:54:04 +0800 Subject: [PATCH] feat: pprof --- cmd/shisui/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/shisui/main.go b/cmd/shisui/main.go index 7cd59088e1..e6d66c1133 100644 --- a/cmd/shisui/main.go +++ b/cmd/shisui/main.go @@ -5,6 +5,7 @@ import ( "database/sql" "encoding/hex" "fmt" + "github.com/ethereum/go-ethereum/internal/debug" "net" "net/http" "os/signal" @@ -105,7 +106,7 @@ var ( func init() { app.Action = shisui - app.Flags = slices.Concat(portalProtocolFlags, historyRpcFlags, metricsFlags) + app.Flags = slices.Concat(portalProtocolFlags, historyRpcFlags, metricsFlags, debug.Flags) flags.AutoEnvVars(app.Flags, "SHISUI") } @@ -121,6 +122,9 @@ func shisui(ctx *cli.Context) error { if err != nil { return err } + go func() { + debug.Setup(ctx) + }() // Start metrics export if enabled utils.SetupMetrics(ctx)