From 0a17a8d29bcefbc7f6dde2038fe56f494c0bfa98 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 25 Jun 2012 15:58:21 +0100 Subject: Don't log all fbConfigs and GL/WGL extensions Don't log all fbConfigs and GL/WGL extensions, unless verbose logging is requested Log the number of pixelFormats which gave rise to the fbConfigs Signed-off-by: Jon TURNEY --- hw/xwin/glx/indirect.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 0873c5e4a..c6d6cb90d 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -86,6 +86,7 @@ #include #include +#include #define NUM_ELEMENTS(x) (sizeof(x)/ sizeof(x[1])) @@ -345,6 +346,11 @@ swap_method_name(int mthd) static void fbConfigsDump(unsigned int n, __GLXconfig *c) { + LogMessage(X_INFO, "%d fbConfigs\n", n); + + if (g_iLogVerbose < 3) + return; + ErrorF("%d fbConfigs\n", n); ErrorF("pxf vis fb render Ste aux accum MS drawable Group/\n"); ErrorF("idx ID ID VisualType Depth Lvl RGB CI DB Swap reo R G B A Z S buf AR AG AB AA bufs num W P Pb Float Trans Caveat\n"); @@ -588,10 +594,14 @@ glxWinScreenProbe(ScreenPtr pScreen) gl_renderer = (const char *)glGetStringWrapperNonstatic(GL_RENDERER); ErrorF("GL_RENDERER: %s\n", gl_renderer); gl_extensions = (const char *)glGetStringWrapperNonstatic(GL_EXTENSIONS); - glxLogExtensions("GL_EXTENSIONS: ", gl_extensions); wgl_extensions = wglGetExtensionsStringARBWrapper(hdc); if (!wgl_extensions) wgl_extensions = ""; - glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions); + + if (g_iLogVerbose >= 3) + { + glxLogExtensions("GL_EXTENSIONS: ", gl_extensions); + glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions); + } if (strcasecmp(gl_renderer, "GDI Generic") == 0) { @@ -1794,7 +1804,7 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen *screen) // get the number of pixelformats numConfigs = DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR), NULL); - GLWIN_DEBUG_MSG("DescribePixelFormat says %d possible pixel formats", numConfigs); + LogMessage(X_INFO, "%d pixel formats reported by DescribePixelFormat\n", numConfigs); /* alloc */ result = malloc(sizeof(GLXWinConfig) * numConfigs); @@ -2037,7 +2047,7 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen *screen) return; } - GLWIN_DEBUG_MSG("wglGetPixelFormatAttribivARB says %d possible pixel formats", numConfigs); + LogMessage(X_INFO, "%d pixel formats reported by wglGetPixelFormatAttribivARB\n", numConfigs); /* alloc */ result = malloc(sizeof(GLXWinConfig) * numConfigs); -- cgit v1.2.3 From c80a722f39c485e70103cefdba101e89c749728b Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 5 Apr 2010 14:22:39 +0100 Subject: hw/xwin: Remove an extra '\n' from some log messages Remove an extra '\n' from internal client IOError log messages Signed-off-by: Jon TURNEY --- hw/xwin/winclipboardthread.c | 2 +- hw/xwin/winmultiwindowwm.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c index 416397cbf..5e6725ce6 100644 --- a/hw/xwin/winclipboardthread.c +++ b/hw/xwin/winclipboardthread.c @@ -515,7 +515,7 @@ winClipboardErrorHandler (Display *pDisplay, XErrorEvent *pErr) static int winClipboardIOErrorHandler (Display *pDisplay) { - ErrorF ("winClipboardIOErrorHandler!\n\n"); + ErrorF ("winClipboardIOErrorHandler!\n"); if (pthread_equal(pthread_self(),g_winClipboardProcThread)) { diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 4c22b2cd5..b85b0300f 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -1614,7 +1614,7 @@ winMultiWindowWMErrorHandler (Display *pDisplay, XErrorEvent *pErr) static int winMultiWindowWMIOErrorHandler (Display *pDisplay) { - ErrorF ("winMultiWindowWMIOErrorHandler!\n\n"); + ErrorF ("winMultiWindowWMIOErrorHandler!\n"); if (pthread_equal(pthread_self(),g_winMultiWindowWMThread)) { @@ -1660,7 +1660,7 @@ winMultiWindowXMsgProcErrorHandler (Display *pDisplay, XErrorEvent *pErr) static int winMultiWindowXMsgProcIOErrorHandler (Display *pDisplay) { - ErrorF ("winMultiWindowXMsgProcIOErrorHandler!\n\n"); + ErrorF ("winMultiWindowXMsgProcIOErrorHandler!\n"); if (pthread_equal(pthread_self(),g_winMultiWindowXMsgProcThread)) { -- cgit v1.2.3 From 42f573005cc4a0a489cd5771f5a2178cc33478b3 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 28 Jun 2012 13:28:50 +0100 Subject: Add -notrapsignals Add -notrapsignals to disable catching of fatal signals (to either continue or log) and just use the default signal processing instead Log the thread id where the signal is delivered Various cosmetic fixes to fatal error logging Signed-off-by: Jon TURNEY --- os/log.c | 7 ++++--- os/osinit.c | 45 ++++++++++++++++++++++++++------------------- os/utils.c | 7 +++++++ 3 files changed, 37 insertions(+), 22 deletions(-) diff --git a/os/log.c b/os/log.c index 8c102bbb1..213ec0444 100644 --- a/os/log.c +++ b/os/log.c @@ -590,9 +590,9 @@ FatalError(const char *f, ...) static Bool beenhere = FALSE; if (beenhere) - ErrorF("\nFatalError re-entered, aborting\n"); + ErrorF("FatalError re-entered, aborting\n"); else - ErrorF("\nFatal server error:\n"); + ErrorF("Fatal server error: "); va_start(args, f); #ifdef __APPLE__ @@ -605,7 +605,8 @@ FatalError(const char *f, ...) #endif VErrorF(f, args); va_end(args); - ErrorF("\n"); + if (f[strlen(f)-1] != '\n') + ErrorF("\n"); if (!beenhere) OsVendorFatalError(); if (!beenhere) { diff --git a/os/osinit.c b/os/osinit.c index 49c4d297d..277774db5 100644 --- a/os/osinit.c +++ b/os/osinit.c @@ -82,6 +82,7 @@ int limitStackSpace = -1; #ifdef RLIMIT_NOFILE int limitNoFile = -1; #endif +extern Bool install_os_signal_handler; static OsSigWrapperPtr OsSigWrapper = NULL; @@ -121,8 +122,7 @@ OsSigHandler(int signo) } } - /* log, cleanup, and abort */ - xorg_backtrace(); + ErrorF("Fatal signal received in thread 0x%x\n", pthread_self()); #ifdef SA_SIGINFO if (sip->si_code == SI_USER) { @@ -139,6 +139,9 @@ OsSigHandler(int signo) } #endif + /* log, cleanup, and abort */ + xorg_backtrace(); + FatalError("Caught signal %d (%s). Server aborting\n", signo, strsignal(signo)); } @@ -151,30 +154,34 @@ OsInit(void) char fname[PATH_MAX]; if (!been_here) { - struct sigaction act, oact; - int i; - int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS, - SIGSYS, - SIGXCPU, - SIGXFSZ, + if (install_os_signal_handler) + { + struct sigaction act, oact; + int i; + int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS, + SIGSYS, + SIGXCPU, + SIGXFSZ, #ifdef SIGEMT - SIGEMT, + SIGEMT, #endif - 0 /* must be last */ }; - sigemptyset(&act.sa_mask); + 0 /* must be last */ }; + sigemptyset(&act.sa_mask); #ifdef SA_SIGINFO - act.sa_sigaction = OsSigHandler; - act.sa_flags = SA_SIGINFO; + act.sa_sigaction = OsSigHandler; + act.sa_flags = SA_SIGINFO; #else - act.sa_handler = OsSigHandler; - act.sa_flags = 0; + act.sa_handler = OsSigHandler; + act.sa_flags = 0; #endif - for (i = 0; siglist[i] != 0; i++) { + for (i = 0; siglist[i] != 0; i++) { if (sigaction(siglist[i], &act, &oact)) { - ErrorF("failed to install signal handler for signal %d: %s\n", - siglist[i], strerror(errno)); + ErrorF("failed to install signal handler for signal %d: %s\n", + siglist[i], strerror(errno)); } - } + } + } + #ifdef HAVE_BACKTRACE /* * initialize the backtracer, since the ctor calls dlopen(), which diff --git a/os/utils.c b/os/utils.c index 09f5ae7fd..96b13f4f1 100644 --- a/os/utils.c +++ b/os/utils.c @@ -122,6 +122,8 @@ __stdcall unsigned long GetTickCount(void); #include "picture.h" +Bool install_os_signal_handler = TRUE; + Bool noTestExtensions; #ifdef COMPOSITE Bool noCompositeExtension = FALSE; @@ -498,6 +500,7 @@ void UseMsg(void) #ifdef RLIMIT_STACK ErrorF("-ls int limit stack space to N Kb\n"); #endif + ErrorF("-notrapsignals disable catching of fatal signals\n"); ErrorF("-nolock disable the locking mechanism\n"); ErrorF("-nolisten string don't listen on protocol\n"); ErrorF("-noreset don't reset after last client exists\n"); @@ -758,6 +761,10 @@ ProcessCommandLine(int argc, char *argv[]) UseMsg(); } #endif + else if ( strcmp ( argv[i], "-notrapsignals") == 0) + { + install_os_signal_handler = FALSE; + } else if ( strcmp ( argv[i], "-nolock") == 0) { #if !defined(WIN32) && !defined(__CYGWIN__) -- cgit v1.2.3