1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-23 22:42:01 -07:00

Tune Tramp traces

* doc/misc/tramp.texi (Traces and Profiles): Describe call traces.

* lisp/net/tramp-compat.el: Add `tramp-suppress-trace' property for all
functions.

* lisp/net/tramp.el (tramp-verbose): Adapt docstring.
(tramp-file-name-method, tramp-file-name-user)
(tramp-file-name-domain, tramp-file-name-host)
(tramp-file-name-port, tramp-file-name-localname)
(tramp-file-name-hop, tramp-file-name-user-domain)
(tramp-file-name-host-port, tramp-file-name-port-or-default)
(tramp-tramp-file-p, tramp-find-method, tramp-find-user)
(tramp-find-host, tramp-dissect-file-name)
(tramp-dissect-hop-name, tramp-debug-buffer-name)
(tramp-debug-outline-level, tramp-get-debug-buffer)
(tramp-get-debug-file-name, tramp-read-passwd)
(tramp-clear-passwd): Add `tramp-suppress-trace' property.
(tramp-debug-message): Activate call traces.

* test/lisp/net/tramp-tests.el (tramp--test-instrument-test-case): Simplify.
This commit is contained in:
Michael Albinus 2021-05-07 13:04:28 +02:00
parent 704755a568
commit 70bfcbcdd3
4 changed files with 58 additions and 28 deletions

View file

@ -195,9 +195,6 @@ is greater than 10.
"^error with add-name-to-file")
debug-ignored-errors))
inhibit-message)
(when trace-buffer
(dolist (elt (all-completions "tramp-" obarray 'functionp))
(trace-function-background (intern elt))))
(unwind-protect
(let ((tramp--test-instrument-test-case-p t)) ,@body)
;; Unwind forms.
@ -205,13 +202,12 @@ is greater than 10.
(untrace-all))
(when (and (null tramp--test-instrument-test-case-p) (> tramp-verbose 3))
(dolist
(buf (if trace-buffer
(cons (get-buffer trace-buffer) (tramp-list-tramp-buffers))
(tramp-list-tramp-buffers)))
(buf (append
(tramp-list-tramp-buffers)
(and trace-buffer (list (get-buffer trace-buffer)))))
(with-current-buffer buf
(message ";; %s\n%s" buf (buffer-string)))))
(when trace-buffer
(kill-buffer trace-buffer)))))
(message ";; %s\n%s" buf (buffer-string)))
(kill-buffer buf))))))
(defsubst tramp--test-message (fmt-string &rest arguments)
"Emit a message into ERT *Messages*."