Skip to content

Commit

Permalink
Remove the heuristic of recognizing build ID command line arg. (#775)
Browse files Browse the repository at this point in the history
I am not entirely sure why this heuristic exists and we have -buildid
flag for this anyway. I suspect having this shortcut to specify the
build ID was for some reason more important in the past (more profiles
did not record the build ID of the main binary? not sure), but now it
seems very exotic to have to specify the build ID anyway.
  • Loading branch information
aalexand committed Apr 29, 2023
1 parent 29acb7f commit 905365e
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions internal/driver/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"errors"
"fmt"
"os"
"strings"

"github.com/google/pprof/internal/binutils"
"github.com/google/pprof/internal/plugin"
Expand Down Expand Up @@ -102,9 +101,6 @@ func parseFlags(o *plugin.Options) (*source, []string, error) {
file.Close()
execName = arg0
args = args[1:]
} else if *flagBuildID == "" && isBuildID(arg0) {
*flagBuildID = arg0
args = args[1:]
}
}

Expand Down Expand Up @@ -265,12 +261,6 @@ func installConfigFlags(flag plugin.FlagSet, cfg *config) func() error {
}
}

// isBuildID determines if the profile may contain a build ID, by
// checking that it is a string of hex digits.
func isBuildID(id string) bool {
return strings.Trim(id, "0123456789abcdefABCDEF") == ""
}

func sampleIndex(flag *bool, si string, sampleType, option string, ui plugin.UI) string {
if *flag {
if si == "" {
Expand Down

0 comments on commit 905365e

Please sign in to comment.