8214912: LogCompilation: Show the comp level

Show the TieredCompilation level from the xml log

Reviewed-by: kvn, iignatyev
This commit is contained in:
Eric Caspole 2018-12-06 13:54:19 -05:00
parent 99bcec08b1
commit ebbbb4f9d6
6 changed files with 5172 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -216,6 +216,10 @@ public class Compilation implements LogEvent {
} else {
if (printID) {
stream.print(getId());
// Print the comp level next to the id as with +PrintCompilation
if (nmethod != null && nmethod.getLevel() != 0) {
stream.print(" " + nmethod.getLevel());
}
}
int bc = isOsr() ? getBCI() : -1;
stream.print(getMethod().decodeFlags(bc) + " " + compiler + " " + getMethod().format(bc));

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1096,6 +1096,10 @@ public class LogParser extends DefaultHandler implements ErrorHandler {
id,
parseLong(atts.getValue("address")),
parseLong(atts.getValue("size")));
String level = atts.getValue("level");
if (level != null) {
nm.setLevel(parseLong(level));
}
nmethods.put(id, nm);
events.add(nm);
} else if (qname.equals("parse")) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -42,6 +42,11 @@ public class NMethod extends BasicLogEvent {
*/
private long size;
/**
* The nmethod's compilation level.
*/
private long level;
NMethod(double s, String i, long a, long sz) {
super(s, i);
address = a;
@ -68,4 +73,18 @@ public class NMethod extends BasicLogEvent {
public void setSize(long size) {
this.size = size;
}
/**
* @return the level
*/
public long getLevel() {
return level;
}
/**
* @param level the level to set
*/
public void setLevel(long level) {
this.level = level;
}
}

View File

@ -53,7 +53,9 @@ public class TestLogCompilation {
// no file (just prints the help)
{"./src/test/resources/hotspot_pid23756.log"},
// LogCompilation output of running on above file
{"./src/test/resources/hotspot_pid25109.log"}
{"./src/test/resources/hotspot_pid25109.log"},
{"./src/test/resources/no_tiered_short.log"},
{"./src/test/resources/tiered_short.log"}
};
return Arrays.asList(data);

View File

@ -0,0 +1,140 @@
<?xml version='1.0' encoding='UTF-8'?>
<hotspot_log version='160 1' process='22365' time_ms='1544108271535'>
<vm_version>
<name>
Java HotSpot(TM) 64-Bit Server VM
</name>
<release>
11+28
</release>
<info>
Java HotSpot(TM) 64-Bit Server VM (11+28) for linux-amd64 JRE (11+28), built on Aug 22 2018 18:51:59 by &quot;mach5one&quot; with gcc 7.3.0
</info>
</vm_version>
<vm_arguments>
<args>
-XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation </args>
<command>
target/LogCompilation-1.0-SNAPSHOT.jar
</command>
<launcher>
SUN_STANDARD
</launcher>
<properties>
java.vm.specification.name=Java Virtual Machine Specification
java.vm.version=11+28
java.vm.name=Java HotSpot(TM) 64-Bit Server VM
jdk.debug=release
sun.boot.library.path=/opt/jdk-11/lib
java.library.path=/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
java.home=/opt/jdk-11
java.class.path=target/LogCompilation-1.0-SNAPSHOT.jar
jdk.boot.class.path.append=
java.vm.info=mixed mode, aot, sharing
java.vm.specification.vendor=Oracle Corporation
java.vm.specification.version=11
java.vm.vendor=Oracle Corporation
sun.java.command=target/LogCompilation-1.0-SNAPSHOT.jar
sun.java.launcher=SUN_STANDARD
</properties>
</vm_arguments>
<tty>
<writer thread='22366'/>
<blob name='MethodHandlesAdapterBlob' size='32000'>
<sect index='1' size='32000' free='31616'/>
</blob>
<task_queued compile_id='1' method='java.lang.StringLatin1 hashCode ([B)I' bytes='42' count='423' backedge_count='5000' iicount='423' stamp='0.643' comment='count' hot_count='423'/>
<writer thread='22376'/>
<thread_logfile thread='22376' filename='/tmp/hs_c22376_pid22365.log'/>
<nmethod compile_id='1' compiler='c2' entry='0x00007f0943c06b20' size='928' address='0x00007f0943c06990' relocation_offset='376' insts_offset='400' stub_offset='720' scopes_data_offset='752' scopes_pcs_offset='824' dependencies_offset='904' nul_chk_table_offset='912' metadata_offset='744' method='java.lang.StringLatin1 hashCode ([B)I' bytes='42' count='5000' backedge_count='5017' iicount='855' stamp='0.750'/>
<writer thread='22366'/>
<nmethod compile_id='2' compile_kind='c2n' compiler='' entry='0x00007f0943c10620' size='432' address='0x00007f0943c10490' relocation_offset='376' consts_offset='432' insts_offset='400' method='java.lang.invoke.MethodHandle linkToStatic (Ljava/lang/Object;Ljava/lang/Object;IILjava/lang/invoke/MemberName;)I' bytes='0' count='0' iicount='0' stamp='0.938'/>
<nmethod compile_id='3' compile_kind='c2n' compiler='' entry='0x00007f0943c145a0' size='440' address='0x00007f0943c14410' relocation_offset='376' consts_offset='440' insts_offset='400' method='java.lang.invoke.MethodHandle linkToStatic (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/invoke/MemberName;)Ljava/lang/Object;' bytes='0' count='0' iicount='0' stamp='1.099'/>
<nmethod compile_id='4' compile_kind='c2n' compiler='' entry='0x00007f0943c14ca0' size='432' address='0x00007f0943c14b10' relocation_offset='376' consts_offset='432' insts_offset='400' method='java.lang.invoke.MethodHandle linkToStatic (IILjava/lang/invoke/MemberName;)I' bytes='0' count='0' iicount='0' stamp='1.101'/>
<nmethod compile_id='5' compile_kind='c2n' compiler='' entry='0x00007f0943c14ea0' size='448' address='0x00007f0943c14d10' relocation_offset='376' consts_offset='448' insts_offset='400' method='java.lang.invoke.MethodHandle invokeBasic (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;' bytes='0' count='0' iicount='0' stamp='1.114'/>
<nmethod compile_id='6' compile_kind='c2n' compiler='' entry='0x00007f0943c150a0' size='440' address='0x00007f0943c14f10' relocation_offset='376' consts_offset='440' insts_offset='400' method='java.lang.invoke.MethodHandle linkToSpecial (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/invoke/MemberName;)Ljava/lang/Object;' bytes='0' count='0' iicount='0' stamp='1.114'/>
<nmethod compile_id='7' compile_kind='c2n' compiler='' entry='0x00007f0943c16920' size='432' address='0x00007f0943c16790' relocation_offset='376' consts_offset='432' insts_offset='400' method='java.lang.invoke.MethodHandle linkToStatic (ILjava/lang/invoke/MemberName;)Ljava/lang/Object;' bytes='0' count='0' iicount='0' stamp='1.159'/>
<nmethod compile_id='8' compile_kind='c2n' compiler='' entry='0x00007f0943c16b20' size='448' address='0x00007f0943c16990' relocation_offset='376' consts_offset='448' insts_offset='400' method='java.lang.invoke.MethodHandle invokeBasic (I)Ljava/lang/Object;' bytes='0' count='0' iicount='0' stamp='1.160'/>
<nmethod compile_id='9' compile_kind='c2n' compiler='' entry='0x00007f0943c16d20' size='432' address='0x00007f0943c16b90' relocation_offset='376' consts_offset='432' insts_offset='400' method='java.lang.invoke.MethodHandle linkToSpecial (Ljava/lang/Object;ILjava/lang/invoke/MemberName;)Ljava/lang/Object;' bytes='0' count='0' iicount='0' stamp='1.160'/>
<tty_done stamp='1.171'/>
</tty>
<compilation_log thread='22376'>
<start_compile_thread name='C2 CompilerThread0' thread='22376' process='22365' stamp='0.650'/>
<task compile_id='1' method='java.lang.StringLatin1 hashCode ([B)I' bytes='42' count='540' backedge_count='8448' iicount='540' stamp='0.728'>
<type id='962' name='int'/>
<klass id='1073' name='[B' flags='1041'/>
<klass id='1081' name='java.lang.StringLatin1' flags='16'/>
<method id='1082' holder='1081' name='hashCode' return='962' arguments='1073' flags='9' bytes='42' iicount='540'/>
<parse method='1082' uses='540.000000' stamp='0.728'>
<bc code='190' bci='5'/>
<uncommon_trap bci='5' reason='null_check' action='maybe_recompile' debug_id='0'/>
<bc code='162' bci='13'/>
<branch target_bci='40' taken='375' not_taken='9914' cnt='10289.000000' prob='0.0364467'/>
<uncommon_trap bci='13' reason='predicate' action='maybe_recompile' debug_id='0'/>
<uncommon_trap bci='13' reason='profile_predicate' action='maybe_recompile' debug_id='0'/>
<uncommon_trap bci='13' reason='loop_limit_check' action='maybe_recompile' debug_id='0'/>
<bc code='51' bci='19'/>
<uncommon_trap bci='19' reason='range_check' action='make_not_entrant' debug_id='0' comment='range_check'/>
<bc code='162' bci='13'/>
<branch target_bci='40' taken='375' not_taken='9914' cnt='9914.000000' prob='0.0364467'/>
<parse_done nodes='154' live='148' memory='44576' stamp='0.739'/>
</parse>
<loop_tree>
<loop idx='166' >
<loop idx='167' >
</loop>
</loop>
</loop_tree>
<loop_tree>
<loop idx='166' >
<loop idx='284' inner_loop='1' main_loop='284' >
</loop>
</loop>
</loop_tree>
<loop_tree>
<loop idx='231' inner_loop='1' pre_loop='167' >
</loop>
<loop idx='166' >
<loop idx='325' inner_loop='1' main_loop='325' >
</loop>
</loop>
<loop idx='204' inner_loop='1' post_loop='167' >
</loop>
</loop_tree>
<loop_tree>
<loop idx='231' inner_loop='1' pre_loop='167' >
</loop>
<loop idx='166' >
<loop idx='325' inner_loop='1' main_loop='325' >
</loop>
</loop>
<loop idx='204' inner_loop='1' post_loop='167' >
</loop>
</loop_tree>
<loop_tree>
<loop idx='231' inner_loop='1' pre_loop='167' >
</loop>
<loop idx='166' >
<loop idx='325' inner_loop='1' main_loop='325' >
</loop>
</loop>
<loop idx='204' inner_loop='1' post_loop='167' >
</loop>
</loop_tree>
<loop_tree>
<loop idx='231' inner_loop='1' pre_loop='167' >
</loop>
<loop idx='166' >
<loop idx='325' inner_loop='1' main_loop='325' >
</loop>
</loop>
<loop idx='204' inner_loop='1' post_loop='167' >
</loop>
</loop_tree>
<regalloc attempts='2' success='1'/>
<code_cache total_blobs='229' nmethods='1' adapters='131' free_code_cache='49931648'/>
<task_done success='1' nmsize='344' count='5000' backedge_count='5013' stamp='0.750'/>
</task>
</compilation_log>
<hotspot_log_done stamp='1.172'/>
</hotspot_log>

File diff suppressed because it is too large Load Diff