GNU bug report logs -
#1343
[PATCH] trace package
Previous Next
Full log
Message #42 received at 1343 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
Hi,
> I have not tried the patch myself -- does anybody have any comments
> here? It seems like useful functionality to me.
Yes, and I also agree with the comments of Eli.
One additional point:
> +@deffn Command trace-package prefix &optional buffer context after-load
> +This function calls @code{trace-function-background} for all functions
> +with names starting with @var{prefix}.
Tramp does something like this already. However, not all Tramp functions
shall be traced. For example, there is `tramp-read-passwd', which
returns the password retireved from auth-sources, or
interactively. Obviously, it shouldn't be traced when asking users for a
Tramp trace.
There are also chatty functions, which don't need to be traces, like
`tramp-message' and friends. They add serious noise to the trace, w/o
additional information.
For that reason, Tramp marks such functions with a function property,
which is to be taken into account when activating traces for all Tramp
functions. Like this:
--8<---------------cut here---------------start------------->8---
(put #'tramp-read-passwd 'tramp-suppress-trace t)
--8<---------------cut here---------------end--------------->8---
I would appreciate if `trace-package' and `trace-library' would know a
similar mechanism. It could be a function declaration in the function
definition, like
--8<---------------cut here---------------start------------->8---
(declare (debug t) inhibit-trace ...)
--8<---------------cut here---------------end--------------->8---
Or, dynamically, the global variable inhibit-trace could keep a value of
such functions suppressed for trace.
Of course there is `untrace-function', but it is inconvenient to teach
users calling all of them. And if they forget it, their password will be
exposed (for example).
> +;;;###autoload
> +(defun trace-library (library &optional buffer context after-load)
> + "Trace functions defined by LIBRARY.
> +For example, to trace tramp.el functions, you could use:
> +
> +\\[trace-library] RET tramp RET
I wouldn't use `tramp' as example for `trace-library'. Tramp consists of
a dozen of libraries, and several of them must be activated in order to
get useful traces. So as example, another library might be better
suited.
Best regards, Michael.
This bug report was last modified 2 years and 274 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.