mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 10:34:38 +02:00
8178347: Process and ProcessHandle getPid method name inconsistency
Reviewed-by: hseigel
This commit is contained in:
parent
35d89151e8
commit
6f92b33cc9
14 changed files with 26 additions and 26 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 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
|
||||||
|
@ -67,7 +67,7 @@ public class Testlibadimalloc {
|
||||||
|
|
||||||
// Start the process, get the pid and then wait for the test to finish
|
// Start the process, get the pid and then wait for the test to finish
|
||||||
Process process = builder.start();
|
Process process = builder.start();
|
||||||
long pid = process.getPid();
|
long pid = process.pid();
|
||||||
int retval = process.waitFor();
|
int retval = process.waitFor();
|
||||||
|
|
||||||
// make sure the SEGVOverflow test crashed
|
// make sure the SEGVOverflow test crashed
|
||||||
|
|
|
@ -80,7 +80,7 @@ public class AttachSetGetFlag {
|
||||||
try {
|
try {
|
||||||
waitForReady(target);
|
waitForReady(target);
|
||||||
|
|
||||||
int pid = (int)target.getPid();
|
int pid = (int)target.pid();
|
||||||
|
|
||||||
HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString());
|
HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString());
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ public class AttachSetGetFlag {
|
||||||
try {
|
try {
|
||||||
waitForReady(target);
|
waitForReady(target);
|
||||||
|
|
||||||
int pid = (int)target.getPid();
|
int pid = (int)target.pid();
|
||||||
|
|
||||||
HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString());
|
HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString());
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 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
|
||||||
|
@ -78,7 +78,7 @@ public class DaemonThreadTest {
|
||||||
thread.start();
|
thread.start();
|
||||||
|
|
||||||
// Run jstack tool and collect the output
|
// Run jstack tool and collect the output
|
||||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
|
JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
|
||||||
ToolResults results = jstackTool.measure();
|
ToolResults results = jstackTool.measure();
|
||||||
|
|
||||||
// Analyze the jstack output for the correct thread type
|
// Analyze the jstack output for the correct thread type
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 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
|
||||||
|
@ -96,7 +96,7 @@ public class SpreadLockTest {
|
||||||
debuggee.start();
|
debuggee.start();
|
||||||
|
|
||||||
// Collect output from the jstack tool
|
// Collect output from the jstack tool
|
||||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
|
JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
|
||||||
ToolResults results1 = jstackTool.measure();
|
ToolResults results1 = jstackTool.measure();
|
||||||
|
|
||||||
// Go to method b()
|
// Go to method b()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 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
|
||||||
|
@ -61,7 +61,7 @@ public class ThreadNamesTest {
|
||||||
thread.start();
|
thread.start();
|
||||||
|
|
||||||
// Run jstack tool and collect the output
|
// Run jstack tool and collect the output
|
||||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
|
JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
|
||||||
ToolResults results = jstackTool.measure();
|
ToolResults results = jstackTool.measure();
|
||||||
|
|
||||||
// Analyze the jstack output for the strange thread name
|
// Analyze the jstack output for the strange thread name
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 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
|
||||||
|
@ -95,7 +95,7 @@ public class TraveledLockTest {
|
||||||
debuggee.start();
|
debuggee.start();
|
||||||
|
|
||||||
// Collect output from the jstack tool
|
// Collect output from the jstack tool
|
||||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
|
JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
|
||||||
ToolResults results1 = jstackTool.measure();
|
ToolResults results1 = jstackTool.measure();
|
||||||
|
|
||||||
// Go to method b()
|
// Go to method b()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 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
|
||||||
|
@ -105,7 +105,7 @@ public class WaitNotifyThreadTest {
|
||||||
waitThread.start();
|
waitThread.start();
|
||||||
|
|
||||||
// Collect output from the jstack tool
|
// Collect output from the jstack tool
|
||||||
JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid());
|
JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid());
|
||||||
ToolResults results = jstackTool.measure();
|
ToolResults results = jstackTool.measure();
|
||||||
|
|
||||||
// Analyze the jstack output for the patterns needed
|
// Analyze the jstack output for the patterns needed
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 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
|
||||||
|
@ -38,7 +38,7 @@ public class GcCapacityTest {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
||||||
// We will be running "jstat -gc" tool
|
// We will be running "jstat -gc" tool
|
||||||
JstatGcCapacityTool jstatGcTool = new JstatGcCapacityTool(ProcessHandle.current().getPid());
|
JstatGcCapacityTool jstatGcTool = new JstatGcCapacityTool(ProcessHandle.current().pid());
|
||||||
|
|
||||||
// Run once and get the results asserting that they are reasonable
|
// Run once and get the results asserting that they are reasonable
|
||||||
JstatGcCapacityResults measurement1 = jstatGcTool.measure();
|
JstatGcCapacityResults measurement1 = jstatGcTool.measure();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 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
|
||||||
|
@ -41,7 +41,7 @@ public class GcCauseTest01 {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
||||||
// We will be running "jstat -gc" tool
|
// We will be running "jstat -gc" tool
|
||||||
JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid());
|
JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().pid());
|
||||||
|
|
||||||
// Run once and get the results asserting that they are reasonable
|
// Run once and get the results asserting that they are reasonable
|
||||||
JstatGcCauseResults measurement1 = jstatGcTool.measure();
|
JstatGcCauseResults measurement1 = jstatGcTool.measure();
|
||||||
|
|
|
@ -38,6 +38,6 @@ import utils.*;
|
||||||
public class GcCauseTest02 {
|
public class GcCauseTest02 {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
new GarbageProducerTest(new JstatGcCauseTool(ProcessHandle.current().getPid())).run();
|
new GarbageProducerTest(new JstatGcCauseTool(ProcessHandle.current().pid())).run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 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
|
||||||
|
@ -41,7 +41,7 @@ public class GcCauseTest03 {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
||||||
// We will be running "jstat -gc" tool
|
// We will be running "jstat -gc" tool
|
||||||
JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid());
|
JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().pid());
|
||||||
|
|
||||||
System.gc();
|
System.gc();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 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
|
||||||
|
@ -40,7 +40,7 @@ public class GcNewTest {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
||||||
// We will be running "jstat -gc" tool
|
// We will be running "jstat -gc" tool
|
||||||
JstatGcNewTool jstatGcTool = new JstatGcNewTool(ProcessHandle.current().getPid());
|
JstatGcNewTool jstatGcTool = new JstatGcNewTool(ProcessHandle.current().pid());
|
||||||
|
|
||||||
// Run once and get the results asserting that they are reasonable
|
// Run once and get the results asserting that they are reasonable
|
||||||
JstatGcNewResults measurement1 = jstatGcTool.measure();
|
JstatGcNewResults measurement1 = jstatGcTool.measure();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 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
|
||||||
|
@ -44,7 +44,7 @@ public class GcTest01 {
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
||||||
// We will be running "jstat -gc" tool
|
// We will be running "jstat -gc" tool
|
||||||
JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().getPid());
|
JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().pid());
|
||||||
|
|
||||||
// Run once and get the results asserting that they are reasonable
|
// Run once and get the results asserting that they are reasonable
|
||||||
JstatGcResults measurement1 = jstatGcTool.measure();
|
JstatGcResults measurement1 = jstatGcTool.measure();
|
||||||
|
|
|
@ -38,6 +38,6 @@ import utils.*;
|
||||||
public class GcTest02 {
|
public class GcTest02 {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
new GarbageProducerTest(new JstatGcTool(ProcessHandle.current().getPid())).run();
|
new GarbageProducerTest(new JstatGcTool(ProcessHandle.current().pid())).run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue