diff options
author | Adin Scannell <ascannell@google.com> | 2020-12-29 16:21:27 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-12-29 16:23:01 -0800 |
commit | 85c1c3ed4b8d32c499c53917765acef20cb16248 (patch) | |
tree | 570a3b4a57b970d2fd05b6767f9b1aa0fe6bc393 /pkg/urpc | |
parent | 91c05c609e4dbdc9790037e2dea3e55e784e4da5 (diff) |
Make profiling commands synchronous.
This allows for a model of profiling when you can start collection, and
it will terminate when the sandbox terminates. Without this synchronous
call, it is effectively impossible to collect length blocking and mutex
profiles.
PiperOrigin-RevId: 349483418
Diffstat (limited to 'pkg/urpc')
-rw-r--r-- | pkg/urpc/urpc.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pkg/urpc/urpc.go b/pkg/urpc/urpc.go index 13b2ea314..dfd23032c 100644 --- a/pkg/urpc/urpc.go +++ b/pkg/urpc/urpc.go @@ -283,12 +283,10 @@ func (s *Server) handleOne(client *unet.Socket) error { // Client is dead. return err } + if s.afterRPCCallback != nil { + defer s.afterRPCCallback() + } - defer func() { - if s.afterRPCCallback != nil { - s.afterRPCCallback() - } - }() // Explicitly close all these files after the call. // // This is also explicitly a reference to the files after the call, |