mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
Merge pull request #59651 from wojtek-t/print_stderr
Automatic merge from submit-queue (batch tested with PRs 59447, 59594, 59651, 59389). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Print stderr from go tool pprof in profile gatherer
This commit is contained in:
commit
79e02dee3e
@ -17,6 +17,7 @@ limitations under the License.
|
|||||||
package framework
|
package framework
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
@ -107,8 +108,10 @@ func gatherProfileOfKind(profileBaseName, kind string) error {
|
|||||||
}
|
}
|
||||||
defer outfile.Close()
|
defer outfile.Close()
|
||||||
cmd.Stdout = outfile
|
cmd.Stdout = outfile
|
||||||
|
stderr := bytes.NewBuffer(nil)
|
||||||
|
cmd.Stderr = stderr
|
||||||
if err := cmd.Run(); nil != err {
|
if err := cmd.Run(); nil != err {
|
||||||
return fmt.Errorf("Failed to run 'go tool pprof': %v", err)
|
return fmt.Errorf("Failed to run 'go tool pprof': %v, stderr: %#v", err, stderr.String())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user