@@ -177,7 +177,6 @@ func resolvePath(path string) string {
177177
178178func Start (cfg * config.Config ) error {
179179 var (
180- agentFlagSet = flag .NewFlagSet ("pyroscope agent" , flag .ExitOnError )
181180 serverFlagSet = flag .NewFlagSet ("pyroscope server" , flag .ExitOnError )
182181 convertFlagSet = flag .NewFlagSet ("pyroscope convert" , flag .ExitOnError )
183182 execFlagSet = flag .NewFlagSet ("pyroscope exec" , flag .ExitOnError )
@@ -187,7 +186,6 @@ func Start(cfg *config.Config) error {
187186 rootFlagSet = flag .NewFlagSet ("pyroscope" , flag .ExitOnError )
188187 )
189188
190- agentSortedFlags := PopulateFlagSet (& cfg .Agent , agentFlagSet )
191189 serverSortedFlags := PopulateFlagSet (& cfg .Server , serverFlagSet )
192190 convertSortedFlags := PopulateFlagSet (& cfg .Convert , convertFlagSet )
193191 execSortedFlags := PopulateFlagSet (& cfg .Exec , execFlagSet , "pid" )
@@ -203,15 +201,6 @@ func Start(cfg *config.Config) error {
203201 ff .WithConfigFileFlag ("config" ),
204202 }
205203
206- agentCmd := & ffcli.Command {
207- UsageFunc : agentSortedFlags .printUsage ,
208- Options : options ,
209- Name : "agent" ,
210- ShortUsage : "pyroscope agent [flags]" ,
211- ShortHelp : "starts pyroscope agent. Run this one on the machines you want to profile" ,
212- FlagSet : agentFlagSet ,
213- }
214-
215204 serverCmd := & ffcli.Command {
216205 UsageFunc : serverSortedFlags .printUsage ,
217206 Options : options ,
@@ -272,7 +261,6 @@ func Start(cfg *config.Config) error {
272261 ShortUsage : "pyroscope [flags] <subcommand>" ,
273262 FlagSet : rootFlagSet ,
274263 Subcommands : []* ffcli.Command {
275- agentCmd ,
276264 convertCmd ,
277265 serverCmd ,
278266 execCmd ,
@@ -282,15 +270,6 @@ func Start(cfg *config.Config) error {
282270 },
283271 }
284272
285- agentCmd .Exec = func (_ context.Context , args []string ) error {
286- if l , err := logrus .ParseLevel (cfg .Agent .LogLevel ); err == nil {
287- logrus .SetLevel (l )
288- }
289- a := agent .New (cfg )
290- atexit .Register (a .Stop )
291- a .Start ()
292- return nil
293- }
294273 serverCmd .Exec = func (_ context.Context , args []string ) error {
295274 if l , err := logrus .ParseLevel (cfg .Server .LogLevel ); err == nil {
296275 logrus .SetLevel (l )
@@ -374,7 +353,7 @@ func startServer(cfg *config.Config) {
374353 panic (err )
375354 }
376355 u := direct .New (cfg , s )
377- go agent .SelfProfile (cfg , u , "pyroscope.server.cpu{}" )
356+ go agent .SelfProfile (cfg , u , "pyroscope.server.cpu{}" , logrus . StandardLogger () )
378357 go printRAMUsage ()
379358 go printDiskUsage (cfg )
380359 c := server .New (cfg , s )
0 commit comments