From 286ff24613b89a1eafabe2578c63c6506e91f84b Mon Sep 17 00:00:00 2001 From: Shivam Sharma Date: Wed, 8 Feb 2023 18:30:42 +0530 Subject: [PATCH 1/2] add : mutex pprof profile --- internal/cli/debug_pprof.go | 6 ++++-- internal/cli/server/server.go | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/cli/debug_pprof.go b/internal/cli/debug_pprof.go index a979741fda..1aaca89f8d 100644 --- a/internal/cli/debug_pprof.go +++ b/internal/cli/debug_pprof.go @@ -129,8 +129,10 @@ func (d *DebugPprofCommand) Run(args []string) int { // Only take cpu and heap profiles by default profiles := map[string]string{ - "heap": "heap", - "cpu": "cpu", + "heap": "heap", + "cpu": "cpu", + "trace": "trace", + "mutex": "mutex", } if !d.skiptrace { diff --git a/internal/cli/server/server.go b/internal/cli/server/server.go index f0cea4de06..44b291af40 100644 --- a/internal/cli/server/server.go +++ b/internal/cli/server/server.go @@ -8,6 +8,7 @@ import ( "net" "net/http" "os" + "runtime" "strings" "time" @@ -70,6 +71,8 @@ func WithGRPCListener(lis net.Listener) serverOption { //nolint:gocognit func NewServer(config *Config, opts ...serverOption) (*Server, error) { + runtime.SetMutexProfileFraction(5) + srv := &Server{ config: config, } From 40b5ae87ec73ecf9921ad3c8167b3e536712ac97 Mon Sep 17 00:00:00 2001 From: Shivam Sharma Date: Wed, 8 Feb 2023 23:02:07 +0530 Subject: [PATCH 2/2] rm : remove trace from default pprof profiles --- internal/cli/debug_pprof.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/cli/debug_pprof.go b/internal/cli/debug_pprof.go index 1aaca89f8d..ca14604b97 100644 --- a/internal/cli/debug_pprof.go +++ b/internal/cli/debug_pprof.go @@ -131,7 +131,6 @@ func (d *DebugPprofCommand) Run(args []string) int { profiles := map[string]string{ "heap": "heap", "cpu": "cpu", - "trace": "trace", "mutex": "mutex", }