How to get reference processing logging?

Andrew Haley aph at redhat.com
Wed Dec 7 11:26:07 UTC 2016


On 07/12/16 11:15, Thomas Schatzl wrote:
> Hi,
> 
> On Wed, 2016-12-07 at 11:08 +0000, Andrew Haley wrote:
>> I've tried "-Xlog:gc::ref" and "-Xlog:gc=ref" but neither works.
> 
> "-Xlog:gc+ref=debug"
> 
>>
>> I want to see this output:
>>
>>   log_debug(gc, ref)("Ref Counts: Soft: " SIZE_FORMAT " Weak: "
>> SIZE_FORMAT " Final: " SIZE_FORMAT " Phantom: " SIZE_FORMAT,
>>                      stats.soft_count(), stats.weak_count(),
>> stats.final_count(), stats.phantom_count());
>>   log_develop_trace(gc, ref)("JNI Weak Reference count: "
>> SIZE_FORMAT, count_jni_refs());
>>
>>
>> I tried -Xlog:help and searc hed on the web for information about the
>> -Xlog syntax, but no luck.
> 
> -Xlog:help gives a pretty comprehensive output with BNF syntax
> description here. It also includes a lot of examples.

Perhaps, but none of the examples actually contain "+".

> Particularly the sentence below the BNF string gives an explanation of
> "what" should be.
> 
> Maybe you have some suggestions to improve the text?

Indeed I do.  An example which contains the crucial "+" would be a start.
Like this:

-Xlog:gc+ref=debug
	 Log messages tagged with 'gc' and 'ref' tags using 'debug' level to stdout, with default decorations.

The crucial I didn't realize was that in

  log_debug(gc, ref)

both "gc" and "ref" are tags.  It's not obvious, but I suppose if I'd
studied the way the logging framework is called it would have been
clearer.  Nonethless, you shouldn't have to be a developer who knows
the logging API just in order to get some log output, and the syntax
is very obscure.

Is this stuff documented anywhere?

Thanks,

Andrew.



More information about the hotspot-gc-dev mailing list