• Damien Lespiau's avatar
    Add go profile instrumentation to kubectl · 5d634e7d
    Damien Lespiau authored
    This commit adds two new global options to kubectl: --profile and
    --profile-output, writing out go profiles to disk to debug interesting and
    unexpected kubectl behaviour.
    
    As an example, here is how to capture a block file, eg. for how long are we
    blocked on I/O and where?
    
    $ kubectl get nodes --profile=mutex -v6
    $ go tool pprof -png ./profile.pprof > out.png
    $ google-chrome out.png
    
    Fixes: #68679
    5d634e7d
profiling.go 1.98 KB