From 1f40531dcaf9a6782baf31415800e9848ccb1ff1 Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Wed, 26 Jul 2017 10:57:55 -0700 Subject: [PATCH] Make the profile port configurable Signed-off-by: Mrunal Patel --- cmd/crio/main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/crio/main.go b/cmd/crio/main.go index a0ab09d2..263b1b8a 100644 --- a/cmd/crio/main.go +++ b/cmd/crio/main.go @@ -265,6 +265,11 @@ func main() { Name: "profile", Usage: "enable pprof remote profiler on localhost:6060", }, + cli.IntFlag{ + Name: "profile-port", + Value: 6060, + Usage: "port for the pprof profiler", + }, } sort.Sort(cli.FlagsByName(app.Flags)) @@ -318,8 +323,10 @@ func main() { app.Action = func(c *cli.Context) error { if c.GlobalBool("profile") { + profilePort := c.GlobalInt("profile-port") + profileEndpoint := fmt.Sprintf("localhost:%v", profilePort) go func() { - http.ListenAndServe("localhost:6060", nil) + http.ListenAndServe(profileEndpoint, nil) }() }