瀏覽代碼

Ignores stdout and stderr from perf_to_profile

Wade Simba Khadder 8 年之前
父節點
當前提交
f5fb4002ba
共有 1 個檔案被更改,包括 2 行新增20 行删除
  1. 2
    20
      internal/driver/fetch.go

+ 2
- 20
internal/driver/fetch.go 查看文件

417
 }
417
 }
418
 
418
 
419
 // convertPerfData converts the file at path which should be in perf.data format
419
 // convertPerfData converts the file at path which should be in perf.data format
420
-// using the perf_to_profile tool. It prints the stderr and stdout of
421
-// perf_to_profile to the stderr and stdout of this process, then returns the
422
-// path to a file containing the profile.proto formatted data.
420
+// using the perf_to_profile tool and returns the path to a file containing the
421
+// profile.proto formatted data.
423
 func convertPerfData(perfPath string, ui plugin.UI) (string, error) {
422
 func convertPerfData(perfPath string, ui plugin.UI) (string, error) {
424
 	ui.Print(fmt.Sprintf(
423
 	ui.Print(fmt.Sprintf(
425
 		"Converting %s to a profile.proto... (May take a few minutes)",
424
 		"Converting %s to a profile.proto... (May take a few minutes)",
432
 	randomFileName := "/tmp/pprof_" +
431
 	randomFileName := "/tmp/pprof_" +
433
 		base64.StdEncoding.EncodeToString(randomBytes)
432
 		base64.StdEncoding.EncodeToString(randomBytes)
434
 	cmd := exec.Command("perf_to_profile", perfPath, randomFileName)
433
 	cmd := exec.Command("perf_to_profile", perfPath, randomFileName)
435
-
436
-	stdout, stdoutErr := cmd.StdoutPipe()
437
-	if stdoutErr != nil {
438
-		return "", stdoutErr
439
-	}
440
-	go func() {
441
-		io.Copy(os.Stdout, stdout)
442
-	}()
443
-
444
-	stderr, stderrErr := cmd.StderrPipe()
445
-	if stderrErr != nil {
446
-		return "", stderrErr
447
-	}
448
-	go func() {
449
-		io.Copy(os.Stderr, stderr)
450
-	}()
451
-
452
 	if err := cmd.Run(); err != nil {
434
 	if err := cmd.Run(); err != nil {
453
 		return "", err
435
 		return "", err
454
 	}
436
 	}