Add tracing for performance debugging.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Wed, 22 Sep 2010 22:33:05 +0000 (00:33 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Wed, 22 Sep 2010 22:33:05 +0000 (00:33 +0200)
lisp/ChangeLog
lisp/gnus-int.el

index 6470f97..299a5e3 100644 (file)
@@ -1,5 +1,8 @@
 2010-09-22  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-int.el (gnus-open-server): Add tracing for performance
+       debugging.
+
        * gnus-group.el (gnus-group-highlight-line): Typo fix: beg, not start.
        (gnus-group-insert-group-line): Pass the real group name so that it
        gets the right data.
index 4063044..df7f979 100644 (file)
@@ -226,10 +226,18 @@ If it is down, start it up (again)."
   (eq (nth 1 (assoc method gnus-opened-servers))
       'denied))
 
+(defvar gnus-backend-trace t)
+
 (defun gnus-open-server (gnus-command-method)
   "Open a connection to GNUS-COMMAND-METHOD."
   (when (stringp gnus-command-method)
     (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
+  (when gnus-backend-trace
+    (with-current-buffer (get-buffer-create "*gnus trace*")
+      (buffer-disable-undo)
+      (goto-char (point-max))
+      (insert (format-time-string "%H:%M:%S")
+             (format " %S\n" gnus-command-method))))
   (let ((elem (assoc gnus-command-method gnus-opened-servers))
        (server (gnus-method-to-server-name gnus-command-method)))
     ;; If this method was previously denied, we just return nil.