RFR: 8268425: Show decimal nid of OSThread instead of hex format one
Thomas Stuefe
stuefe at openjdk.java.net
Mon Jun 28 13:50:14 UTC 2021
On Mon, 28 Jun 2021 12:41:35 GMT, David Holmes <david.holmes at oracle.com> wrote:
> > You'd do:
> > print("nid: " UINT64_FORMAT, (uint64_t) id):;
> > thread_t is, among other things, pthread_t, which is opaque. Any current code treating that as signed int is incorrect too.
>
> If it is opaque then I don't see how signed or unsigned makes any
> difference. You are assuming it can just be treated as a 64-bit value;
> whether you interpret that as a signed or unsigned value just changes
> how you print it. I agree printing only positive values is nicer visually.
>
> David
My `signed in` comment was referring to the existing use of `%d` in the code base. I'm more concerned with the 32bit range of int than the signedness (though I never saw an OS tool displaying negative numbers for thread ids).
-------------
PR: https://git.openjdk.java.net/jdk/pull/4449
More information about the serviceability-dev
mailing list