mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8374544: Add SleepyCat diagnostics for all platforms
Reviewed-by: jpai
This commit is contained in:
parent
fbc59ac0a1
commit
f1e0e0c25e
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, 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
|
||||
@ -66,26 +66,19 @@ public class SleepyCat {
|
||||
* @param pids the processes to dump status for
|
||||
*/
|
||||
static void dumpState(Process... pids) {
|
||||
if (!System.getProperty("os.name").contains("SunOS")) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String[] psArgs = {"ps", "-elf"};
|
||||
Process ps = new ProcessBuilder(psArgs).inheritIO().start();
|
||||
ps.waitFor();
|
||||
String[] sfiles = {"pfiles", "self"};
|
||||
Process fds = new ProcessBuilder(sfiles).inheritIO().start();
|
||||
fds.waitFor();
|
||||
try (Process ps = new ProcessBuilder(psArgs).inheritIO().start()) {
|
||||
ps.waitFor();
|
||||
}
|
||||
|
||||
for (Process p : pids) {
|
||||
if (p == null)
|
||||
continue;
|
||||
String[] pfiles = {"pfiles", Long.toString(p.pid())};
|
||||
fds = new ProcessBuilder(pfiles).inheritIO().start();
|
||||
fds.waitFor();
|
||||
String[] pstack = {"pstack", Long.toString(p.pid())};
|
||||
fds = new ProcessBuilder(pstack).inheritIO().start();
|
||||
fds.waitFor();
|
||||
String[] pfiles = {"lsof", "-p", Long.toString(p.pid())};
|
||||
try (Process fds = new ProcessBuilder(pfiles).inheritIO().start()) {
|
||||
fds.waitFor();
|
||||
}
|
||||
}
|
||||
} catch (IOException | InterruptedException i) {
|
||||
i.printStackTrace();
|
||||
|
||||
1
test/jdk/java/lang/RuntimeTests/exec/TEST.properties
Normal file
1
test/jdk/java/lang/RuntimeTests/exec/TEST.properties
Normal file
@ -0,0 +1 @@
|
||||
maxOutputSize=6000000
|
||||
Loading…
x
Reference in New Issue
Block a user