gops
gops copied to clipboard
Extend `gops trace` to allow duration parameter
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.
cc @tklauser
I've tested this with the following combinations using examples/hello as the agent:
- new agent, new
gopsbinary:gops trace <pid> 10s-> works as expected - new agent, old
gopsbinary:gops trace <pid>->gopshangs indefinitely - old agent, new
gopsbinary a. without duration:gops trace <pid>->gopsexits withread tcp 127.0.0.1:53968->127.0.0.1:38565: read: connection reset by peerwithout 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?