unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Phil Sainty <psainty@orcon.net.nz>,
	1343@debbugs.gnu.org, 27397@debbugs.gnu.org,
	Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#27397: [PATCH] New commands for bulk tracing of elisp functions
Date: Mon, 12 Sep 2022 15:26:32 +0200	[thread overview]
Message-ID: <87h71cu3jr.fsf@gmx.de> (raw)
In-Reply-To: <87leqqdtb4.fsf_-_@gnus.org> (Lars Ingebrigtsen's message of "Sun, 11 Sep 2022 13:49:51 +0200")

Lars Ingebrigtsen <larsi@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.





  parent reply	other threads:[~2022-09-12 13:26 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16 13:32 bug#27397: [PATCH] New commands for bulk tracing of elisp functions Phil Sainty
2017-06-16 14:58 ` Dmitry Gutov
2017-06-17  8:43   ` Phil Sainty
2017-06-17  9:13     ` Dmitry Gutov
2017-06-19  7:45     ` Michael Albinus
2017-06-19  9:35       ` Phil Sainty
2017-06-19  9:56         ` Michael Albinus
2017-06-19 11:00           ` Phil Sainty
2017-06-19 12:05             ` Michael Albinus
2017-06-19 12:17               ` Phil Sainty
2017-06-19 12:50               ` Dmitry Gutov
2017-06-19 13:07                 ` Michael Albinus
2017-06-19 11:27           ` Dmitry Gutov
2017-06-19 11:36             ` Michael Albinus
2017-06-19 12:04               ` Dmitry Gutov
2017-06-19 12:08                 ` Michael Albinus
2017-06-19 12:24                 ` Phil Sainty
2017-06-16 15:43 ` Kaushal Modi
2017-06-17  8:48   ` Phil Sainty
2017-06-17  9:20 ` Phil Sainty
2017-06-17 12:31   ` Phil Sainty
2017-06-17 22:59     ` Dmitry Gutov
2017-06-18  1:06       ` Phil Sainty
2017-06-18  6:32         ` Dmitry Gutov
2017-06-18 11:22         ` Phil Sainty
2019-06-27 18:01           ` bug#1343: " Lars Ingebrigtsen
2019-06-28 11:25             ` bug#27397: " Phil Sainty
2021-04-17  5:51               ` bug#1343: [PATCH] trace package Stefan Kangas
2021-04-17 14:01                 ` bug#27397: " Phil Sainty
2021-10-21 20:29                   ` Stefan Kangas
2022-07-15  4:08               ` bug#27397: bug#1343: bug#27397: [PATCH] New commands for bulk tracing of elisp functions Phil Sainty
2022-07-15  6:23                 ` Eli Zaretskii
2022-07-15 11:09                   ` Phil Sainty
2022-09-11 11:49                 ` Lars Ingebrigtsen
2022-09-11 12:33                   ` Eli Zaretskii
2022-09-12 13:26                   ` Michael Albinus [this message]
2022-09-12 22:17                     ` Phil Sainty
2022-09-13  7:34                       ` bug#27397: " Michael Albinus
2022-09-13 11:11                     ` Lars Ingebrigtsen
2017-06-17 23:03   ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h71cu3jr.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=1343@debbugs.gnu.org \
    --cc=27397@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=larsi@gnus.org \
    --cc=psainty@orcon.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).