Sfoglia il codice sorgente

Update perf_to_profile cli arguments to use flags. (#277) (#332)

Update perf_to_profile cli arguments to use flags. (#277)

Fixes #277

As perf_to_profile uses flags to parse its arguments, modify the call to perf_to_profile to use flags. Also pass the '-f' flag to overwrite the existing output profile file.
Redirect perf_to_profile's stdout/stderr to pprof's stdout/stderr.
lannadorai 7 anni fa
parent
commit
e8d30eee16
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2
    1
      internal/driver/fetch.go

+ 2
- 1
internal/driver/fetch.go Vedi File

@@ -534,7 +534,8 @@ func convertPerfData(perfPath string, ui plugin.UI) (*os.File, error) {
534 534
 		return nil, err
535 535
 	}
536 536
 	deferDeleteTempFile(profile.Name())
537
-	cmd := exec.Command("perf_to_profile", perfPath, profile.Name())
537
+	cmd := exec.Command("perf_to_profile", "-i", perfPath, "-o", profile.Name(), "-f")
538
+	cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
538 539
 	if err := cmd.Run(); err != nil {
539 540
 		profile.Close()
540 541
 		return nil, fmt.Errorf("failed to convert perf.data file. Try github.com/google/perf_data_converter: %v", err)