From d570fa74d4fd22459aa1579749a7705949a2a748 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 18 Mar 2012 16:33:07 +0100 Subject: Reduce Thread.dumpStack() in debug mode where no negative behavior appears or a stack trace may be helpful. --- src/jogl/classes/javax/media/opengl/GLProfile.java | 1 - src/jogl/classes/javax/media/opengl/awt/GLJPanel.java | 2 +- src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java | 1 - .../classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java | 2 +- .../opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java | 3 ++- src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java | 2 -- .../jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java | 5 +++-- .../classes/javax/media/nativewindow/NativeWindowFactory.java | 2 +- .../jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java | 1 - src/newt/classes/jogamp/newt/WindowImpl.java | 1 - src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java | 1 - 11 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 4d4b0d82c..0bd805831 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -1505,7 +1505,6 @@ public class GLProfile { if(DEBUG) { System.err.println("Info: GLProfile.initProfilesForDevice: "+device+", isSet "+isSet); - Thread.dumpStack(); } if(isSet) { // Avoid recursion and check whether impl. is sane! diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index b30525c95..5291e48e4 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -270,7 +270,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing protected void dispose() { if(DEBUG) { System.err.println("Info: dispose() - start - "+Thread.currentThread().getName()); - Thread.dumpStack(); + // Thread.dumpStack(); } if (backend != null && backend.getContext() != null) { diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java index a6ef9bd1c..ebe202f31 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java @@ -185,7 +185,6 @@ public class WindowsWGLContext extends GLContextImpl { System.err.println(getThreadName()+" - WindowWGLContext.createContextARBImpl: "+getGLVersion(major, minor, ctp, "@creation") + ", handle "+toHexString(drawable.getHandle()) + ", share "+toHexString(share)+", direct "+direct+ ", wglCreateContextAttribsARB: "+toHexString(wglExtProcAddressTable._addressof_wglCreateContextAttribsARB)); - Thread.dumpStack(); } boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ; diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java index 51566d48d..f4069d430 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java @@ -165,7 +165,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { if ( GDI.GetProcessAffinityMask(pid, procMask, sysMask) ) { if(DEBUG) { System.err.println("WindowsWGLDrawableFactory.enterThreadCriticalZone() - 0x" + Long.toHexString(pid) + " - " + Thread.currentThread().getName()); - Thread.dumpStack(); + // Thread.dumpStack(); } processAffinityChanges = pid; GDI.SetProcessAffinityMask(pid, 1); diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java index 4681a6ef7..2c8c03185 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java @@ -210,7 +210,6 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat } if (DEBUG) { System.err.println("setPixelFormat (post): hdc "+toHexString(hdc) +", "+pfdID+" -> "+config.getPixelFormatID()+", set: "+set); - Thread.dumpStack(); } } } @@ -364,6 +363,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat } if (null == pformats) { if (DEBUG) { + System.err.println("updateGraphicsConfigurationARB: failed, return false"); Thread.dumpStack(); } return false; @@ -476,6 +476,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex); if ( 0 > chosenIndex ) { if (DEBUG) { + System.err.println("updateGraphicsConfigurationGDI: failed, return false"); Thread.dumpStack(); } return false; diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java index 1dc1441e1..12bb2a9a6 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java @@ -193,7 +193,6 @@ public abstract class X11GLXContext extends GLContextImpl { System.err.println("X11GLXContext.createContextARBImpl: "+getGLVersion(major, minor, ctp, "@creation") + ", handle "+toHexString(drawable.getHandle()) + ", share "+toHexString(share)+", direct "+direct+ ", glXCreateContextAttribsARB: "+toHexString(glXExtProcAddressTable._addressof_glXCreateContextAttribsARB)); - Thread.dumpStack(); } boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ; @@ -459,7 +458,6 @@ public abstract class X11GLXContext extends GLContextImpl { mappedGLXProcAddress.put(key, getGLXExtProcAddressTable()); if(DEBUG) { System.err.println(getThreadName() + ": GLContext GLX ProcAddressTable mapping key("+key+") -> "+toHexString(getGLXExtProcAddressTable().hashCode())); - Thread.dumpStack(); } } } diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java index 22347ea5c..0ec2f234c 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java @@ -227,7 +227,6 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF } if(DEBUG) { System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationStatic("+x11Screen+","+capsChosen+"): "+res); - Thread.dumpStack(); } return res; } @@ -320,6 +319,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex); if ( 0 > chosenIndex ) { if (DEBUG) { + System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationFBConfig: failed, return null"); Thread.dumpStack(); } return null; @@ -373,7 +373,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF for (int i = 0; i < infos.length; i++) { if( !X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(availableCaps, glProfile, display, infos[i], winattrmask, isMultisampleAvailable) ) { if(DEBUG) { - System.err.println("X11GLXGraphicsConfiguration.getAvailableGLCapabilitiesXVisual: XVisual invalid: ("+x11Screen+"): fbcfg: "+toHexString(infos[i].getVisualid())); + System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationXVisual: XVisual invalid: ("+x11Screen+"): fbcfg: "+toHexString(infos[i].getVisualid())); } } else { // Attempt to find the visual chosenIndex by glXChooseVisual, if not translucent @@ -386,6 +386,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex); if ( 0 > chosenIndex ) { if (DEBUG) { + System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationXVisual: failed, return null"); Thread.dumpStack(); } return null; diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java index 16a4ecfe5..ca84901cb 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java +++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java @@ -451,7 +451,7 @@ public abstract class NativeWindowFactory { try { if(DEBUG) { System.err.println("NativeWindowFactory.createX11AWTToolkitLock(0x"+Long.toHexString(deviceHandle)+")"); - Thread.dumpStack(); + // Thread.dumpStack(); } return (ToolkitLock) x11JAWTToolkitLockConstructor.newInstance(new Object[]{new Long(deviceHandle)}); } catch (Exception ex) { diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java index d798e975c..070f87216 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java +++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java @@ -61,7 +61,6 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor AbstractGraphicsConfiguration res = new X11GraphicsConfiguration((X11GraphicsScreen)screen, x11CapsChosen, capsRequested, x11CapsChosen.getXVisualInfo()); if(DEBUG) { System.err.println("X11GraphicsConfigurationFactory.chooseGraphicsConfigurationImpl("+screen+","+capsChosen+"): "+res); - Thread.dumpStack(); } return res; } diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index c73f72cfd..6a0449e30 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -783,7 +783,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer public void setVisible(boolean visible) { if(DEBUG_IMPLEMENTATION) { System.err.println("Window setVisible: START ("+getThreadName()+") "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible: "+this.visible+" -> "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+(null!=parentWindow)); - Thread.dumpStack(); } runOnEDTIfAvail(true, new VisibleAction(visible)); } diff --git a/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java b/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java index 26aa1a806..e747b9ea7 100644 --- a/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java +++ b/src/newt/classes/jogamp/newt/driver/android/AndroidWindow.java @@ -302,7 +302,6 @@ public class AndroidWindow extends jogamp.newt.WindowImpl implements Callback2 { protected void createNativeImpl() { Log.d(MD.TAG, "createNativeImpl 0 - surfaceHandle 0x"+Long.toHexString(surfaceHandle)+ ", format "+format+", "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+" - "+Thread.currentThread().getName()); - Thread.dumpStack(); if(0!=getParentWindowHandle()) { throw new NativeWindowException("Window parenting not supported (yet)"); } -- cgit v1.2.3