[PATCH v2 10/14] Log mieq enqueue overflow in a signal safe manner

Chase Douglas chase.douglas at canonical.com
Mon Apr 9 11:17:36 PDT 2012


Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
 mi/mieq.c |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/mi/mieq.c b/mi/mieq.c
index e117a8d..097ccf5 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -276,24 +276,32 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e)
          */
         miEventQueue.dropped++;
         if (miEventQueue.dropped == 1) {
-            ErrorF
-                ("[mi] EQ overflowing.  Additional events will be discarded until existing events are processed.\n");
+            LogMessageVerbSigSafe(X_NONE, -1,
+                                  "[mi] EQ overflowing. Additional events will "
+                                  "be discarded until existing events are "
+                                  "processed.\n");
             xorg_backtrace();
-            ErrorF
-                ("[mi] These backtraces from mieqEnqueue may point to a culprit higher up the stack.\n");
-            ErrorF("[mi] mieq is *NOT* the cause.  It is a victim.\n");
+            LogMessageVerbSigSafe(X_NONE, -1,
+                                  "[mi] These backtraces from mieqEnqueue may "
+                                  "point to a culprit higher up the stack.\n"
+                                  "[mi] mieq is *NOT* the cause.  It is a "
+                                  "victim.\n");
         }
         else if (miEventQueue.dropped % QUEUE_DROP_BACKTRACE_FREQUENCY == 0 &&
                  miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY <=
                  QUEUE_DROP_BACKTRACE_MAX) {
-            ErrorF
-                ("[mi] EQ overflow continuing.  %lu events have been dropped.\n",
-                 miEventQueue.dropped);
+            char string[17];
+
+            LogMessageVerbSigSafe(X_NONE, -1, "[mi] EQ overflow continuing. ");
+            FormatUInt64(miEventQueue.dropped, string);
+            LogMessageVerbSigSafe(X_NONE, -1, string);
+            LogMessageVerbSigSafe(X_NONE, -1, " events have been dropped.\n");
             if (miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY ==
-                QUEUE_DROP_BACKTRACE_MAX) {
-                ErrorF
-                    ("[mi] No further overflow reports will be reported until the clog is cleared.\n");
-            }
+                QUEUE_DROP_BACKTRACE_MAX)
+                LogMessageVerbSigSafe(X_NONE, -1,
+                                      "[mi] No further overflow reports will "
+                                      "be reported until the clog is "
+                                      "cleared.\n");
             xorg_backtrace();
         }
 
-- 
1.7.9.1



More information about the xorg-devel mailing list