gops icon indicating copy to clipboard operation
gops copied to clipboard

Extend `gops trace` to allow duration parameter

Open glibsm opened this issue 3 years ago • 2 comments

gops trace :port 10m will now run a trace for 10 minutes, as opposed to always doing 5 seconds.

For backwards compatibility both server and the client default to 5s if nothing is specified.

glibsm avatar Mar 29 '22 09:03 glibsm

cc @tklauser

glibsm avatar Mar 29 '22 09:03 glibsm

I've tested this with the following combinations using examples/hello as the agent:

  1. new agent, new gops binary: gops trace <pid> 10s -> works as expected
  2. new agent, old gops binary: gops trace <pid> -> gops hangs indefinitely
  3. old agent, new gops binary a. without duration: gops trace <pid> -> gops exits with read tcp 127.0.0.1:53968->127.0.0.1:38565: read: connection reset by peer without displaying a trace b. with duration: gops trace <pid> 10s -> same as 3a above.

(where "new" means built from this PR and old means built from current master)

It looks like this change is not backwards compatible. Do you think we can modify it in a way that cases 2 and 3a/b would work as well?

tklauser avatar Mar 29 '22 13:03 tklauser