-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for LLVM objdump #534
Conversation
sync to upstream
When a binary provided to pprof has no symbols, it is not recognized as a binary. This happens because the err value is only checked against 'nil'. This PR fixes this issue by checking the err value against elf.ErrNoSymbols in addition to nil.
Recognize an executable without symbols
pull from remote master
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
c470b1e
to
e072f4a
Compare
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Failures unrelated. Restarted the jobs |
gentle ping. |
It feels that the PR description doesn't tell the full story. There is no binutils version 9.0, that seems LLVM objdump. It seems that what we are trying to dispatch on here is binutils vs. LLVM objdump, so the PR description and the code change should be centered around that IMO. |
internal/binutils/binutils.go
Outdated
@@ -120,6 +121,29 @@ func (bu *Binutils) SetTools(config string) { | |||
bu.update(func(r *binrep) { initTools(r, config) }) | |||
} | |||
|
|||
func ensureObjdumpVersion(objdump string, objdumpFound bool) (string, bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer top-down function order in Go - place this function after its use, i.e. after initTools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
internal/binutils/binutils_test.go
Outdated
@@ -189,14 +191,39 @@ func skipUnlessDarwinAmd64(t *testing.T) { | |||
} | |||
|
|||
func testDisasm(t *testing.T, intelSyntax bool) { | |||
if runtime.GOOS == "darwin" { | |||
// get objdump version and skip test if < 9.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: get -> Get (proper sentences for comments).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Thanks for the patch! As Alexey noted, this patch with a few tweaks can work with llvm-objdump on other (non-Mac) platforms. Both rupprecht and I have made some UI improvements to llvm-objdump 10. llvm-objdump 10 may be closer to GNU objdump. (The function:line pattern just looks like GNU objdump's output) Consider using |
cda73ae
to
853e9d0
Compare
The PR description states Yes, this is (Apple) LLVM objdump. This PR is only to add support for the
LLVM objdump support for Linux should be a separate, probably small, PR. |
A separate PR will add support for LLVM objdump for non-Mac platforms.
I am not too familiar with how Apple changes their code from LLVM, so I figured it is safe to stay with documented flags. |
Codecov Report
@@ Coverage Diff @@
## master #534 +/- ##
=======================================
Coverage 68.33% 68.33%
=======================================
Files 39 39
Lines 8005 8044 +39
=======================================
+ Hits 5470 5497 +27
- Misses 2114 2120 +6
- Partials 421 427 +6
Continue to review full report at Codecov.
|
|
Some Mac combinations which were not tested in CI
|
Failures are due to timeouts. PR can be reviewed |
cb2b584
to
478ecfd
Compare
Failures due to timeout, restarted. Code ok to review. |
gentle ping. |
b0bc32b
to
ed96624
Compare
1edfed9
to
ee01eb1
Compare
PTAL. All test passed before the latest merge. The latest merge is only a comment change, no functional changes. Code can be reviewed. |
Restarted timedout tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, probably last round of minor style nits. Thanks for bearing with the comments.
Restarted timed out tests. Code is ready for review, PTAL.
Thank you for patiently providing the thoughtful reviews. |
Gentle ping |
Bump from 20191205061153 => 20201109224723 My personal interest is to pull in google/pprof#564, which adds support for displaying names with `"` in them, which julia functions sometimes have (e.g. `var"#foo#23"`) Includes: - google/pprof#564 - google/pprof#575 - google/pprof#574 - google/pprof#571 - google/pprof#572 - google/pprof#570 - google/pprof#562 - google/pprof#561 - google/pprof#565 - google/pprof#560 - google/pprof#563 - google/pprof#557 - google/pprof#554 - google/pprof#552 - google/pprof#545 - google/pprof#549 - google/pprof#547 - google/pprof#541 - google/pprof#534 - google/pprof#542 - google/pprof#535 - google/pprof#531 - google/pprof#530 - google/pprof#528 - google/pprof#522 - google/pprof#525 - google/pprof#527 - google/pprof#519 - google/pprof#520 - google/pprof#517 - google/pprof#518 - google/pprof#514 - google/pprof#513 - google/pprof#510 - google/pprof#508 - google/pprof#506 - google/pprof#509 - google/pprof#504
* Update pprof to latest revision Bump from 20191205061153 => 20201109224723 My personal interest is to pull in google/pprof#564, which adds support for displaying names with `"` in them, which julia functions sometimes have (e.g. `var"#foo#23"`) Includes: - google/pprof#564 - google/pprof#575 - google/pprof#574 - google/pprof#571 - google/pprof#572 - google/pprof#570 - google/pprof#562 - google/pprof#561 - google/pprof#565 - google/pprof#560 - google/pprof#563 - google/pprof#557 - google/pprof#554 - google/pprof#552 - google/pprof#545 - google/pprof#549 - google/pprof#547 - google/pprof#541 - google/pprof#534 - google/pprof#542 - google/pprof#535 - google/pprof#531 - google/pprof#530 - google/pprof#528 - google/pprof#522 - google/pprof#525 - google/pprof#527 - google/pprof#519 - google/pprof#520 - google/pprof#517 - google/pprof#518 - google/pprof#514 - google/pprof#513 - google/pprof#510 - google/pprof#508 - google/pprof#506 - google/pprof#509 - google/pprof#504 * Update P/pprof/build_tarballs.jl - use a real version number Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com> * Remove now unused `timestamp` * [pprof] Use `GitSource` Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
Add support for LLVM objdump.
Adds support for LLVM objdump