mirror of
https://gitee.com/arthas/arthas.git
synced 2024-11-30 03:07:37 +08:00
ignore jps when select java process. #278
This commit is contained in:
parent
1a42377a98
commit
fa4bf599ab
@ -104,10 +104,18 @@ public class ProcessUtils {
|
||||
|
||||
int currentPid = Integer.parseInt(ProcessUtils.getPid());
|
||||
for (String line : lines) {
|
||||
int pid = new Scanner(line).nextInt();
|
||||
String[] strings = line.trim().split("\\s+");
|
||||
if (strings.length < 1) {
|
||||
continue;
|
||||
}
|
||||
int pid = Integer.parseInt(strings[0]);
|
||||
if (pid == currentPid) {
|
||||
continue;
|
||||
}
|
||||
if (strings.length >= 2 && strings[1].equals("Jps")) { // skip jps
|
||||
continue;
|
||||
}
|
||||
|
||||
result.put(pid, line);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user