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

@@ -34,6 +34,7 @@ var (
netmonDebug = false
agentDebug = false
agentTrace = false
enablePprof = true
)
type testRuntimeConfig struct {
@@ -115,6 +116,7 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config testRuntimeConf
AgentTrace: agentTrace,
SharedFS: sharedFS,
VirtioFSDaemon: virtioFSdaemon,
EnablePprof: enablePprof,
}
runtimeConfigFileData := ktu.MakeRuntimeConfigFileData(configFileOptions)
@@ -197,6 +199,7 @@ func createAllRuntimeConfigFiles(dir, hypervisor string) (config testRuntimeConf
NetmonConfig: netmonConfig,
DisableNewNetNs: disableNewNetNs,
EnablePprof: enablePprof,
FactoryConfig: factoryConfig,
}