Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2020-10-30 19:14:35 +0000
committerThomas Watson2020-10-30 19:16:46 +0000
commit5f935ae7f99c9cfac59a3f4af55bbd0da26a7238 (patch)
treea189039bfca4a29f1eab3dd9c964d409016179e5
parent157dd02e9aaee0631e8cfc0ee4a5e0e37968aaa4 (diff)
downloadrt.equinox.framework-5f935ae7f99c9cfac59a3f4af55bbd0da26a7238.tar.gz
rt.equinox.framework-5f935ae7f99c9cfac59a3f4af55bbd0da26a7238.tar.xz
rt.equinox.framework-5f935ae7f99c9cfac59a3f4af55bbd0da26a7238.zip
Bug 567964 - Add debug trace for open/close operations
Change-Id: Iaedc19d937a069e40cef242d40b4ac0b746848c0 Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rw-r--r--bundles/org.eclipse.osgi/.options4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/ConnectBundleFile.java5
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/Debug.java10
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/CloseableBundleFile.java6
4 files changed, 25 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi/.options b/bundles/org.eclipse.osgi/.options
index 8e606f05f..2ffeaa159 100644
--- a/bundles/org.eclipse.osgi/.options
+++ b/bundles/org.eclipse.osgi/.options
@@ -40,6 +40,10 @@ org.eclipse.osgi/debug/systemBundle=false
org.eclipse.osgi/debug/storage=false
# Debug the bundle file reading
org.eclipse.osgi/debug/bundleFile=false
+# Debug the bundle file open calls
+org.eclipse.osgi/debug/bundleFile/open=false
+# Debug the bundle file close calls
+org.eclipse.osgi/debug/bundleFile/close=false
# Eclipse adaptor options
org.eclipse.osgi/eclipseadaptor/debug = false
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/ConnectBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/ConnectBundleFile.java
index 25703120d..f71245cf3 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/ConnectBundleFile.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/connect/ConnectBundleFile.java
@@ -141,4 +141,9 @@ public class ConnectBundleFile extends CloseableBundleFile<ConnectEntry> {
Optional<ClassLoader> getClassLoader() {
return content.getClassLoader();
}
+
+ @Override
+ public String toString() {
+ return content.toString();
+ }
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/Debug.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/Debug.java
index 00bb8264c..daee0c140 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/Debug.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/Debug.java
@@ -109,6 +109,10 @@ public class Debug implements DebugOptionsListener {
public static final String OPTION_DEBUG_BUNDLE_FILE = ECLIPSE_OSGI + "/debug/bundleFile"; //$NON-NLS-1$
+ public static final String OPTION_DEBUG_BUNDLE_FILE_OPEN = ECLIPSE_OSGI + "/debug/bundleFile/open"; //$NON-NLS-1$
+
+ public static final String OPTION_DEBUG_BUNDLE_FILE_CLOSE = ECLIPSE_OSGI + "/debug/bundleFile/close"; //$NON-NLS-1$
+
/**
* General debug flag.
*/
@@ -180,6 +184,10 @@ public class Debug implements DebugOptionsListener {
public boolean DEBUG_BUNDLE_FILE = false; // debug/bundleFile
+ public boolean DEBUG_BUNDLE_FILE_OPEN = false; // debug/bundleFile/open
+
+ public boolean DEBUG_BUNDLE_FILE_CLOSE = false; // debug/bundleFile/close
+
public Debug(DebugOptions dbgOptions) {
optionsChanged(dbgOptions);
}
@@ -207,6 +215,8 @@ public class Debug implements DebugOptionsListener {
DEBUG_CACHED_MANIFEST = dbgOptions.getBooleanOption(OPTION_CACHED_MANIFEST, false);
DEBUG_SYSTEM_BUNDLE = dbgOptions.getBooleanOption(OPTION_DEBUG_SYSTEM_BUNDLE, false);
DEBUG_BUNDLE_FILE = dbgOptions.getBooleanOption(OPTION_DEBUG_BUNDLE_FILE, false);
+ DEBUG_BUNDLE_FILE_OPEN = dbgOptions.getBooleanOption(OPTION_DEBUG_BUNDLE_FILE_OPEN, false);
+ DEBUG_BUNDLE_FILE_CLOSE = dbgOptions.getBooleanOption(OPTION_DEBUG_BUNDLE_FILE_CLOSE, false);
}
/**
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/CloseableBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/CloseableBundleFile.java
index aeb4cc5ac..a425013f6 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/CloseableBundleFile.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/CloseableBundleFile.java
@@ -134,6 +134,9 @@ public abstract class CloseableBundleFile<E> extends BundleFile {
// This can throw an IO exception resulting in closed remaining true on exit
doOpen();
closed = false;
+ if (debug.DEBUG_BUNDLE_FILE_OPEN) {
+ Debug.println("OPENED bundle file - " + toString()); //$NON-NLS-1$
+ }
}
} else {
mruListUse();
@@ -356,6 +359,9 @@ public abstract class CloseableBundleFile<E> extends BundleFile {
doClose();
mruListRemove();
postClose();
+ if (debug.DEBUG_BUNDLE_FILE_CLOSE) {
+ Debug.println("CLOSED bundle file - " + toString()); //$NON-NLS-1$
+ }
}
} finally {
openLock.unlock();

Back to the top