Request for Review: 7120511: Add diagnostic commands

Frederic Parain frederic.parain at oracle.com
Fri Jan 6 01:28:21 PST 2012


Hi David,

I've considered that the uptime value should be consistent
with other logging mechanisms in the VM tagging their output
with uptime timestamp (namely, the gc log), so I used the same
code to produce the uptime value. If the timestamp support
in the outputStream class is modified, the gc log timestamps
and the VMUptime timestamps will remain consistent.

Fred

On 01/ 6/12 03:19 AM, David Holmes wrote:
> Hi Fred,
>
> Curious about one thing. For the uptime, how does this:
>
> + void VMUptimeDCmd::execute(TRAPS) {
> + if (_date.value()) {
> + output()->date_stamp(true, "", ": ");
> + }
> + output()->time_stamp().update_to(tty->time_stamp().ticks());
> + output()->stamp();
> + output()->print_cr(" s");
> + }
>
> compare to simply doing "current time - VM start time" ? I guess the
> difference will be the difference between when os::elapsed_counter() was
> initialized and the VM start time is initialized. But the above seems a
> very non-obvious way of getting the uptime.
>
> David
> -----
>
> On 6/01/2012 1:19 AM, Frederic Parain wrote:
>> This changeset aims to add a first set of diagnostic commands
>> to the HotSpot JVM. It also includes minor modifications to
>> the diagnostic command framework implementation to ease
>> development of new diagnostic commands.
>>
>> The webrev is here:
>>
>> http://cr.openjdk.java.net/~fparain/7120511/webrev.00/
>>
>>
>> Here's the list of new diagnostic commands:
>>
>> Thread.print
>> Print all threads with stacktraces.
>>
>> GC.class_histogram
>> Provides statistics about the Java heap usage
>>
>> GC.heap_dump
>> Generate a HPROF format dump of the Java heap
>>
>> GC.run_finalization
>> Call java.lang.System.runFinalization().
>>
>> GC.run
>> Call java.lang.System.gc().
>>
>> VM.uptime
>> Print VM uptime.
>>
>> VM.flags
>> Print VM flag options and their current values.
>>
>> VM.system_properties
>> Print system properties
>>
>> VM.command_line
>> Print the command line used to start this VM instance.
>>
>>
>> Thanks,
>>
>> Fred
>>

-- 
Frederic Parain - Oracle
Grenoble Engineering Center - France
Phone: +33 4 76 18 81 17
Email: Frederic.Parain at Oracle.com



More information about the serviceability-dev mailing list