MCPcopy Create free account
hub / github.com/CPChain/chain / writeProfile

Function writeProfile

internal/debug/api.go:192–201  ·  view source on GitHub ↗
(name, file string)

Source from the content-addressed store, hash-verified

190}
191
192func writeProfile(name, file string) error {
193 p := pprof.Lookup(name)
194 log.Info("Writing profile records", "count", p.Count(), "type", name, "dump", file)
195 f, err := os.Create(expandHome(file))
196 if err != nil {
197 return err
198 }
199 defer f.Close()
200 return p.WriteTo(f, 0)
201}
202
203// expands home directory in file paths.
204// ~someuser/tmp will not be expanded.

Callers 5

BlockProfileMethod · 0.85
WriteBlockProfileMethod · 0.85
MutexProfileMethod · 0.85
WriteMutexProfileMethod · 0.85
WriteMemProfileMethod · 0.85

Calls 5

expandHomeFunction · 0.85
InfoMethod · 0.65
CreateMethod · 0.65
CloseMethod · 0.65
CountMethod · 0.45

Tested by

no test coverage detected