Commit 3e3dee68 authored by Wojciech Tyczynski's avatar Wojciech Tyczynski

Print stderr from go tool pprof in profile gatherer

parent 05944b1d
...@@ -17,6 +17,7 @@ limitations under the License. ...@@ -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 { ...@@ -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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment