runtime: add pprof interface for shim

Add new http interfaces to support pprof:

- /sandboxes
- /debug/vars
- /debug/pprof/
- /debug/pprof/cmdline
- /debug/pprof/profile
- /debug/pprof/symbol
- /debug/pprof/trace

Fixes: #397

Signed-off-by: bin liu <bin@hyper.sh>
This commit is contained in:
bin liu
2020-07-09 01:10:02 +08:00
parent e3a3818f7a
commit bbf8517050
18 changed files with 336 additions and 21 deletions

View File

@@ -42,6 +42,7 @@ type RuntimeConfigOptions struct {
NetmonDebug bool
AgentDebug bool
AgentTrace bool
EnablePprof bool
}
func MakeRuntimeConfigFileData(config RuntimeConfigOptions) string {
@@ -89,5 +90,6 @@ func MakeRuntimeConfigFileData(config RuntimeConfigOptions) string {
[runtime]
enable_debug = ` + strconv.FormatBool(config.RuntimeDebug) + `
enable_tracing = ` + strconv.FormatBool(config.RuntimeTrace) + `
disable_new_netns= ` + strconv.FormatBool(config.DisableNewNetNs)
disable_new_netns= ` + strconv.FormatBool(config.DisableNewNetNs) + `
enable_pprof= ` + strconv.FormatBool(config.EnablePprof)
}