Skip to content

Conversation

@plummercj
Copy link
Contributor

@plummercj plummercj commented Dec 23, 2021

SA has the ability to fetch the thread's registers via the thread context. It would be nice to allow access to the registers from clhsdb. This plays in well with the enhancements being done to PointerFinder as part of JDK-8247514. Many of the register values will then be automatically displayed as symbols, Methods, Threads, stack offsets, nmethods, interpreter codelets, etc.

During some recent debugging I did I found it useful to dump a thread's registers in this manner. Although in this case I was inlining the code in the part of SA where I wanted to see the registers, having it as a clhsdb command would not only be useful to user, but also useful when debugging SA because it would serve as a code snippet to copy-n-paste where needed.

The syntax is:

threadcontext [-v] { -a | id }

Where -a displays all threads, and "id" is used to display a specific thread. This is the same argument syntax as some other commands that let you choose all threads or just one thread, such as the "thread" and "where" commands. -v just means more verbose output, whereas without it for the most part each register printed will just take up one line.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6925/head:pull/6925
$ git checkout pull/6925

Update a local copy of the PR:
$ git checkout pull/6925
$ git pull https://git.openjdk.java.net/jdk pull/6925/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6925

View PR using the GUI difftool:
$ git pr show -t 6925

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6925.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 23, 2021

👋 Welcome back cjplummer! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 23, 2021

@plummercj The following label will be automatically applied to this pull request:

  • serviceability

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the serviceability serviceability-dev@openjdk.org label Dec 23, 2021
@plummercj plummercj marked this pull request as ready for review December 23, 2021 04:47
@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 23, 2021
@mlbridge
Copy link

mlbridge bot commented Dec 23, 2021

Webrevs

Copy link
Contributor

@sspitsyn sspitsyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chris,
I only have one question (inlined).
Other than that it looks good to me.
Thanks,
Serguei

Copy link
Contributor

@kevinjwalls kevinjwalls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks useful to expose this info if we have it!

@openjdk
Copy link

openjdk bot commented Jan 4, 2022

@plummercj This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8250801: Add clhsdb "threadcontext" command

Reviewed-by: sspitsyn, kevinw

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 43 new commits pushed to the master branch:

  • 191f730: Merge
  • 95a3010: 8275830: C2: Receiver downcast is missing when inlining through method handle linkers
  • 58b5fb3: 8265317: [vector] assert(payload->is_object()) failed: expected 'object' value for scalar-replaced boxed vector but got: NULL
  • 06f3713: 8279379: GHA: Print tests that are in error
  • e7244c1: 8278966: two microbenchmarks tests fail "assert(!jvms->method()->has_exception_handlers()) failed: no exception handler expected" after JDK-8275638
  • b4b0328: 8278824: Uneven work distribution when scanning heap roots in G1
  • 99a8351: 8279386: Remove duplicate RefProcPhaseTimeTracker
  • d1e6f26: 8279351: [TESTBUG] SADebugDTest.java does not handle "Address already in use" error
  • 93c7d90: 8278282: G1: Log basic statistics for evacuation failure
  • 1ffdc52: 8279412: [JVMCI] failed speculations list must outlive any nmethod that refers to it
  • ... and 33 more: https://git.openjdk.java.net/jdk/compare/eaefb1a1ed9edea440628e3a5c5483ebd52bfcb0...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 4, 2022
@plummercj
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jan 18, 2022

Going to push as commit bdfa15d.
Since your change was applied there have been 204 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 18, 2022
@openjdk openjdk bot closed this Jan 18, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 18, 2022
@openjdk
Copy link

openjdk bot commented Jan 18, 2022

@plummercj Pushed as commit bdfa15d.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@plummercj plummercj deleted the 8250801_threadcontext branch January 26, 2022 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated serviceability serviceability-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

3 participants