gh-98894: fix CheckDtraceProbes tests on Solaris - #154803
Open
kulikjak wants to merge 1 commit into
Open
Conversation
…st process itself
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Solaris does not use the notes section to list available probes (
readelf -n <binary>returns nothing), which makes thetest_check_probesfail.This PR adds a Solaris specific path which gets all the available probes by listing those available in the running test process instead.
The output below is very different so the comparison needs to be updated a little as well.
A little unfortunate thing is that the test now requires elevated privileges, but that is true of all other DTrace tests as well, so I don't think that's a big deal.
BTW: there is Solaris specific ELF section for DTrace metadata and at first I wanted to fix the test by reading that one (with
readelf -p .SUNW_dof <binary>). Unfortunately, the section includes more metadata than just available probes, and the now removed line probe is also present in the dumped strings (sotest_check_probespasses, buttest_missing_probesunexpectedly passes as well).It's possible to use
elfdumpand do some binary parsing to extract only the available ones, but that is a huge overkill for a test like this. For those interested, the change is here: kulikjak@564e946