Skip to content

Commit

Permalink
Bail out fast when no demangling is requested (google#915)
Browse files Browse the repository at this point in the history
* Bail out fast when no demangling is requested 

Avoid trying to demangle functions one by one; besides, `demangleSingleFunction` doesn't quite behave correctly when **no** demangling is requested.

* s/bail/Bail

---------

Co-authored-by: Alexey Alexandrov <[email protected]>
  • Loading branch information
mtrofin and aalexand authored Dec 6, 2024
1 parent 484a855 commit 61a79c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/symbolizer/symbolizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ func Demangle(prof *profile.Profile, force bool, demanglerMode string) {
}

options := demanglerModeToOptions(demanglerMode)
// Bail out fast to avoid any parsing, if we really don't want any demangling.
if len(options) == 0 {
return
}
for _, fn := range prof.Function {
demangleSingleFunction(fn, options)
}
Expand Down

0 comments on commit 61a79c6

Please sign in to comment.