Skip to content

Commit

Permalink
Add : mutex pprof profile (maticnetwork#731)
Browse files Browse the repository at this point in the history
* add : mutex pprof profile

* rm : remove trace from default pprof profiles
  • Loading branch information
0xsharma authored and thogard785 committed Apr 5, 2023
1 parent 2d34199 commit c66035d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/cli/debug_pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ 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",
"mutex": "mutex",
}

if !d.skiptrace {
Expand Down
3 changes: 3 additions & 0 deletions internal/cli/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net"
"net/http"
"os"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -96,6 +97,8 @@ func VerbosityStringToInt(loglevel string) int {

//nolint:gocognit
func NewServer(config *Config, opts ...serverOption) (*Server, error) {
runtime.SetMutexProfileFraction(5)

srv := &Server{
config: config,
}
Expand Down

0 comments on commit c66035d

Please sign in to comment.