Skip to content
Permalink
Browse files
8257518: LogCompilation: java.lang.InternalError with JFR turned on
Reviewed-by: kvn, redestad
  • Loading branch information
Eric Caspole committed Dec 9, 2020
1 parent 6c69eca commit cf62b0ad869979b0ce307d625794dcd05cbec6ec
@@ -716,7 +716,12 @@ long parseLong(String l) {
Compilation c = log.compiles.get(ble.getId());
if (c == null) {
if (!(ble instanceof NMethod)) {
throw new InternalError("only nmethods should have a null compilation, here's a " + ble.getClass());
if (ble instanceof MakeNotEntrantEvent && ((MakeNotEntrantEvent) ble).getCompileKind().equals("c2n")) {
// this is ok for c2n
assert ((MakeNotEntrantEvent) ble).getLevel().equals("0") : "Should be level 0";
} else {
throw new InternalError("only nmethods should have a null compilation, here's a " + ble.getClass());
}
}
continue;
}
@@ -1071,8 +1076,12 @@ public void startElement(String uri, String localName, String qname, Attributes
String id = makeId(atts);
NMethod nm = nmethods.get(id);
if (nm == null) reportInternalError("nm == null");
LogEvent e = new MakeNotEntrantEvent(Double.parseDouble(search(atts, "stamp")), id,
MakeNotEntrantEvent e = new MakeNotEntrantEvent(Double.parseDouble(search(atts, "stamp")), id,
atts.getValue("zombie") != null, nm);
String compileKind = atts.getValue("compile_kind");
e.setCompileKind(compileKind);
String level = atts.getValue("level");
e.setLevel(level);
events.add(e);
} else if (qname.equals("uncommon_trap")) {
String id = atts.getValue("compile_id");
@@ -42,6 +42,16 @@
*/
private NMethod nmethod;

/**
* The compilation level.
*/
private String level;

/**
* The compile kind.
*/
private String compileKind;

MakeNotEntrantEvent(double s, String i, boolean z, NMethod nm) {
super(s, i);
zombie = z;
@@ -63,4 +73,37 @@ public void print(PrintStream stream, boolean printID) {
public boolean isZombie() {
return zombie;
}

/**
* @return the level
*/
public String getLevel() {
return level;
}

/**
* @param level the level to set
*/
public void setLevel(String level) {
this.level = level;
}

/**
* @return the compileKind
*/
public String getCompileKind() {
return compileKind;
}

/**
* @param compileKind the compileKind to set
*/
public void setCompileKind(String compileKind) {
this.compileKind = compileKind;
}

public String toString() {
return "MakeNotEntrantEvent zombie:" + isZombie() + ", id:" + getId() + ", kind:" + getCompileKind();
}

}
@@ -76,12 +76,22 @@
"-Xbatch"
};

static final String setupArgsJFR[] = {
"java",
"-XX:+IgnoreUnrecognizedVMOptions",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+LogCompilation",
"-XX:LogFile=target/jfr.log",
"-XX:StartFlightRecording=dumponexit=true,filename=rwrecording.jfr"
};

static final String allSetupArgs[][] = {
setupArgsTieredVersion,
setupArgsTiered,
setupArgsTieredBatch,
setupArgsNoTiered,
setupArgsNoTieredBatch
setupArgsNoTieredBatch,
setupArgsJFR
};

@Parameters
@@ -92,7 +102,8 @@ public static Collection data() {
{"./target/tiered_short.log"},
{"./target/tiered_short_batch.log"},
{"./target/no_tiered_short.log"},
{"./target/no_tiered_short_batch.log"}
{"./target/no_tiered_short_batch.log"},
{"./target/jfr.log"},
};
assert data.length == allSetupArgs.length : "Files dont match args.";
return Arrays.asList(data);

1 comment on commit cf62b0a

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on cf62b0a Dec 9, 2020

Please sign in to comment.