From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#27397: [PATCH] New commands for bulk tracing of elisp functions Date: Mon, 12 Sep 2022 15:26:32 +0200 Message-ID: <87h71cu3jr.fsf@gmx.de> References: <1348823a-7623-8146-8cc0-8c0eff13e458@orcon.net.nz> <94d27dbb-46d3-1d6f-4849-251a0929d413@orcon.net.nz> <70000e90-328c-c084-3e3c-bbde96b16110@orcon.net.nz> <6b195c26-066c-870f-3432-0b24c6f619ec@orcon.net.nz> <83fa3d61-9173-c3f6-32b6-87c7c09502b7@orcon.net.nz> <15f4e949736351f2d98fdee0b57e4d24@webmail.orcon.net.nz> <87leqqdtb4.fsf_-_@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11840"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Phil Sainty , 1343@debbugs.gnu.org, 27397@debbugs.gnu.org, Dmitry Gutov To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 12 15:27:27 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXjTA-0002sG-Mj for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Sep 2022 15:27:24 +0200 Original-Received: from localhost ([::1]:46194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXjT9-0001HA-LU for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Sep 2022 09:27:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXjSo-0001FK-DJ for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2022 09:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55930) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXjSo-0007x2-40 for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2022 09:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oXjSo-0006am-0c for bug-gnu-emacs@gnu.org; Mon, 12 Sep 2022 09:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Sep 2022 13:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27397 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch moreinfo Original-Received: via spool by 27397-submit@debbugs.gnu.org id=B27397.166298921225307 (code B ref 27397); Mon, 12 Sep 2022 13:27:01 +0000 Original-Received: (at 27397) by debbugs.gnu.org; 12 Sep 2022 13:26:52 +0000 Original-Received: from localhost ([127.0.0.1]:44628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXjSe-0006a2-9w for submit@debbugs.gnu.org; Mon, 12 Sep 2022 09:26:52 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:53733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXjSb-0006Zg-RO; Mon, 12 Sep 2022 09:26:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1662989196; bh=EIxH/dtgLhrSmHgGH0I5H+HDu377UdZcK9RQZDREkJw=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=kprAYCyp78x+QRgMD6Oz8vJBJXCpYs24rQGj0PSoa4EpYYG41iZVl+6O/LQDP3bL/ QBzsqaOx1XtRxRwQMYDM37PFzlSTlVcuB9KZYPkMKnqHJGdQhyZMwi64jjQ7bsg5lu DAJZk9WW8ckq3mz4mv7/Sp487Zlf5GlCwhtBncas= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([79.140.119.44]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1McH5Q-1p3mQ338hQ-00cfcu; Mon, 12 Sep 2022 15:26:35 +0200 In-Reply-To: <87leqqdtb4.fsf_-_@gnus.org> (Lars Ingebrigtsen's message of "Sun, 11 Sep 2022 13:49:51 +0200") X-Provags-ID: V03:K1:5rxCsKDt6kE1DbMHMWIqr4JVeqaZEG1uqoqTiu5cr4yBRA2u7sI 7oJuT6nru/iQV+WTFngiRz+jNRSDAKrXP+rFcLax3B7mo37Dba/+mdBpvNDE2AzDER44pUR BYTfbEByi7ZeAR4WkstgcV9NXHybEXUjG1h7X/a+R8godHdu9TOlUGZIoN+pATXOmXR4HNj +RFTOnJDqtmlZ8+jekj7w== X-UI-Out-Filterresults: notjunk:1;V03:K0:0P6nhGiE8YY=:cQmKERM0/ClVuQmauOMmFR 98G736NbYnVp5om0eWn18Z1fH5h+eWjIzALUpO/LWVSYxyUBAm04jU067yQ1tGR+VBUYr/JaT p01HDDi8eGf0EPOoje+uieOYGuPgJfYR/8gBK+tFC7axwoxkbTkXOFwv8poYixydxsWXZo9zs nPfdt3CN4pXBYtfuM9Us29G3vH9M2k8rIJozFTzyRKjIkAltegjkuTCsAiCAw6Sft4WohiBWU Yp+DmTjn9m5D3CwSeMaHvUdojdUC7n6pfCsXn39tJwrS0KOutKXVimxLb1Te7DEjh1xYjIugO +fLREcFfY9Okd+1cP4v3GB6z521vLwdnyBYL7fTVsbkd/hNOqL/E3BtoG0YBUaZn9bT6cMMjJ fsGLT1ABmEwhvnNr+xsVQfbRK1NHoaxw5uXnllD3KtueC4lWYSmCRt5FJt29oSpvWCJsgV8qM d0jz+h0P/scgCp5ufEcjBHYRL/oXRMz70X4wS3rZYkd6yIk7A7qBz7AyqDhTiyPs34TAybcqd mcKWGd356iZzuw4gwN4BxTkoT/0FcaQqrmpm4U6kUA2V/5Y02hIJzK4c3fNiOu6tdEeNmLmK7 KNPckcOjyzsW6XBkS+yrGHm+RLIV/iqjJQ7oik8mROZifSYKgTIqZbtMvXSqEE6jvR549wltM gH4/+DCkHpW9ioQpGvJNRlCkm+7Sy/WUVi8fueqYegFjFhcSH9ZSxByQsXPqJhp6LBhlvF0PS yY3RxqAA6DPyJKmtVsOlVnj+dsKpsykMZvXteQn3lnpFB47p2bMIgEfOZlTfWq3Qix0fgE3S X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242274 Archived-At: Lars Ingebrigtsen 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.