RFR: JDK-8157141 & JDK-8166454: Solaris getisax(2) and meminfo(2) cleanup
Alan Burlison
Alan.Burlison at oracle.com
Mon Sep 26 16:39:18 UTC 2016
I'm redoing this to include the feedback so far, but:
On 23/09/2016 02:11, David Holmes wrote:
> One nit/favour ...
>
> src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp
>
> 364 log_info(os, cpu)("getisax(2) returned: ");
> 365 for (int i = 0; i < avn; i++) {
> 366 log_info(os, cpu)(" " PTR32_FORMAT, avs[i]);
> 367 }
>
> For compound logging statements it is better to put them in a
> conditional checking the logging is enabled - the original if statement
> escaped (my) notice, the use of a loop here makes this more obvious. You
> can then use the more direct logging form rather than the high-level
> log_info "macro"
>
> if (log_is_enabled(Info, os, cpu)) {
> outputStream* log = Log(os, cpu)::info_stream();
> log->print("getisax(2) returned:");
> for (int i = 0; i < avn; i++) {
> log->print(" " PTR32_FORMAT, avs[i]);
> }
> log->cr();
> }
If I make that change I get a coredump. I believe that's because the
code in question is run at JVM startup and outside of a JVM thread, so
the following assert is failing:
# Internal Error
(/opt/jprt/T/P1/093524.alanbur/s/hotspot/src/share/vm/runtime/thread.hpp:662),
pid=51406, tid=2
# assert(current != 0L) failed: Thread::current() called on detached thread
Is there a variant of this block of logging code that will work under
those circumstances?
Thanks,
--
Alan Burlison
--
More information about the hotspot-runtime-dev
mailing list