Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rennie2011-11-15 20:02:29 +0000
committerMike Rennie2011-11-15 20:02:29 +0000
commitaaddd477d5f5357e626b82ab76c1faaf5d3e49e3 (patch)
tree2de0896c9118092061c364a144a29d0d75f58249
parent84deb25389e5039cbcb92de04609c19f7af4fd2c (diff)
downloadeclipse.jdt.debug-aaddd477d5f5357e626b82ab76c1faaf5d3e49e3.tar.gz
eclipse.jdt.debug-aaddd477d5f5357e626b82ab76c1faaf5d3e49e3.tar.xz
eclipse.jdt.debug-aaddd477d5f5357e626b82ab76c1faaf5d3e49e3.zip
Bug 345298 - [breakpoints] BreakpointManager deadlocks trying to restorev20111219-0907v20111115-2002
breakpoints - increased test iteration count and add 200 breakpoint test
-rw-r--r--org.eclipse.jdt.debug.tests/.cvsignore1
-rw-r--r--org.eclipse.jdt.debug.tests/testprograms/BPManagerPerf.java214
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/PerformanceSuite.java4
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/BreakpointManagerPerfTests.java165
4 files changed, 382 insertions, 2 deletions
diff --git a/org.eclipse.jdt.debug.tests/.cvsignore b/org.eclipse.jdt.debug.tests/.cvsignore
deleted file mode 100644
index c5e82d745..000000000
--- a/org.eclipse.jdt.debug.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/org.eclipse.jdt.debug.tests/testprograms/BPManagerPerf.java b/org.eclipse.jdt.debug.tests/testprograms/BPManagerPerf.java
new file mode 100644
index 000000000..7dce0719e
--- /dev/null
+++ b/org.eclipse.jdt.debug.tests/testprograms/BPManagerPerf.java
@@ -0,0 +1,214 @@
+/*******************************************************************************
+ * Copyright (c) 2011 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+public class BPManagerPerf {
+ public static void main(String[] args) {
+ System.out.println("0");
+ System.out.println("1");
+ System.out.println("2");
+ System.out.println("3");
+ System.out.println("4");
+ System.out.println("5");
+ System.out.println("6");
+ System.out.println("7");
+ System.out.println("8");
+ System.out.println("9");
+ System.out.println("10");
+ System.out.println("11");
+ System.out.println("12");
+ System.out.println("13");
+ System.out.println("14");
+ System.out.println("15");
+ System.out.println("16");
+ System.out.println("17");
+ System.out.println("18");
+ System.out.println("19");
+ System.out.println("20");
+ System.out.println("21");
+ System.out.println("22");
+ System.out.println("23");
+ System.out.println("24");
+ System.out.println("25");
+ System.out.println("26");
+ System.out.println("27");
+ System.out.println("28");
+ System.out.println("29");
+ System.out.println("30");
+ System.out.println("31");
+ System.out.println("32");
+ System.out.println("33");
+ System.out.println("34");
+ System.out.println("35");
+ System.out.println("36");
+ System.out.println("37");
+ System.out.println("38");
+ System.out.println("39");
+ System.out.println("40");
+ System.out.println("41");
+ System.out.println("42");
+ System.out.println("43");
+ System.out.println("44");
+ System.out.println("45");
+ System.out.println("46");
+ System.out.println("47");
+ System.out.println("48");
+ System.out.println("49");
+ System.out.println("50");
+ System.out.println("51");
+ System.out.println("52");
+ System.out.println("53");
+ System.out.println("54");
+ System.out.println("55");
+ System.out.println("56");
+ System.out.println("57");
+ System.out.println("58");
+ System.out.println("59");
+ System.out.println("60");
+ System.out.println("61");
+ System.out.println("62");
+ System.out.println("63");
+ System.out.println("64");
+ System.out.println("65");
+ System.out.println("66");
+ System.out.println("67");
+ System.out.println("68");
+ System.out.println("69");
+ System.out.println("70");
+ System.out.println("71");
+ System.out.println("72");
+ System.out.println("73");
+ System.out.println("74");
+ System.out.println("75");
+ System.out.println("76");
+ System.out.println("77");
+ System.out.println("78");
+ System.out.println("79");
+ System.out.println("80");
+ System.out.println("81");
+ System.out.println("82");
+ System.out.println("83");
+ System.out.println("84");
+ System.out.println("85");
+ System.out.println("86");
+ System.out.println("87");
+ System.out.println("88");
+ System.out.println("89");
+ System.out.println("90");
+ System.out.println("91");
+ System.out.println("92");
+ System.out.println("93");
+ System.out.println("94");
+ System.out.println("95");
+ System.out.println("96");
+ System.out.println("97");
+ System.out.println("98");
+ System.out.println("99");
+ System.out.println("0");
+ System.out.println("1");
+ System.out.println("2");
+ System.out.println("3");
+ System.out.println("4");
+ System.out.println("5");
+ System.out.println("6");
+ System.out.println("7");
+ System.out.println("8");
+ System.out.println("9");
+ System.out.println("10");
+ System.out.println("11");
+ System.out.println("12");
+ System.out.println("13");
+ System.out.println("14");
+ System.out.println("15");
+ System.out.println("16");
+ System.out.println("17");
+ System.out.println("18");
+ System.out.println("19");
+ System.out.println("20");
+ System.out.println("21");
+ System.out.println("22");
+ System.out.println("23");
+ System.out.println("24");
+ System.out.println("25");
+ System.out.println("26");
+ System.out.println("27");
+ System.out.println("28");
+ System.out.println("29");
+ System.out.println("30");
+ System.out.println("31");
+ System.out.println("32");
+ System.out.println("33");
+ System.out.println("34");
+ System.out.println("35");
+ System.out.println("36");
+ System.out.println("37");
+ System.out.println("38");
+ System.out.println("39");
+ System.out.println("40");
+ System.out.println("41");
+ System.out.println("42");
+ System.out.println("43");
+ System.out.println("44");
+ System.out.println("45");
+ System.out.println("46");
+ System.out.println("47");
+ System.out.println("48");
+ System.out.println("49");
+ System.out.println("50");
+ System.out.println("51");
+ System.out.println("52");
+ System.out.println("53");
+ System.out.println("54");
+ System.out.println("55");
+ System.out.println("56");
+ System.out.println("57");
+ System.out.println("58");
+ System.out.println("59");
+ System.out.println("60");
+ System.out.println("61");
+ System.out.println("62");
+ System.out.println("63");
+ System.out.println("64");
+ System.out.println("65");
+ System.out.println("66");
+ System.out.println("67");
+ System.out.println("68");
+ System.out.println("69");
+ System.out.println("70");
+ System.out.println("71");
+ System.out.println("72");
+ System.out.println("73");
+ System.out.println("74");
+ System.out.println("75");
+ System.out.println("76");
+ System.out.println("77");
+ System.out.println("78");
+ System.out.println("79");
+ System.out.println("80");
+ System.out.println("81");
+ System.out.println("82");
+ System.out.println("83");
+ System.out.println("84");
+ System.out.println("85");
+ System.out.println("86");
+ System.out.println("87");
+ System.out.println("88");
+ System.out.println("89");
+ System.out.println("90");
+ System.out.println("91");
+ System.out.println("92");
+ System.out.println("93");
+ System.out.println("94");
+ System.out.println("95");
+ System.out.println("96");
+ System.out.println("97");
+ System.out.println("98");
+ System.out.println("99");
+ }
+}
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/PerformanceSuite.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/PerformanceSuite.java
index bff1d3ada..91c4ddd4e 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/PerformanceSuite.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/PerformanceSuite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@ package org.eclipse.jdt.debug.tests;
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.eclipse.jdt.debug.tests.performance.BreakpointManagerPerfTests;
import org.eclipse.jdt.debug.tests.performance.PerfBreakpointTests;
import org.eclipse.jdt.debug.tests.performance.PerfConditionalBreakpointsTests;
import org.eclipse.jdt.debug.tests.performance.PerfConsoleTests;
@@ -45,5 +46,6 @@ public class PerformanceSuite extends DebugSuite {
addTest(new TestSuite(PerfSteppingTests.class));
addTest(new TestSuite(PerfConsoleTests.class));
addTest(new TestSuite(PerfVariableDetailTests.class));
+ addTest(new TestSuite(BreakpointManagerPerfTests.class));
}
}
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/BreakpointManagerPerfTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/BreakpointManagerPerfTests.java
new file mode 100644
index 000000000..c2794387a
--- /dev/null
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/performance/BreakpointManagerPerfTests.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2011 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.debug.tests.performance;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.internal.core.BreakpointManager;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.Signature;
+import org.eclipse.jdt.debug.tests.AbstractDebugPerformanceTest;
+import org.eclipse.test.performance.Dimension;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * Tests the performance of various parts of the {@link BreakpointManager}
+ *
+ * @since 3.8
+ */
+public class BreakpointManagerPerfTests extends AbstractDebugPerformanceTest {
+
+ /**
+ * Constructor
+ * @param name
+ */
+ public BreakpointManagerPerfTests() {
+ super("Breakpoint Manager Performance");
+ }
+
+ static IBreakpoint[] NO_BREAKPOINTS = new IBreakpoint[0];
+ static String fgTypeName = "BPManagerPerf";
+
+ /**
+ * Create the given number of breakpoints in the given resource starting from the given line
+ *
+ * @param count
+ * @throws Exception
+ * @return the collection of breakpoints
+ */
+ IBreakpoint[] generateBreakpoints(int count) throws Exception {
+ IType type = getType(fgTypeName);
+ assertNotNull("the type "+fgTypeName+" should exist", type);
+ assertTrue("The type "+fgTypeName+" must be a file", type.getResource().getType() == IResource.FILE);
+ IEditorPart editor = openEditor((IFile)type.getResource());
+ assertNotNull("the editor for "+fgTypeName+" should have been created", editor);
+ ArrayList bps = new ArrayList(count);
+ IBreakpoint bp = createClassPrepareBreakpoint(type);
+ if(bp != null) {
+ bps.add(bp);
+ }
+ bp = createMethodBreakpoint(fgTypeName, "main", Signature.createMethodSignature(new String[] {"[Ljava.lang.String;"}, Signature.SIG_VOID), true, true);
+ if(bp != null) {
+ bps.add(bp);
+ }
+ int end = 9+count;
+ for(int i = 11; i < end; i++) {
+ bp = createLineBreakpoint(i, fgTypeName);
+ if(bp != null) {
+ bps.add(bp);
+ }
+ }
+ assertEquals("the should have been "+count+" breakpoints created", count, bps.size());
+ return (IBreakpoint[]) bps.toArray(new IBreakpoint[bps.size()]);
+ }
+
+ /**
+ * Tests the time required to start the {@link BreakpointManager}
+ * @throws Exception
+ */
+ public void testStartup200Breakpoints() throws Exception {
+ tagAsSummary("Start Breakpoint Manager - 200 BPs", Dimension.ELAPSED_PROCESS);
+ try {
+ IBreakpoint[] bps = generateBreakpoints(200);
+ assertTrue("There should be 200 breakpoints", bps.length == 200);
+ BreakpointManager mgr = (BreakpointManager) getBreakpointManager();
+ //clean it up before starting
+ mgr.shutdown();
+ for(int i = 0; i < 6500; i++) {
+ try {
+ startMeasuring();
+ mgr.start();
+ stopMeasuring();
+ }
+ finally {
+ mgr.shutdown();
+ }
+ }
+ commitMeasurements();
+ assertPerformance();
+ }
+ finally {
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * Tests the time required to start the {@link BreakpointManager}
+ * @throws Exception
+ */
+ public void testStartup50Breakpoints() throws Exception {
+ tagAsSummary("Start Breakpoint Manager - 50 BPs", Dimension.ELAPSED_PROCESS);
+ try {
+ IBreakpoint[] bps = generateBreakpoints(50);
+ assertTrue("There should be 50 breakpoints", bps.length == 50);
+ BreakpointManager mgr = (BreakpointManager) getBreakpointManager();
+ //clean it up before starting
+ mgr.shutdown();
+ for(int i = 0; i < 6500; i++) {
+ try {
+ startMeasuring();
+ mgr.start();
+ stopMeasuring();
+ }
+ finally {
+ mgr.shutdown();
+ }
+ }
+ commitMeasurements();
+ assertPerformance();
+ }
+ finally {
+ removeAllBreakpoints();
+ }
+ }
+
+ /**
+ * Tests the time required to start the {@link BreakpointManager}
+ * @throws Exception
+ */
+ public void testStartup100Breakpoints() throws Exception {
+ tagAsSummary("Start Breakpoint Manager - 100 BPs", Dimension.ELAPSED_PROCESS);
+ try {
+ IBreakpoint[] bps = generateBreakpoints(100);
+ assertTrue("There should be 100 breakpoints", bps.length == 100);
+ BreakpointManager mgr = (BreakpointManager) getBreakpointManager();
+ //clean it up before starting
+ mgr.shutdown();
+ for(int i = 0; i < 6500; i++) {
+ try {
+ startMeasuring();
+ mgr.start();
+ stopMeasuring();
+ }
+ finally {
+ mgr.shutdown();
+ }
+ }
+ commitMeasurements();
+ assertPerformance();
+ }
+ finally {
+ removeAllBreakpoints();
+ }
+ }
+}

Back to the top