6760477: Update SA to include stack traces in the heap dump
Update SA to include HPROF_TRACE and HPROF_FRAME records in the heap dump Reviewed-by: dsamersoff
This commit is contained in:
parent
0c7b96199f
commit
c40c538ac6
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -42,6 +42,7 @@ import jdk.testlibrary.OutputAnalyzer;
|
|||||||
import jdk.testlibrary.ProcessTools;
|
import jdk.testlibrary.ProcessTools;
|
||||||
import jdk.test.lib.apps.LingeredApp;
|
import jdk.test.lib.apps.LingeredApp;
|
||||||
import jdk.test.lib.Platform;
|
import jdk.test.lib.Platform;
|
||||||
|
import jdk.test.lib.hprof.parser.HprofReader;
|
||||||
|
|
||||||
public class HeapDumpTest {
|
public class HeapDumpTest {
|
||||||
|
|
||||||
@ -93,6 +94,17 @@ public class HeapDumpTest {
|
|||||||
launch(expectedMessage, Arrays.asList(toolArgs));
|
launch(expectedMessage, Arrays.asList(toolArgs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void printStackTraces(String file) throws IOException {
|
||||||
|
try {
|
||||||
|
String output = HprofReader.getStack(file, 0);
|
||||||
|
if (!output.contains("LingeredAppWithExtendedChars.main")) {
|
||||||
|
throw new RuntimeException("'LingeredAppWithExtendedChars.main' missing from stdout/stderr");
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
throw new RuntimeException("Test ERROR " + ex, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void testHeapDump() throws IOException {
|
public static void testHeapDump() throws IOException {
|
||||||
File dump = new File("jhsdb.jmap.heap." +
|
File dump = new File("jhsdb.jmap.heap." +
|
||||||
System.currentTimeMillis() + ".hprof");
|
System.currentTimeMillis() + ".hprof");
|
||||||
@ -106,6 +118,8 @@ public class HeapDumpTest {
|
|||||||
assertTrue(dump.exists() && dump.isFile(),
|
assertTrue(dump.exists() && dump.isFile(),
|
||||||
"Could not create dump file " + dump.getAbsolutePath());
|
"Could not create dump file " + dump.getAbsolutePath());
|
||||||
|
|
||||||
|
printStackTraces(dump.getAbsolutePath());
|
||||||
|
|
||||||
dump.delete();
|
dump.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user