GNU bug report logs - #27397
[PATCH] New commands for bulk tracing of elisp functions

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Phil Sainty <psainty@HIDDEN>; Keywords: patch moreinfo; merged with #1343, #6464; dated Fri, 16 Jun 2017 13:34:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 13 Sep 2022 11:11:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 13 07:11:14 2022
Received: from localhost ([127.0.0.1]:49029 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oY3ow-0008Pd-5e
	for submit <at> debbugs.gnu.org; Tue, 13 Sep 2022 07:11:14 -0400
Received: from quimby.gnus.org ([95.216.78.240]:35200)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>)
 id 1oY3or-0008PD-5R; Tue, 13 Sep 2022 07:11:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=Xn61QfnSFxwLeVXEUZXgdeVXQYByo8LsLZCIbYZo5GQ=; b=SNYU1IaiNx9YNvbfJDVPKfJrf+
 EQCygVp9BbE6QFOxQGs582KPDqIzbPpN0QKWILnW/Y95Nrh/7WNneLRXXj3NMVBs2LyZTKRJmOzgY
 7ihVw3d4K64O0nqhnJViYnZ76mgPiO+toSAfVBSXueeNOvkVF0bTcUlxO6VaV8qzXBl8=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oY3oi-0001zi-Oy; Tue, 13 Sep 2022 13:11:02 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
In-Reply-To: <87h71cu3jr.fsf@HIDDEN> (Michael Albinus's message of "Mon, 12
 Sep 2022 15:26:32 +0200")
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN>
 <m3sgruykj3.fsf@HIDDEN>
 <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
 <15f4e949736351f2d98fdee0b57e4d24@HIDDEN>
 <87leqqdtb4.fsf_-_@HIDDEN> <87h71cu3jr.fsf@HIDDEN>
X-Now-Playing: Laurel Halo's _Quarantine_: "Joy"
Date: Tue, 13 Sep 2022 13:11:00 +0200
Message-ID: <87wna74ji3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Michael Albinus <michael.albinus@HIDDEN> writes: > 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 > > (declare (debug t) inhibit-trace [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 27397
Cc: Phil Sainty <psainty@HIDDEN>, 1343 <at> debbugs.gnu.org,
 27397 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Michael Albinus <michael.albinus@HIDDEN> writes:

> 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
>
> (declare (debug t) inhibit-trace ...)

Makes sense to me.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 13 Sep 2022 07:34:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 13 03:34:40 2022
Received: from localhost ([127.0.0.1]:48679 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oY0RL-0002is-Pi
	for submit <at> debbugs.gnu.org; Tue, 13 Sep 2022 03:34:40 -0400
Received: from mout.gmx.net ([212.227.15.18]:47149)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>)
 id 1oY0RG-0002iS-JQ; Tue, 13 Sep 2022 03:34:35 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1663054460;
 bh=22ar2hiDJYSLxDKTVXpu1Qi5E+wbnpZCV381a9CpyUs=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date;
 b=gIm4mg31RXVY7wu7V1T545rS7QxPz4PcN5jU+GK9cNV3WXtr0zTuvak635FVDXYjl
 ySpZ8hjBzET4fdo3DiV9JQime0gaUBP1j5AZTg2ZN3Qbqcdu5im37ALM4AjsjXzVwW
 6GPkKGW6fZTvx99tBx/NfZ+hRyuUR4Jq6lqRu5MM=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from gandalf.gmx.de ([213.220.148.100]) by mail.gmx.net (mrgmx005
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MStCe-1okhSH3tqI-00UL7V; Tue, 13
 Sep 2022 09:34:20 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Phil Sainty <psainty@HIDDEN>
Subject: Re: bug#1343: bug#27397: [PATCH] New commands for bulk tracing of
 elisp functions
In-Reply-To: <59bc6087e71b0c370ea4fe94fba25c43@HIDDEN> (Phil
 Sainty's message of "Tue, 13 Sep 2022 10:17:24 +1200")
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN>
 <m3sgruykj3.fsf@HIDDEN>
 <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
 <15f4e949736351f2d98fdee0b57e4d24@HIDDEN>
 <87leqqdtb4.fsf_-_@HIDDEN> <87h71cu3jr.fsf@HIDDEN>
 <59bc6087e71b0c370ea4fe94fba25c43@HIDDEN>
Date: Tue, 13 Sep 2022 09:34:18 +0200
Message-ID: <87h71bn2x1.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:ijQhC80XjEwOKLTn8g+W0DGRu6VVQu0im56wB66I8q2/a401sOh
 5EA+64mONuXmapdskHLM6FX/QtJdFQ4XTlWS8YBtK2B3urBViFZWPfu+fXLoMWg4Y2DiMeM
 9/PbK63xG4EJG12fh5DkXwfmGe7oO12lM594c2JtUvutzBphpgODFzIDeIkQmRhprfnGEYL
 vf9JfRsAUtF807MxAwU1Q==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:g09AsDiKB1o=:sLVnpe0R9br0J3RxoLftiV
 jFTr9pQf3Ojxr8Grjuq5SQTQJWLsIwcJsAYTvYFekrywRkGyCK7NJ5o4x0oTw5FMV57rIxICw
 ed0zIKRcq12R6+AmeWVWAXffTepXv/27+bKFFxNb22X2nOSVqrue/qD+H9pnVdiRGMQq250Yy
 TlER4tchBfmYD6Q49laDc4PmHrvipNZRblMhRTrpPCzbBF2RlNUpwxfq5N+h+BDtAK3DCojVA
 I7LrxXtgPJHi8NY9VaaI4fQ4NDgpHKnrKshDk9GukHQtfKa6uPRdjjjcY91XyrDEdksL1/P8M
 jAD9C8XgMLd0EPwjB8ZCzE3LruiLYOtAlXMf8loeb7ln44KQueegmb0Dkx6vv/qI9Pp73i2g3
 15WJFyRcCRBdztvCJd+XKk4oa2/YQ8EZmmwvDO40jnzFe9qc5bclgCKnY5hJjlzWscp9nXEbn
 CNUmWzuwqZQNfHW9pscSaqoRhHGpcR4W99CwoGw6oCm4kK0gIggqsL5bB0deiMzUifJhDG/s7
 3K/BgkcWfiKAG0NMyQgL95XhJuE2jJ9BuQ03qL95Nwm8C0RYkNgjlT7whjsWbXRP5DIdt17SV
 8yXjwrywCDAic2ysyHUD9dOOKWU0LZHrz5vTZS2YgN+MABmiC2AT7HrF9LthwQ5EzF4DB1qzc
 dzzCmJqNMP0Ypf4yQFeE+4d9KrozrltkKaz/FtmEnvC2sALu+/82u69ok0c69EbcN3UDrKduX
 KVwYLJmCIS0pp6zwYbfswF++fQNAE+9rFOkV0z5q2I48LiCJ0kUobpTyoqaaj+dvqHMgTgtNq
 hFZO1qrAkPz8qhGUVI3NYZTUsVJTmpZ8F8LXnFSFajC+7PTL1rsbjuRDt9vB/yTU2+TyYbmp0
 ZKwb18Aj8rezU9LJY2daZjlzcZsXPqWtG4TViD6NVM8GE3jDGlu4x+AV2I0VSsUURklT7s+Lw
 TXiCD+Qafb3ZepvSKVnpv0KFbxzyJ5WSH3AABbrUr/wPwXdZDtitcWZsNnpXfCq+P6UiuF0dZ
 BCIPiPay7Wtl6pF3RS7cWKLV4ZX0CBC4SCAf350bgH8CvVIMXRLWyFG84NLR97pnKW8y2XdiE
 qUBXshDQRyvx+4gqES4Hsrwgrnq+x+/eKd8tWQHO/qF0b66uL3iGFAvGsifAYZHVb1WjdIGHq
 HeUnyJdwbV+5L8iUFix0VZMKcy
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 27397
Cc: 1343 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>,
 27397 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Phil Sainty <psainty@HIDDEN> writes:

Hi Phil,

>> There are also chatty functions, which ... add serious noise
>> For that reason, Tramp marks such functions with a function
>> property,
>> Or, dynamically, the global variable inhibit-trace could keep a
>> value
>> of such functions suppressed for trace.
>
> Oddly enough, this had also occurred to me yesterday as a useful
> improvement.

So it must be a good idea :-)

> No problem.  I think the example dates back to the info on tracing
> which used to appear in (info "(tramp) Traces and Profiles") but
> I'd noticed that had been deleted when I was rebasing this work.

Yep. After I had recognized that the instructions in the Tramp manual
aren't robust enough, I've moved this into Tramp core. It can be
activated now with a proper tramp-verbose.

> -Phil

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 12 Sep 2022 22:17:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 12 18:17:34 2022
Received: from localhost ([127.0.0.1]:48311 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXrkE-0005Gk-0f
	for submit <at> debbugs.gnu.org; Mon, 12 Sep 2022 18:17:34 -0400
Received: from smtp-3.orcon.net.nz ([60.234.4.44]:48735)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>)
 id 1oXrkB-0005GU-Qp; Mon, 12 Sep 2022 18:17:32 -0400
Received: from [10.253.37.70] (port=48200 helo=webmail.orcon.net.nz)
 by smtp-3.orcon.net.nz with esmtpa (Exim 4.90_1)
 (envelope-from <psainty@HIDDEN>)
 id 1oXrk4-0007kF-OB; Tue, 13 Sep 2022 10:17:24 +1200
Received: from ip-116-251-140-135.kinect.net.nz ([116.251.140.135])
 via [10.253.37.253] by webmail.orcon.net.nz
 with HTTP (HTTP/1.1 POST); Tue, 13 Sep 2022 10:17:24 +1200
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Tue, 13 Sep 2022 10:17:24 +1200
From: Phil Sainty <psainty@HIDDEN>
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: bug#1343: bug#27397: [PATCH] New commands for bulk tracing of
 elisp functions
In-Reply-To: <87h71cu3jr.fsf@HIDDEN>
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN>
 <m3sgruykj3.fsf@HIDDEN>
 <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
 <15f4e949736351f2d98fdee0b57e4d24@HIDDEN>
 <87leqqdtb4.fsf_-_@HIDDEN> <87h71cu3jr.fsf@HIDDEN>
Message-ID: <59bc6087e71b0c370ea4fe94fba25c43@HIDDEN>
X-Sender: psainty@HIDDEN
User-Agent: Orcon Webmail
X-GeoIP: --
X-Spam_score: -2.9
X-Spam_score_int: -28
X-Spam_bar: --
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 27397
Cc: 1343 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>,
 27397 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 2022-09-13 01:26, Michael Albinus wrote:
> There are also chatty functions, which ... add serious noise
> 
> For that reason, Tramp marks such functions with a function property,
> 
> Or, dynamically, the global variable inhibit-trace could keep a value
> of such functions suppressed for trace.

Oddly enough, this had also occurred to me yesterday as a useful
improvement.  I was thinking of a global list of functions not to
be traced, but your symbol property approach seems like a good idea
as well.  Perhaps "both" is good.  For symbol properties I think
there would need to be a variable to control whether or not that
was respected, to make it relatively easy to force them to be traced
regardless.


> I wouldn't use `tramp' as example for `trace-library'.

No problem.  I think the example dates back to the info on tracing
which used to appear in (info "(tramp) Traces and Profiles") but
I'd noticed that had been deleted when I was rebasing this work.


-Phil





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 12 Sep 2022 13:26:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 12 09:26:52 2022
Received: from localhost ([127.0.0.1]:44628 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXjSe-0006a2-9w
	for submit <at> debbugs.gnu.org; Mon, 12 Sep 2022 09:26:52 -0400
Received: from mout.gmx.net ([212.227.17.20]:53733)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>)
 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
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
From: Michael Albinus <michael.albinus@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
In-Reply-To: <87leqqdtb4.fsf_-_@HIDDEN> (Lars Ingebrigtsen's message of
 "Sun, 11 Sep 2022 13:49:51 +0200")
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN>
 <m3sgruykj3.fsf@HIDDEN>
 <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
 <15f4e949736351f2d98fdee0b57e4d24@HIDDEN>
 <87leqqdtb4.fsf_-_@HIDDEN>
Date: Mon, 12 Sep 2022 15:26:32 +0200
Message-ID: <87h71cu3jr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:5rxCsKDt6kE1DbMHMWIqr4JVeqaZEG1uqoqTiu5cr4yBRA2u7sI
 7oJuT6nru/iQV+WTFngiRz+jNRSDAKrXP+rFcLax3B7mo37Dba/+mdBpvNDE2AzDER44pUR
 BYTfbEByi7ZeAR4WkstgcV9NXHybEXUjG1h7X/a+R8godHdu9TOlUGZIoN+pATXOmXR4HNj
 +RFTOnJDqtmlZ8+jekj7w==
X-Spam-Flag: NO
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+dsKpsykMZvXteQn3lnpFB47p2bMIgEfOZlTfWq3Qix0fgE3Sn
 hhBoR9n+AdJUY4HeYaOLfS5fF1pQz3PN+knBYCQ2NFsh2xO2r1BkWLE6ARIUNCQzyfQJLALAt
 uavwr82Yf4QVneWl6QdMhiYaSwFJAPU+0UgdmmfNfH+5acTaILmPgfqF5zc+p8/B2s/xtL/vk
 qfx54QfdVD2q2otD3Ph7drP4gGgbLkr1pXjMprqmHb9IyO/+bt+uQ3vg5LLCJi+8WxJMk7Elc
 STFTyHwibQAGcFFbLN1ZgapD/98zQHorfUtkyH27FhjmWCocBfWkLL9ip4K2go2Bix9ovX/HR
 3QRLdWL6BIOzBE3a9HXkdmPwI7DtJBcWseJWk272k39kcOLvQEU+fB9ns3LDsAuYEoCt9Gf5+
 QmwCKp/+p95KNOWCTTncEEK2xC
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 27397
Cc: Phil Sainty <psainty@HIDDEN>, 1343 <at> debbugs.gnu.org,
 27397 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 11 Sep 2022 12:33:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 11 08:33:59 2022
Received: from localhost ([127.0.0.1]:41070 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXM9u-0003Vw-Qt
	for submit <at> debbugs.gnu.org; Sun, 11 Sep 2022 08:33:59 -0400
Received: from eggs.gnu.org ([209.51.188.92]:52218)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>)
 id 1oXM9s-0003Ve-KW; Sun, 11 Sep 2022 08:33:57 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40390)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oXM9m-0005Tx-Vh; Sun, 11 Sep 2022 08:33:50 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=VjlQqvTPtgTQe48SHqWyP2qqPSCNcxaJTra9xENaa4E=; b=rjTFfW/msTc+
 soOuP0kWmDgpziqZQwmNOysvINoHKkbuYDaai60JyfU7o/GPh17m4911FjfFpuqGgWd51TA0Togue
 fxHxZ7dzk1IGA9fycHafIqbCPeaUCearBX8VUWwx9lO/0WoS5SMPQ3Pd1nhpPSPFHAFZjzAlBuJ1a
 2uG1RZ6NB7lwiT0WruJeDHmF7PEuSdwFELezuD15aNQ/SuVgo8PYemqraq/Pj/XI90qOrsMTGdV1k
 PUhCTJblLkcvCJiJZ2Xl1s4OpJgP0MiIsNUptgYCKFve+nJwMniFqXqv8XmmsL+bMZAZRgpw/vSaW
 fIrqtcpMz7WQ93m98drlyQ==;
Received: from [87.69.77.57] (port=2947 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oXM9m-0003k4-6W; Sun, 11 Sep 2022 08:33:50 -0400
Date: Sun, 11 Sep 2022 15:33:32 +0300
Message-Id: <83y1uq850j.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
In-Reply-To: <87leqqdtb4.fsf_-_@HIDDEN> (message from Lars Ingebrigtsen on
 Sun, 11 Sep 2022 13:49:51 +0200)
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN>
 <m3sgruykj3.fsf@HIDDEN>
 <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
 <15f4e949736351f2d98fdee0b57e4d24@HIDDEN>
 <87leqqdtb4.fsf_-_@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 27397
Cc: psainty@HIDDEN, 1343 <at> debbugs.gnu.org, 27397 <at> debbugs.gnu.org,
 michael.albinus@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: 1343 <at> debbugs.gnu.org, 27397 <at> debbugs.gnu.org,
>  Michael Albinus <michael.albinus@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>
> From: Lars Ingebrigtsen <larsi@HIDDEN>
> Date: Sun, 11 Sep 2022 13:49:51 +0200
> 
> Phil Sainty <psainty@HIDDEN> writes:
> 
> > After a brief hiatus, I've resumed (maybe completed) my work on this.
> >
> > The branch scratch/bulk-tracing contains the updated code for Emacs 29
> > (rebased over master).
> 
> For reference, I've included the diff between master and the branch
> below.
> 
> I have not tried the patch myself -- does anybody have any comments
> here?  It seems like useful functionality to me.

Yes, it is useful.

The documentation uses UK English spelling ("behaviour").  (Perhaps
today this is justified, but since a few days will have passed until
this is landed, I think we should use US English conventions
nonetheless.)

I see lack of important detail where stuff like 'context' and
'trace-value' is described: at the very least the manual should say
whether the text will be inserted verbatim, or with something like
newlines and/or other decorations added.

IMO, the description of trace-value should be before all the untrace-*
functions.

Why isn't trace-is-traceable-p documented in the manual?  It sounds
relevant to the discussion of the restrictions.

I think the description should be updated fore native-compilation (it
only mentions byte-compilation).

The hunk from modes.texi seems unrelated.

The NEWS entry should have a single-line heading that is a full
sentence ending with a period.

Please verify that doc strings of functions mention all the
arguments.  (E.g., trace-currently-traced doesn't.)

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.
Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 11 Sep 2022 11:50:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 11 07:50:10 2022
Received: from localhost ([127.0.0.1]:41025 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXLTU-0008UO-OI
	for submit <at> debbugs.gnu.org; Sun, 11 Sep 2022 07:50:10 -0400
Received: from quimby.gnus.org ([95.216.78.240]:39772)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>)
 id 1oXLTO-0008TT-UX; Sun, 11 Sep 2022 07:50:05 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=r5b5ztAs9odQ2P8PtuPpJ5o+nqEg77NPRtwk+UQfOWM=; b=Eou0Y+atzUVCFcUL41D/+tMkRD
 9h6Ss23yYzhRHGKjt2kIAfxZhP2YQnPUhYbZlyOlAhMO38cZScYSfFXl6bYkPvT2i/qdDhm4pxirT
 Tu1tjVqqudYS5qOhSthzmztATltGsYYoSM0XbformcQcs71TFB4umezzQgL9qe00ii4k=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oXLTD-00041Y-Kn; Sun, 11 Sep 2022 13:49:55 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Phil Sainty <psainty@HIDDEN>
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
In-Reply-To: <15f4e949736351f2d98fdee0b57e4d24@HIDDEN> (Phil
 Sainty's message of "Fri, 15 Jul 2022 16:08:46 +1200")
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN>
 <m3sgruykj3.fsf@HIDDEN>
 <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
 <15f4e949736351f2d98fdee0b57e4d24@HIDDEN>
X-Now-Playing: Earwig's _Under My Skin I Am Laughing_: "Every Day Shines"
Date: Sun, 11 Sep 2022 13:49:51 +0200
Message-ID: <87leqqdtb4.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Phil Sainty <psainty@HIDDEN> writes: > After a brief
 hiatus,
 I've resumed (maybe completed) my work on this. > > The branch
 scratch/bulk-tracing
 contains the updated code for Emacs 29 > (rebased over master). 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 27397
Cc: 1343 <at> debbugs.gnu.org, 27397 <at> debbugs.gnu.org,
 Michael Albinus <michael.albinus@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Phil Sainty <psainty@HIDDEN> writes:

> After a brief hiatus, I've resumed (maybe completed) my work on this.
>
> The branch scratch/bulk-tracing contains the updated code for Emacs 29
> (rebased over master).

For reference, I've included the diff between master and the branch
below.

I have not tried the patch myself -- does anybody have any comments
here?  It seems like useful functionality to me.

diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi
index 058c931954..6bdcf33a95 100644
--- a/doc/lispref/debugging.texi
+++ b/doc/lispref/debugging.texi
@@ -20,14 +20,10 @@ Debugging
 You can use Edebug, a source-level debugger for Emacs Lisp.
 
 @item
-@cindex tracing Lisp programs
-You can trace the execution of functions involved in the problem using
-the tracing facilities provided by the @file{trace.el} package.  This
-package provides the functions @code{trace-function-foreground} and
-@code{trace-function-background} for tracing function calls, and
-@code{trace-values} for adding values of select variables to the
-trace.  For the details, see the documentation of these facilities in
-@file{trace.el}.
+You can trace the execution of functions involved in the problem
+(logging function calls, their arguments and return values, and other
+context values) using the tracing facilities provided by the
+@file{trace.el} package.
 
 @item
 If a syntactic problem is preventing Lisp from even reading the
@@ -59,6 +55,7 @@ Debugging
 * Syntax Errors::       How to find syntax errors.
 * Test Coverage::       Ensuring you have tested all branches in your code.
 * Profiling::           Measuring the resources that your code uses.
+* Tracing::             Log function calls, arguments, and return values.
 @end menu
 
 @node Debugger
@@ -1072,3 +1069,327 @@ Profiling
 debugging Emacs.  It actually stops the Lisp-level @kbd{M-x
 profiler-@dots{}} commands described above from working.
 @end ifnottex
+
+
+@node Tracing
+@section Tracing
+@cindex tracing
+@cindex trace
+@cindex trace functions
+@cindex tracing Lisp programs
+
+You can trace the execution of functions using the tracing facilities
+provided by the @file{trace.el} library.  Many functions can be traced
+at the same time.  The commands @code{trace-function-foreground} and
+@code{trace-function-background} add a new trace to a single specified
+function.  The commands @code{trace-package}, @code{trace-regexp}, and
+@code{trace-library} enable traces to be added to functions en masse.
+Traces can also be added to autoloaded functions -- the associated
+function will be traced if and when it is defined.
+
+@vindex trace-buffer
+Calls to traced functions, including the values of their arguments and
+their return values, are logged to the @file{*trace-output*} buffer
+(or another buffer as specified -- either by the @code{trace-buffer}
+user option, or as the @var{buffer} argument to a tracing command).
+
+@anchor{trace context}
+@cindex @code{context} in trace functions
+Optional @var{context} expressions are also evaluated, both when the
+associated function is called and again when it returns, with the
+value logged within square brackets alongside the call-time arguments
+or return value respectively.  This could be used to track the current
+buffer or position of point, for instance.  If @var{context} is a
+function, it will be called (with no arguments) to obtain the value to
+be inserted into the trace output buffer.
+
+Finally, you may add explicit calls to @code{trace-values} to your
+code, to log arbitrary values to the trace buffer at any time.
+
+@anchor{background and foreground tracing}
+@cindex foreground tracing
+@cindex background tracing
+When using ``foreground'' tracing, the output buffer will be displayed
+whenever a traced function is called.  When using ``background''
+tracing the output buffer is not forcibly displayed.  Because
+foreground tracing affects the window configuration, it should not be
+used to trace functions that switch buffers, or have other
+display-oriented behaviour.  To avoid such problems, all bulk tracing
+commands use background tracing -- @code{trace-function-foreground} is
+the only command providing foreground tracing.
+
+@menu
+* Commands for Tracing::  Commands and variables.
+* Restrictions on Tracing:: Limitations on what can be traced.
+* Examples of Tracing::   Usage examples.
+@end menu
+
+@node Commands for Tracing
+@subsection Commands and variables for tracing functions
+
+@defopt trace-buffer
+This variable defines the buffer where trace output will be logged to
+by default.  Trace commands can be passed a @var{buffer} argument to
+specify a non-default output buffer.
+@end defopt
+
+@defvar inhibit-trace
+If this variable is non-@code{nil}, all tracing is temporarily
+inhibited (including any calls to @code{trace-values}).
+@end defvar
+
+@deffn Command trace-function-background function &optional buffer context
+This function adds a background trace (@pxref{background and
+foreground tracing}) to @var{function}.  When called interactively, it
+prompts for @var{function} in the minibuffer.  With a prefix argument,
+it also prompts for the trace output @var{buffer} (defaulting to the
+value of @code{trace-buffer}), and a Lisp expression @var{context}
+(@pxref{trace context}).
+
+If @var{function} is an autoload, the associated function will be
+traced if and when it is defined.
+
+Calling @code{trace-function-background} for an already-traced
+@var{function} will update the optional argument behaviours to respect
+the new values (and change to background tracing, if foreground
+tracing was previously used).
+@end deffn
+
+@deffn Command trace-function-foreground function &optional buffer context
+This function adds a foreground trace (@pxref{background and
+foreground tracing}) to @var{function}.  When called interactively, it
+prompts for @var{function} in the minibuffer.  With a prefix argument,
+it also prompts for the trace output @var{buffer} (defaulting to the
+value of @code{trace-buffer}), and a Lisp expression @var{context}
+(@pxref{trace context}).
+
+If @var{function} is an autoload, the associated function will be
+traced if and when it is defined.
+
+Calling @code{trace-function-foreground} for an already-traced
+@var{function} will update the optional argument behaviours to respect
+the new values (and change to foreground tracing, if background
+tracing was previously used).
+@end deffn
+
+@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}.
+
+For any autoload declarations matching @var{prefix}, the associated
+function will be traced if and when it is defined.
+
+With a prefix argument, also prompt for the trace output @var{buffer}
+(defaulting to the value of @code{trace-buffer}); a Lisp expression
+@var{context} (@pxref{trace context}); and boolean query
+@var{after-load}.  If @var{after-load} is non-@code{nil} then
+re-process @var{prefix} after loading any file.
+
+Calling @code{trace-package} again for the same @var{prefix} will
+update the optional argument behaviours to respect the new values.
+@end deffn
+
+@deffn Command trace-regexp regexp &optional buffer context after-load
+This function calls @code{trace-function-background} for all functions
+matching in @var{regexp}.
+
+Background tracing is used.  Switch to the trace output buffer to view
+the results.  For any autoload declarations matching @var{regexp}, the
+associated function will be traced if and when it is defined.
+
+With a prefix argument, also prompt for the trace output @var{buffer}
+(defaulting to the value of @code{trace-buffer}); a Lisp expression
+@var{context} (@pxref{trace context}); and boolean query
+@var{after-load}.  If @var{after-load} is non-@code{nil} then
+re-process @var{regexp} after loading any file.
+
+Calling @code{trace-regexp} again for the same @var{regexp} will
+update the optional argument behaviours to respect the new values.
+
+@strong{Warning:} Do not attempt to trace all functions.  Tracing too
+many functions at one time will render Emacs unusable.
+@end deffn
+
+@deffn Command trace-library library &optional buffer context after-load
+This function calls @code{trace-function-background} for all functions
+currently defined in @var{library} according to @var{load-history}.
+
+For any autoload declarations with a file name matching @var{library},
+the associated function will be traced if and when it is defined.
+(Autoload file names will not match if @var{library} specifies a
+longer, more specific path.)
+
+With a prefix argument, also prompt for the trace output @var{buffer}
+(defaulting to the value of @code{trace-buffer}); a Lisp expression
+@var{context} (@pxref{trace context}); and boolean query
+@var{after-load}.  If @var{after-load} is non-@code{nil} then
+re-process @var{library} after loading it, (ensuring that all of its
+functions will be traced).
+
+Calling @code{trace-library} again for the same @var{library} will
+update the optional argument behaviours to respect the new values.
+@end deffn
+
+@deffn Command trace-currently-traced &optional display-message
+This function returns the list of currently traced function symbols.
+When called interactively, or if @var{display-message} is
+non-@code{nil}, it displays the list as a message.
+@end deffn
+
+@deffn Command untrace-function function
+This function removes the trace on @var{function}.  This has no effect
+if @var{function} was not being traced.  When called interactively, it
+prompts for @var{function} in the minibuffer.
+@end deffn
+
+@deffn Command untrace-package prefix
+This function calls @code{untrace-function} for all functions with
+names starting with @var{prefix}.  When called interactively, it
+prompts for @var{prefix} in the minibuffer.
+@end deffn
+
+@deffn Command untrace-regexp regexp
+This function calls @code{untrace-function} for all functions matching
+@var{regexp}.  When called interactively, it prompts for @var{regexp}
+in the minibuffer.
+@end deffn
+
+@deffn Command untrace-library library
+This function calls @code{untrace-function} for all functions defined
+in @var{library}.  When called interactively, it prompts for
+@var{library} in the minibuffer.
+@end deffn
+
+@deffn Command untrace-all
+This function calls @code{untrace-function} for all functions.
+@end deffn
+
+@deffn Function trace-values &rest values
+This function inserts a message showing @var{values} into the trace
+buffer.  You can add explicit calls to @code{trace-values} into your
+functions in order to provide additional tracing information.
+@end deffn
+
+
+@node Restrictions on Tracing
+@subsection Limitations on what can be traced
+
+@itemize @bullet
+@item
+Only functions/macros/subrs that are called via their function cell
+will generate trace output; hence, you won't get trace output for:
+
+@itemize @bullet
+@item
+Macros that were expanded during compilation.
+
+@item
+Subrs called directly from other subrs/C-code.
+
+@item
+Byte-compiled calls to subrs that have special byte-codes associated
+with them:
+
+@example
+(sort (cl-loop for sym being the symbols
+               if (and (subrp (symbol-function sym))
+                       (plist-get (symbol-plist sym)
+                                  'byte-opcode))
+               collect sym)
+      (lambda (s1 s2)
+        (string< (symbol-name s1) (symbol-name s2))))
+@end example
+@end itemize
+
+@item
+Tracing too many functions at one time will render Emacs unusable.  Do
+not attempt to trace all functions, and take care with the arguments
+passed to the bulk tracing commands @code{trace-package} and
+@code{trace-regexp}.
+
+@item
+Foreground tracing should not be used to trace functions that switch
+buffers, or have other display-oriented behaviour.
+
+@item
+Each function can only be subject to a single trace.  When a function
+which is already being traced is targeted by any tracing command, the
+new trace criteria (including optional argument values) will replace
+the previous trace criteria for that function.
+
+Note that this also means there is no need to un-trace a function in
+order to re-trace it with different arguments.
+
+@item
+All the restrictions that apply to @file{nadvice.el} also apply to
+tracing (as tracing is implemented using advice).  @xref{Advising
+Functions}.
+@end itemize
+
+@node Examples of Tracing
+@subsection Usage examples for function tracing
+
+The following is example trace output, including a context list
+expression, for a function which also makes a call to
+@code{trace-values}.  The left hand column indicates the evaluation
+depth of the function call.
+
+@example
+@group
+1 -> (funcname arg1 arg2) [(context1 context2)]
+1 -> (trace-values value1 value2)
+1 <- funcname: return [(context1 context2)]
+@end group
+@end example
+
+The trace output display of recursion/nesting levels can be
+demonstrated by tracing a recursive function, such as a simplistic
+factorial implementation:
+
+@example
+@group
+(defun fact (n)
+  "Calculate factorial of N."
+  (if (eql n 0) 1
+    (* n (fact (1- n)))))
+     @result{} fact
+
+(trace-function 'fact)
+     @result{} fact
+
+Now, evaluating this...
+
+(fact 4)
+     @result{} 24
+
+...will generate the following in *trace-buffer*:
+
+1 -> fact: n=4
+| 2 -> fact: n=3
+| | 3 -> fact: n=2
+| | | 4 -> fact: n=1
+| | | | 5 -> fact: n=0
+| | | | 5 <- fact: 1
+| | | 4 <- fact: 1
+| | 3 <- fact: 2
+| 2 <- fact: 6
+1 <- fact: 24
+@end group
+
+Try the following for some more interesting trace output:
+
+@group
+(defun ack (x y z)
+  (if (= x 0)
+      (+ y z)
+    (if (and (<= x 2) (= z 0))
+        (1- x)
+      (if (and (> x 2) (= z 0))
+          y
+        (ack (1- x) y (ack x y (1- z)))))))
+
+(trace-function 'ack)
+
+(ack 3 3 1)
+@end group
+@end example
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index a3d1d80408..64f31cdf3d 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -669,6 +669,7 @@ Top
 * Syntax Errors::           How to find syntax errors.
 * Test Coverage::           Ensuring you have tested all branches in your code.
 * Profiling::               Measuring the resources that your code uses.
+* Tracing::                 Log function calls, arguments, and return values.
 
 The Lisp Debugger
 
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index e94093318f..ad2b175afb 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2507,15 +2507,13 @@ %-Constructs
 @item %%
 The character @samp{%}---this is how to include a literal @samp{%} in a
 string in which @code{%}-constructs are allowed.
-@end table
-
-The following @code{%}-construct is still supported, but it is
-obsolete, since you can get the same result using the variable
-@code{mode-name}.
 
-@table @code
 @item %m
-The value of @code{mode-name}.
+Obsolete; use the @code{mode-name} variable instead.  The @code{%m}
+construct is still supported, but it is inadequate, as it produces an
+empty string if the value of the @code{mode-name} variable is a
+non-string mode-line construct (for example, in
+@code{emacs-lisp-mode}).
 @end table
 
 @node Properties in Mode
diff --git a/etc/NEWS b/etc/NEWS
index 57845df979..9728edc303 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1918,6 +1918,16 @@ The newly created buffer will be displayed via 'display-buffer', which
 can be customized through the usual mechanism of 'display-buffer-alist'
 and friends.
 
+** Trace
+
++++
+*** New commands 'trace-package', 'trace-regexp', and 'trace-library'
+(and their counterparts 'untrace-package', 'untrace-regexp', and
+'untrace-library') allow for the bulk tracing of calls to functions
+with names matching a specified prefix or regexp, or functions defined
+by a specified file.  New command 'trace-currently-traced' lists the
+traced function symbols.
+
 ** Tramp
 
 ---
diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el
index c2f6c16226..a4fcfd50b0 100644
--- a/lisp/emacs-lisp/trace.el
+++ b/lisp/emacs-lisp/trace.el
@@ -40,8 +40,6 @@
 
 ;; Restrictions:
 ;; =============
-;; - Traced subrs when called interactively will always show nil as the
-;;   value of their arguments.
 ;; - Only functions/macros/subrs that are called via their function cell will
 ;;   generate trace output, hence, you won't get trace output for:
 ;;   + Subrs called directly from other subrs/C-code
@@ -52,14 +50,28 @@
 
 ;; Usage:
 ;; ======
-;; - To trace a function say `M-x trace-function', which will ask you for the
+;; - To trace a function use `M-x trace-function', which will ask you for the
 ;;   name of the function/subr/macro to trace.
 ;; - If you want to trace a function that switches buffers or does other
 ;;   display oriented stuff use `M-x trace-function-background', which will
 ;;   generate the trace output silently in the background without popping
 ;;   up windows and doing other irritating stuff.
-;; - To untrace a function say `M-x untrace-function'.
-;; - To untrace all currently traced functions say `M-x untrace-all'.
+;; - `M-x trace-package' will ask you for a function name prefix, and trace
+;;   (in the background) all matching functions.
+;; - `M-x trace-regexp' will ask you for a function name pattern (regexp),
+;;   and trace (in the background) all matching functions.
+;; - `M-x trace-library' will ask you for a library name, and trace (in the
+;;   background) all functions defined by that file.
+;; - Interactively in all cases, a prefix argument can be used to prompt
+;;   for the output buffer and context arguments and, for bulk tracing
+;;   commands, whether or not the traces should be automatically updated
+;;   after loading lisp files.
+;; - To untrace a function use `M-x untrace-function'.
+;; - To untrace multiple functions by prefix use `M-x untrace-package'.
+;; - To untrace multiple functions by regexp use `M-x untrace-regexp'.
+;; - To untrace multiple functions by file use `M-x untrace-library'.
+;; - To untrace all currently traced functions use `M-x untrace-all'.
+;; - To list all currently traced functions use `M-x trace-currently-traced'.
 
 ;; Examples:
 ;; =========
@@ -120,6 +132,23 @@
 
 ;;; Change Log:
 
+;; 2017-06-17  Phil Sainty
+;;	* New commands `trace-package', `untrace-package', `trace-regexp',
+;;	  `untrace-regexp', `trace-library', `untrace-library'.
+;;      * Documentation added to the elisp reference manual.
+;;
+;; 2012-2014  Stefan Monnier, Glenn Morris
+;;	* Adapted for nadvice.el
+;;	* New `context' argument and display in trace buffer
+;;	* `trace-function' renamed to (and now an alias of)
+;;	  `trace-function-foreground'
+;;
+;; 2005-02-27  Stefan Monnier
+;;	* New `inhibit-trace' variable
+;;
+;; 1998-04-05  Stephen Eglen
+;;	* New customize group `trace'
+;;
 ;; Revision 2.0 1993/05/18 00:41:16 hans
 ;;	* Adapted for advice.el 2.0; it now also works
 ;;	  for GNU Emacs-19 and Lemacs
@@ -134,6 +163,8 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'cl-macs))
+
 (defgroup trace nil
   "Tracing facility for Emacs Lisp functions."
   :prefix "trace-"
@@ -181,7 +212,7 @@ trace-entry-message
             ;; FIXME: Make it so we can click the function name to jump to its
             ;; definition and/or untrace it.
             (cons function args)
-            context)))
+            (if context (format " [%s]" context) ""))))
 
 (defun trace-exit-message (function level value context)
   "Generate a string that describes that FUNCTION has exited.
@@ -197,7 +228,7 @@ trace-exit-message
             function
             ;; Do this so we'll see strings:
             value
-            context)))
+            (if context (format " [%s]" context) ""))))
 
 (defvar trace--timer nil)
 
@@ -218,8 +249,14 @@ trace-make-advice
 FUNCTION is the name of the traced function.
 BUFFER is the buffer where the trace should be printed.
 BACKGROUND if nil means to display BUFFER.
-CONTEXT if non-nil should be a function that returns extra info that should
-be printed along with the arguments in the trace."
+CONTEXT, if non-nil, should be either a function or an expression
+that returns extra info, which will be printed after the
+arguments or return value in the trace."
+  (setq context (if context
+                    (if (functionp context)
+                        context
+                      (trace-make-context context))
+                  (lambda () "")))
   (lambda (body &rest args)
     (let ((trace-level (1+ trace-level))
           (trace-buffer (get-buffer-create buffer))
@@ -227,6 +264,7 @@ trace-make-advice
           (ctx (funcall context)))
       (unless inhibit-trace
         (with-current-buffer trace-buffer
+          (setq-local page-delimiter (format "^%s" (regexp-quote trace-separator)))
           (setq-local window-point-insertion-type t)
           (unless background (trace--display-buffer trace-buffer))
           (goto-char (point-max))
@@ -255,41 +293,70 @@ trace-function-internal
   "Add trace advice for FUNCTION."
   (advice-add
    function :around
-   (trace-make-advice function (or buffer trace-buffer) background
-                      (or context (lambda () "")))
+   (trace-make-advice function (or buffer trace-buffer) background context)
    `((name . ,trace-advice-name) (depth . -100))))
 
-(defun trace-is-traced (function)
+(defun trace-is-traceable-p (sym)
+  "Whether the given symbol is a traceable function.
+Autoloaded functions are traceable."
+  (or (functionp sym) (macrop sym)))
+
+(defun trace-is-traced-p (function)
+  "Whether FUNCTION is currently traced."
   (advice-member-p trace-advice-name function))
 
-(defun trace--read-args (prompt)
-  "Read a function name, prompting with string PROMPT.
-If `current-prefix-arg' is non-nil, also read a buffer and a \"context\"
-\(Lisp expression).  Return (FUNCTION BUFFER FUNCTION-CONTEXT)."
-  (cons
-   (let ((default (function-called-at-point)))
-     (intern (completing-read (format-prompt prompt default)
-                              obarray 'fboundp t nil nil
-                              (if default (symbol-name default)))))
-   (when current-prefix-arg
-     (list
-      (read-buffer "Output to buffer" trace-buffer)
-      (let ((exp
-             (read-from-minibuffer "Context expression: "
-                                   nil read-expression-map t
-                                   'read-expression-history)))
-        (lambda ()
-          (let ((print-circle t)
-                (print-escape-newlines t))
-            (concat " [" (prin1-to-string (eval exp t)) "]"))))))))
+(define-obsolete-function-alias 'trace-is-traced 'trace-is-traced-p "29.1")
+
+(defun trace-currently-traced (&optional display-message)
+  "Return the list of currently traced function symbols.
+Interactively, display the list as a message."
+  (interactive "p")
+  (let ((tracelist (cl-loop for sym being the symbols
+                            if (trace-is-traced-p sym)
+                            collect sym)))
+    (when display-message
+      (message "%S" tracelist))
+    tracelist))
+
+(defun trace--read-function (prompt)
+  "Read a function name, prompting with string PROMPT."
+  (let ((default (function-called-at-point)))
+    (intern (completing-read (format-prompt prompt default)
+                             obarray 'trace-is-traceable-p t nil nil
+                             (if default (symbol-name default))))))
+
+(defun trace--read-library (&optional prompt)
+  "Read a library name, prompting with string PROMPT."
+  (completing-read
+   (or prompt "Library: ")
+   (apply-partially 'locate-file-completion-table
+                    load-path (get-load-suffixes))))
+
+(defun trace--read-extra-args ()
+  "Read a buffer and a \"context\" (Lisp expression).
+Return (BUFFER CONTEXT)."
+  (list
+   (read-buffer "Output to buffer" trace-buffer)
+   (when-let ((exp (read-from-minibuffer
+                    "Context expression: "
+                    nil read-expression-map t
+                    'read-expression-history "nil")))
+     (trace-make-context exp))))
+
+(defun trace-make-context (exp)
+  "Return a context function for expression EXP."
+  (lambda ()
+    (let ((print-circle t)
+          (print-escape-newlines t))
+      (prin1-to-string (eval exp t)))))
 
 ;;;###autoload
 (defun trace-function-foreground (function &optional buffer context)
   "Trace calls to function FUNCTION.
-With a prefix argument, also prompt for the trace buffer (default
-`trace-buffer'), and a Lisp expression CONTEXT.  When called from
-Lisp, CONTEXT should be a function of no arguments which returns
-a value to insert into BUFFER during the trace.
+With a prefix argument, also prompt for the trace output BUFFER
+\(default `trace-buffer'), and a Lisp expression CONTEXT.
+When called from Lisp, CONTEXT should be a function of no arguments
+which returns a value to insert into BUFFER during the trace.
 
 Tracing a function causes every call to that function to insert
 into BUFFER Lisp-style trace messages that display the function's
@@ -302,8 +369,14 @@ trace-function-foreground
 functions that switch buffers, or do any other display-oriented
 stuff - use `trace-function-background' instead.
 
+Calling `trace-function-foreground' again for the same FUNCTION
+will update the optional argument behaviours to respect the new
+values.
+
 To stop tracing a function, use `untrace-function' or `untrace-all'."
-  (interactive (trace--read-args "Trace function"))
+  (interactive
+   (cons (trace--read-function "Trace function")
+         (and current-prefix-arg (trace--read-extra-args))))
   (trace-function-internal function buffer nil context))
 
 ;;;###autoload
@@ -311,26 +384,290 @@ trace-function-background
   "Trace calls to function FUNCTION, quietly.
 This is like `trace-function-foreground', but without popping up
 the output buffer or changing the window configuration."
-  (interactive (trace--read-args "Trace function in background"))
+  (interactive
+   (cons (trace--read-function "Trace function in background")
+         (and current-prefix-arg (trace--read-extra-args))))
   (trace-function-internal function buffer t context))
 
 ;;;###autoload
 (defalias 'trace-function 'trace-function-foreground)
 
 (defun untrace-function (function)
-  "Untraces FUNCTION and possibly activates all remaining advice.
-Activation is performed with `ad-update', hence remaining advice will get
-activated only if the advice of FUNCTION is currently active.  If FUNCTION
-was not traced this is a noop."
+  "Remove trace from FUNCTION.  If FUNCTION was not traced this is a noop."
   (interactive
    (list (intern (completing-read "Untrace function: "
-                                  obarray #'trace-is-traced t))))
+                                  obarray #'trace-is-traced-p t))))
   (advice-remove function trace-advice-name))
 
+;;;###autoload
+(defun trace-package (prefix &optional buffer context after-load)
+  "Trace all functions with names starting with PREFIX.
+For example, to trace all diff functions, do the following:
+
+\\[trace-package] RET diff- RET
+
+Background tracing is used.  Switch to the trace output buffer to
+view the results.  For any autoload declarations matching PREFIX,
+the associated function will be traced if and when it is defined.
+
+With a prefix argument, also prompt for the optional arguments.
+If AFTER-LOAD is non-nil then re-process PREFIX after loading any
+file.  See `trace-function-foreground' for details of BUFFER and
+CONTEXT, and of foreground vs background tracing.
+
+Calling `trace-package' again for the same PREFIX will update the
+optional argument behaviours to respect the new values.
+
+See also `untrace-package'."
+  ;; Derived in part from `elp-instrument-package'.
+  (interactive
+   (cons (completing-read "Prefix of package to trace: "
+                          obarray #'trace-is-traceable-p)
+         (and current-prefix-arg
+              (nconc (trace--read-extra-args)
+                     (list (y-or-n-p "Update traces after loading files?"))))))
+  (when (zerop (length prefix))
+    (error "Tracing all Emacs functions would render Emacs unusable"))
+  (mapc (lambda (name)
+          (trace-function-background (intern name) buffer context))
+        (all-completions prefix obarray #'trace-is-traceable-p))
+  (message
+   "Tracing to %s.  Use %s to untrace a package, or %s to remove all traces."
+   (or buffer trace-buffer)
+   (substitute-command-keys "\\[untrace-package]")
+   (substitute-command-keys "\\[untrace-all]"))
+  ;; Handle `after-load' argument.
+  (when after-load
+    (trace--after-load 'prefix prefix buffer context)))
+
+(defun untrace-package (prefix)
+  "Remove all traces from functions with names starting with PREFIX.
+
+See also `trace-package'."
+  (interactive
+   (list (completing-read "Prefix of package to untrace: "
+                          obarray #'trace-is-traced-p)))
+  (if (and (zerop (length prefix))
+           (y-or-n-p "Remove all function traces?"))
+      (untrace-all)
+    (mapc (lambda (name)
+            (untrace-function (intern name)))
+          (all-completions prefix obarray #'trace-is-traced-p)))
+  ;; Remove any `after-load' behaviour.
+  (trace--remove-after-load 'prefix prefix))
+
+;;;###autoload
+(defun trace-regexp (regexp &optional buffer context after-load)
+  "Trace all functions with names matching REGEXP.
+For example, to trace indentation-related functions, you could try:
+
+\\[trace-regexp] RET indent\\|offset RET
+
+Warning: Do not attempt to trace all functions.  Tracing too many
+functions at one time will render Emacs unusable.
+
+Background tracing is used.  Switch to the trace output buffer to
+view the results.  For any autoload declarations matching REGEXP,
+the associated function will be traced if and when it is defined.
+
+With a prefix argument, also prompt for the optional arguments.
+If AFTER-LOAD is non-nil then re-process REGEXP after loading any
+file.  See `trace-function-foreground' for details of BUFFER and
+CONTEXT, and of foreground vs background tracing.
+
+Calling `trace-regexp' again for the same REGEXP will update the
+optional argument behaviours to respect the new values.
+
+See also `untrace-regexp'."
+  (interactive
+   (cons (read-regexp "Regexp matching functions to trace: ")
+         (and current-prefix-arg
+              (nconc (trace--read-extra-args)
+                     (list (y-or-n-p "Update traces after loading files?"))))))
+  (when (member regexp '("" "." ".+" ".*"))
+    ;; Not comprehensive, but it catches the most likely attempts.
+    (error "Tracing all Emacs functions would render Emacs unusable"))
+  (mapatoms
+   (lambda (sym)
+     (and (trace-is-traceable-p sym)
+          (string-match-p regexp (symbol-name sym))
+          (trace-function-background sym buffer context))))
+  (message
+   "Tracing to %s.  Use %s to untrace by regexp, or %s to remove all traces."
+   (or buffer trace-buffer)
+   (substitute-command-keys "\\[untrace-regexp]")
+   (substitute-command-keys "\\[untrace-all]"))
+  ;; Handle `after-load' argument.
+  (when after-load
+    (trace--after-load 'regexp regexp buffer context)))
+
+(defun untrace-regexp (regexp)
+  "Remove all traces from functions with names matching REGEXP.
+
+See also `trace-regexp'."
+  (interactive
+   (list (read-regexp "Regexp matching functions to untrace: ")))
+  (if (and (zerop (length regexp))
+           (y-or-n-p "Remove all function traces?"))
+      (untrace-all)
+    (mapatoms
+     (lambda (sym)
+       (and (trace-is-traced-p sym)
+            (string-match-p regexp (symbol-name sym))
+            (untrace-function sym)))))
+  ;; Remove any `after-load' behaviour.
+  (trace--remove-after-load 'regexp regexp))
+
+;;;###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
+
+Background tracing is used.  Switch to the trace output buffer to
+view the results.  For any autoload declarations with a file name
+matching LIBRARY, the associated function will be traced if and
+when it is defined.  (Autoload file names will not match if LIBRARY
+specifies a longer, more specific path.)
+
+With a prefix argument, also prompt for the optional arguments.
+If AFTER-LOAD is non-nil then re-process LIBRARY after loading it
+\(ensuring that all of its functions will be traced).  See
+`trace-function-foreground' for details of BUFFER and CONTEXT,
+and of foreground vs background tracing.
+
+Calling `trace-library' again for the same LIBRARY will update the
+optional argument behaviours to respect the new values.
+
+See also `untrace-library'."
+  (interactive
+   (cons (trace--read-library)
+         (and current-prefix-arg
+              (nconc (trace--read-extra-args)
+                     (list (y-or-n-p "Update traces after loading this library?"))))))
+  ;; Build list of library functions and autoloads.
+  (let ((defs (nconc (trace--library-defuns library)
+                     (trace--library-autoloads library))))
+    ;; Trace each of those definitions.
+    (mapc (lambda (func)
+            (trace-function-background func buffer context))
+          defs))
+  ;; Handle `after-load' argument.
+  (when after-load
+    (trace--after-load 'library library buffer context)))
+
+(defun trace--library-defuns (library)
+  "Returns a list of loaded function definitions associated with LIBRARY."
+  (delq nil (mapcar (lambda (x)
+                      (and (consp x)
+                           (eq (car x) 'defun)
+                           (cdr x)))
+                    (cdr (load-history-filename-element
+                          (load-history-regexp library))))))
+
+(defun trace--library-autoloads (library)
+  "Returns a list of all current autoloads associated with LIBRARY.
+
+Autoload file names will not match if LIBRARY specifies a longer,
+more specific path than that of the autoload declaration itself."
+  (let* ((functions nil)
+         (filepattern (load-history-regexp library))
+         (predicate (apply-partially 'trace--library-provides-autoload-p
+                                     filepattern)))
+    (mapatoms (lambda (sym)
+                (when (funcall predicate sym)
+                  (push sym functions))))
+    functions))
+
+(defun trace--library-provides-autoload-p (filepattern sym)
+  "Whether symbol SYM is an autoload associated with FILEPATTERN.
+
+FILEPATTERN should be the result of calling `load-history-regexp'."
+  (when (fboundp sym)
+    (let ((f (symbol-function sym)))
+      (and (autoloadp f)
+           (string-match filepattern (cadr f))))))
+
+(defun untrace-library (library)
+  "Remove all traces from functions defined by LIBRARY.
+
+See also `trace-library'."
+  (interactive (list (trace--read-library)))
+  ;; Remove traces from known LIBRARY defuns.
+  ;; (Also process autoloads, in case LIBRARY is unloaded.)
+  (let ((defs (nconc (trace--library-defuns library)
+                     (trace--library-autoloads library))))
+    (mapc (lambda (func)
+            (when (trace-is-traced-p func)
+              (untrace-function func)))
+          defs))
+  ;; Remove any `after-load' behaviour.
+  (trace--remove-after-load 'library library))
+
+(defvar trace--after-load-alist nil
+  "List of trace types to update after loading.
+
+Each list item has the form ((TYPE . VALUE) BUFFER CONTEXT),
+where TYPE is one of the symbols `prefix', `regexp', or `library';
+and VALUE is the respective first argument to `trace-package',
+`trace-regexp', or `trace-library'; with BUFFER and CONTEXT being
+the values of those arguments as they were passed to the same
+function.")
+
+(defun trace--after-load (type value &optional buffer context)
+  "Arrange to update traces after libraries are loaded.
+
+TYPE is one of the symbols `prefix', `regexp', or `library';
+VALUE is the respective first argument to `trace-package',
+`trace-regexp', or `trace-library'; and BUFFER and CONTEXT are
+the values of those arguments as they were passed to the same
+function.
+
+Adds `trace--after-load-function' to `after-load-functions'."
+  ;; Remove any existing spec for this (TYPE VALUE) key.
+  (trace--remove-after-load type value)
+  ;; Add the new spec.
+  (push (list (cons type value) buffer context)
+        trace--after-load-alist)
+  ;; Arrange to call `trace--after-load-function'.
+  (add-hook 'after-load-functions #'trace--after-load-function))
+
+(defun trace--after-load-function (file)
+  "React to FILE being loaded.  Callback for `after-load-functions'.
+
+See also `trace--after-load'."
+  (dolist (spec trace--after-load-alist)
+    (cl-destructuring-bind ((type . value) buffer context)
+        spec
+      (cl-case type
+        (prefix (trace-package value nil buffer context))
+        (regexp (trace-regexp value nil buffer context))
+        (library (when (string-match (load-history-regexp value) file)
+                   (trace-library value nil buffer context)))))))
+
+(defun trace--remove-after-load (type value)
+  "Remove any (TYPE . VALUE) entry from `trace--after-load-alist'.
+
+Remove `trace--after-load-function' from `after-load-functions'
+if it is no longer needed."
+  (setq trace--after-load-alist
+        (cl-delete (cons type value) trace--after-load-alist
+                   :key #'car :test #'equal))
+  (unless trace--after-load-alist
+    (remove-hook 'after-load-functions #'trace--after-load-function)))
+
+(defun trace--remove-after-load-all ()
+  "Reset `trace--after-load-alist'.
+Remove `trace--after-load-function' from `after-load-functions'"
+  (setq trace--after-load-alist nil)
+  (remove-hook 'after-load-functions #'trace--after-load-function))
+
 (defun untrace-all ()
-  "Untraces all currently traced functions."
+  "Remove traces from all currently traced functions."
   (interactive)
-  (mapatoms #'untrace-function))
+  (mapatoms #'untrace-function)
+  (trace--remove-after-load-all))
 
 (provide 'trace)
 




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 15 Jul 2022 11:09:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 15 07:09:40 2022
Received: from localhost ([127.0.0.1]:39653 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oCJCW-0003Nj-LZ
	for submit <at> debbugs.gnu.org; Fri, 15 Jul 2022 07:09:40 -0400
Received: from smtp-1.orcon.net.nz ([60.234.4.34]:39523)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>)
 id 1oCJCU-0003NY-0C; Fri, 15 Jul 2022 07:09:39 -0400
Received: from [10.253.37.70] (port=36330 helo=webmail.orcon.net.nz)
 by smtp-1.orcon.net.nz with esmtpa (Exim 4.90_1)
 (envelope-from <psainty@HIDDEN>)
 id 1oCJCP-0002Ry-5S; Fri, 15 Jul 2022 23:09:33 +1200
Received: from ip-116-251-140-135.kinect.net.nz ([116.251.140.135])
 via [10.253.37.253] by webmail.orcon.net.nz
 with HTTP (HTTP/1.1 POST); Fri, 15 Jul 2022 23:09:33 +1200
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Fri, 15 Jul 2022 23:09:33 +1200
From: Phil Sainty <psainty@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#1343: bug#27397: [PATCH] New commands for bulk tracing of
 elisp functions
In-Reply-To: <83pmi6sxlz.fsf@HIDDEN>
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN>
 <m3sgruykj3.fsf@HIDDEN>
 <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
 <15f4e949736351f2d98fdee0b57e4d24@HIDDEN>
 <83pmi6sxlz.fsf@HIDDEN>
Message-ID: <5463685802691e2f284a7cb239d3d28f@HIDDEN>
X-Sender: psainty@HIDDEN
User-Agent: Orcon Webmail
X-GeoIP: --
X-Spam_score: -2.9
X-Spam_score_int: -28
X-Spam_bar: --
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
Cc: 1343 <at> debbugs.gnu.org, larsi@HIDDEN, 27397 <at> debbugs.gnu.org,
 michael.albinus@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 2022-07-15 18:23, Eli Zaretskii wrote:
> Thanks, but please add documentation at some point (I mean the
> manual).

I did document these changes in the elisp manual to the extent
that any of the trace functionality is documented (which is
minimally).

The key documentation would probably be for the functionality
which was already present, rather than for the changes I've made
here; so anyone familiar with trace.el might add that.  I'll try
to throw something together from commentary and docstrings in
the near future though (including the new changes), assuming no
one else does so first.


-Phil





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 15 Jul 2022 06:23:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 15 02:23:39 2022
Received: from localhost ([127.0.0.1]:39265 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oCEji-0003du-S6
	for submit <at> debbugs.gnu.org; Fri, 15 Jul 2022 02:23:39 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33918)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>)
 id 1oCEjb-0003dW-96; Fri, 15 Jul 2022 02:23:34 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:57634)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oCEjV-0006y1-IG; Fri, 15 Jul 2022 02:23:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=6nizwPwjgysLYnLb4IN/png2wm322sNZ2gDMOkoiRPc=; b=Uw79VcVACvZ8
 hRk1uYYDirddmNcYCz8HSZ14kIBUiK2XaimdjUjs38k3fZPxcR6asMyaNh1AD+pGQ4UM0Kpc36AtH
 4fBmK6M8COt7W/viEjzGa8WgRWkXW8qwrL2HElyR4ZQpwdFf8EpBOQX3tkbXalEDvfivWthzMlDbp
 h5mfin30QZf0Z4+zdYOC+WihzrBhhUb8X3XrHCPUiLwTTX1soDxdz5ACV4rLgWDKKvsBpmGAFwvpT
 9o4mzIl7btGlMq4tvBET9Ypy4BZFmijIR93ix708QXdKaNmdPi6X4xaYdG48CpqyBHrLeo/3d2Nje
 ob1Vbd99d3AgMdsJcIpeuA==;
Received: from [87.69.77.57] (port=3919 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oCEjU-0000wz-UN; Fri, 15 Jul 2022 02:23:25 -0400
Date: Fri, 15 Jul 2022 09:23:20 +0300
Message-Id: <83pmi6sxlz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Phil Sainty <psainty@HIDDEN>
In-Reply-To: <15f4e949736351f2d98fdee0b57e4d24@HIDDEN> (message
 from Phil Sainty on Fri, 15 Jul 2022 16:08:46 +1200)
Subject: Re: bug#1343: bug#27397: [PATCH] New commands for bulk tracing of
 elisp functions
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN>
 <m3sgruykj3.fsf@HIDDEN>
 <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
 <15f4e949736351f2d98fdee0b57e4d24@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 27397
Cc: 1343 <at> debbugs.gnu.org, larsi@HIDDEN, 27397 <at> debbugs.gnu.org,
 michael.albinus@HIDDEN, dgutov@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: Lars Ingebrigtsen <larsi@HIDDEN>,
>  Michael Albinus <michael.albinus@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>
> Date: Fri, 15 Jul 2022 16:08:46 +1200
> From: Phil Sainty <psainty@HIDDEN>
> 
> After a brief hiatus, I've resumed (maybe completed) my work on this.
> 
> The branch scratch/bulk-tracing contains the updated code for Emacs 29
> (rebased over master).
> 
> NEWS is:
> 
> *** New commands 'trace-package', 'trace-regexp', and 'trace-library'
> (and their counterparts 'untrace-package', 'untrace-regexp', and
> 'untrace-library') allow for the bulk tracing of calls to functions
> with names matching a specified prefix or regexp, or functions defined
> by a specified file.  New command 'trace-currently-traced' lists the
> traced function symbols.

Thanks, but please add documentation at some point (I mean the
manual).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 15 Jul 2022 04:08:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 15 00:08:57 2022
Received: from localhost ([127.0.0.1]:39176 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oCCdN-0008UW-7W
	for submit <at> debbugs.gnu.org; Fri, 15 Jul 2022 00:08:57 -0400
Received: from smtp-1.orcon.net.nz ([60.234.4.34]:54017)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>)
 id 1oCCdH-0008UB-3G; Fri, 15 Jul 2022 00:08:55 -0400
Received: from [10.253.37.70] (port=22451 helo=webmail.orcon.net.nz)
 by smtp-1.orcon.net.nz with esmtpa (Exim 4.90_1)
 (envelope-from <psainty@HIDDEN>)
 id 1oCCdD-0003UQ-0X; Fri, 15 Jul 2022 16:08:47 +1200
Received: from ip-116-251-140-135.kinect.net.nz ([116.251.140.135])
 via [10.253.37.253] by webmail.orcon.net.nz
 with HTTP (HTTP/1.1 POST); Fri, 15 Jul 2022 16:08:46 +1200
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Fri, 15 Jul 2022 16:08:46 +1200
From: Phil Sainty <psainty@HIDDEN>
To: 27397 <at> debbugs.gnu.org, 1343 <at> debbugs.gnu.org
Subject: Re: bug#1343: bug#27397: [PATCH] New commands for bulk tracing of
 elisp functions
In-Reply-To: <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN>
 <m3sgruykj3.fsf@HIDDEN>
 <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
Message-ID: <15f4e949736351f2d98fdee0b57e4d24@HIDDEN>
X-Sender: psainty@HIDDEN
User-Agent: Orcon Webmail
X-GeoIP: --
X-Spam_score: -2.9
X-Spam_score_int: -28
X-Spam_bar: --
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
Cc: Lars Ingebrigtsen <larsi@HIDDEN>,
 Michael Albinus <michael.albinus@HIDDEN>, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

After a brief hiatus, I've resumed (maybe completed) my work on this.

The branch scratch/bulk-tracing contains the updated code for Emacs 29
(rebased over master).

NEWS is:

*** New commands 'trace-package', 'trace-regexp', and 'trace-library'
(and their counterparts 'untrace-package', 'untrace-regexp', and
'untrace-library') allow for the bulk tracing of calls to functions
with names matching a specified prefix or regexp, or functions defined
by a specified file.  New command 'trace-currently-traced' lists the
traced function symbols.


-Phil





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 21 Oct 2021 20:29:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 21 16:29:10 2021
Received: from localhost ([127.0.0.1]:58706 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mdegX-0000HW-Ut
	for submit <at> debbugs.gnu.org; Thu, 21 Oct 2021 16:29:10 -0400
Received: from mail-pf1-f177.google.com ([209.85.210.177]:37561)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>)
 id 1mdegV-0000GQ-1l; Thu, 21 Oct 2021 16:29:07 -0400
Received: by mail-pf1-f177.google.com with SMTP id q19so1691660pfl.4;
 Thu, 21 Oct 2021 13:29:06 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:in-reply-to:references:user-agent
 :mime-version:date:message-id:subject:to:cc;
 bh=bvl05SMFvzVm8C2p/d4pSfQhY7XgWM7h3okfz+lSRws=;
 b=jKUxYI5Odxf2g8sH0zYPxfiPLsUFEkFqfSyfl0CRmyEdiMlPnWYSYUMdWvtGuZSCkT
 DgcM0mXLvNAqHQtjuyda8r//br9oBY98MyTWhO740eJmmS6XdUe1owJDItcz78j4DHoE
 MvKcW9B9+vP+tpWdTBapR+20t+ER4t1AQnHuWzUtYddGRIEdzpuaeDff09iW3PiWeOsm
 //Nari2BtBIOuEwiN6MaLcjIElTCkcQXMox3WpeFifCHtgNjndzhLzl95+1N9P5920ip
 lgpKrksDsf+Y0A2ADgmvp6/d+zRDPW2ToH9dRWW3LXrm4lLBiKIYFNZqJhG8hTb3DMtW
 +DQQ==
X-Gm-Message-State: AOAM531IZDbeff57m6O0xNEVIwlCIcmqY+rw5Zsmy5QW3FkJ/5/RrmdH
 4yNC/LjQ992KAklHJ76W9KY4JI4SJUx8rNd+amk=
X-Google-Smtp-Source: ABdhPJyazVREq4ncUbHYtPWvn6YaaYRgjRt8tVzoEiAz9Kf9yPHUISM5sf6u63UJhXl1s0GiO6s9GKVMFwW1UcQKHu8=
X-Received: by 2002:aa7:978b:0:b0:44c:abf1:a8b8 with SMTP id
 o11-20020aa7978b000000b0044cabf1a8b8mr8256524pfp.35.1634848141329; Thu, 21
 Oct 2021 13:29:01 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Thu, 21 Oct 2021 13:29:01 -0700
From: Stefan Kangas <stefan@HIDDEN>
In-Reply-To: <11b5a271-413d-9134-116e-3370030e99e1@HIDDEN> (Phil
 Sainty's message of "Sun, 18 Apr 2021 02:01:38 +1200")
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN> <m3sgruykj3.fsf@HIDDEN>
 <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
 <CADwFkmmFhDvn1XHz2HpDuiLhJqOU2Kiq3iWLaNZFoZDL-qU-CQ@HIDDEN>
 <11b5a271-413d-9134-116e-3370030e99e1@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Date: Thu, 21 Oct 2021 13:29:01 -0700
Message-ID: <CADwFkm=ZOhoQAQiE5Aj_8mRPyqXZDd-WpgL1JUuAcoSABAtaUQ@HIDDEN>
Subject: Re: bug#1343: [PATCH] trace package
To: Phil Sainty <psainty@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 27397
Cc: 1343 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>,
 27397 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

Phil Sainty <psainty@HIDDEN> writes:

> Hi Stefan,
>
> On 17/04/21 5:51 pm, Stefan Kangas wrote:
>> (That was almost 2 years ago.)
>> Any updates here?
>
> Unfortunately not.  I think I briefly resumed work on that at
> the time, but it almost immediately got sidelined again.

Is there anything stopping us from adding what you have so far?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 17 Apr 2021 14:01:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 17 10:01:43 2021
Received: from localhost ([127.0.0.1]:44079 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lXlW3-00011J-9V
	for submit <at> debbugs.gnu.org; Sat, 17 Apr 2021 10:01:43 -0400
Received: from smtp-1.orcon.net.nz ([60.234.4.34]:44067)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>)
 id 1lXlW1-000115-L3; Sat, 17 Apr 2021 10:01:42 -0400
Received: from [101.53.216.162] (port=13442 helo=[192.168.20.103])
 by smtp-1.orcon.net.nz with esmtpa (Exim 4.90_1)
 (envelope-from <psainty@HIDDEN>)
 id 1lXlVz-0002Hz-C8; Sun, 18 Apr 2021 02:01:39 +1200
Subject: Re: bug#1343: [PATCH] trace package
To: Stefan Kangas <stefan@HIDDEN>
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN> <m3sgruykj3.fsf@HIDDEN>
 <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
 <CADwFkmmFhDvn1XHz2HpDuiLhJqOU2Kiq3iWLaNZFoZDL-qU-CQ@HIDDEN>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <11b5a271-413d-9134-116e-3370030e99e1@HIDDEN>
Date: Sun, 18 Apr 2021 02:01:38 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.10.0
MIME-Version: 1.0
In-Reply-To: <CADwFkmmFhDvn1XHz2HpDuiLhJqOU2Kiq3iWLaNZFoZDL-qU-CQ@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-GB
Content-Transfer-Encoding: 7bit
X-GeoIP: NZ
X-Spam_score: -2.9
X-Spam_score_int: -28
X-Spam_bar: --
X-Spam-Score: 2.9 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Hi Stefan, On 17/04/21 5:51 pm, Stefan Kangas wrote: > (That
 was almost 2 years ago.) > Any updates here? Unfortunately not. I think I
 briefly resumed work on that at the time,
 but it almost immediately got sidelined again. 
 Content analysis details:   (2.9 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
 low trust [60.234.4.34 listed in list.dnswl.org]
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [101.53.216.162 listed in zen.spamhaus.org]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (psainty[at]orcon.net.nz)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 NICE_REPLY_A           Looks like a legit reply (A)
X-Debbugs-Envelope-To: 27397
Cc: 1343 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>,
 27397 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.9 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Hi Stefan, On 17/04/21 5:51 pm, Stefan Kangas wrote: > (That
    was almost 2 years ago.) > Any updates here? Unfortunately not. I think I
    briefly resumed work on that at the time, but it almost immediately got sidelined
    again. 
 
 Content analysis details:   (1.9 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [101.53.216.162 listed in zen.spamhaus.org]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at https://www.dnswl.org/,
                             low trust
                             [60.234.4.34 listed in list.dnswl.org]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (psainty[at]orcon.net.nz)
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager
 -0.0 NICE_REPLY_A           Looks like a legit reply (A)

Hi Stefan,

On 17/04/21 5:51 pm, Stefan Kangas wrote:
> (That was almost 2 years ago.)
> Any updates here?

Unfortunately not.  I think I briefly resumed work on that at
the time, but it almost immediately got sidelined again.

-Phil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 17 Apr 2021 05:51:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 17 01:51:49 2021
Received: from localhost ([127.0.0.1]:42072 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lXdru-00030X-G7
	for submit <at> debbugs.gnu.org; Sat, 17 Apr 2021 01:51:49 -0400
Received: from mail-pg1-f170.google.com ([209.85.215.170]:39865)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>)
 id 1lXdrl-000305-2Z; Sat, 17 Apr 2021 01:51:40 -0400
Received: by mail-pg1-f170.google.com with SMTP id j32so5807188pgm.6;
 Fri, 16 Apr 2021 22:51:36 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:in-reply-to:references:user-agent
 :mime-version:date:message-id:subject:to:cc;
 bh=9sJ109i8Bur19lEUU2LJiUXmpiP50i7XjEPYduQPl9Y=;
 b=Wjz0KspB+iMw7O64OCNG2LV+4GFY8aSPsklIFsOJ61UgyE00yiK5rEh602zQc817mO
 0jpuTcP+gvqTQoxwYED/roHGVjjapjGGnFjMNFy9ZtQOdxB+YASkv65A0WLbsBeD9Cyh
 SmT7W9/Byb0qipA19h7RUY7QxiXhEZRpbkpYkoMkAg/CpTR2xeEYWBn2vpqI4nq1WGOj
 VO9BRei8ooReq5OslIVDgTIYuCnOsMxu34eYaWyhlUDjE4fdb5GrFl0NVvdUQpDodAH7
 kY4WkMK9fgmnLLGUaniPKIdOIKGKjafIotE+sBHyo9JR9WQu0blgoKk8NZdjgUg/to9/
 Mfog==
X-Gm-Message-State: AOAM5303aIdysxxfYvpIGcvYmCrW2suoHGEXOjWMZxIJtxG4dgfNuPh4
 j90TnncCdFDg8jr6Gt1Rbq3l3h2OzBdgYr0rdJ8=
X-Google-Smtp-Source: ABdhPJzH9pViNfw2ssz0lIVNZhVS07cPBS9yOVxM8zfuVBj3SWfb07ULfG0nF5bxdNzXqAyfkz5ETFJk8PNQIXjY7X8=
X-Received: by 2002:aa7:828f:0:b029:200:6e27:8c8f with SMTP id
 s15-20020aa7828f0000b02902006e278c8fmr10636314pfm.44.1618638691245; Fri, 16
 Apr 2021 22:51:31 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sat, 17 Apr 2021 00:51:30 -0500
From: Stefan Kangas <stefan@HIDDEN>
In-Reply-To: <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN> (Phil
 Sainty's message of "Fri, 28 Jun 2019 23:25:56 +1200")
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN> <m3sgruykj3.fsf@HIDDEN>
 <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Date: Sat, 17 Apr 2021 00:51:30 -0500
Message-ID: <CADwFkmmFhDvn1XHz2HpDuiLhJqOU2Kiq3iWLaNZFoZDL-qU-CQ@HIDDEN>
Subject: Re: bug#1343: [PATCH] trace package
To: Phil Sainty <psainty@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 27397
Cc: 1343 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi@HIDDEN>,
 27397 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

Hi Phil,

Phil Sainty <psainty@HIDDEN> writes:

> On 28/06/19 6:01 AM, Lars Ingebrigtsen wrote:
>> The consensus seemed to be that adding commands for tracing a large
>> number of functions was welcome, even if Michael had some usability
>> concerns.  But it was never applied?
>
> Correct.  This has been languishing on my to-do list for a
> long time (albeit not forgotten about), as my time has been
> pretty limited, and I've been spending it on other projects.
>
> With so-long.el hopefully out of the way for now, and seeing
> as how you've raised it, I'll try to get back to this next
> (I had a bunch of work-in-progress based on the previous
> discussions at the time I stashed it).

(That was almost 2 years ago.)

Any updates here?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 28 Jun 2019 11:26:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 28 07:26:06 2019
Received: from localhost ([127.0.0.1]:40445 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hgp13-0001xA-Nz
	for submit <at> debbugs.gnu.org; Fri, 28 Jun 2019 07:26:06 -0400
Received: from smtp-4.orcon.net.nz ([60.234.4.59]:35151)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>)
 id 1hgp0z-0001wb-SC; Fri, 28 Jun 2019 07:26:03 -0400
Received: from [116.251.203.174] (port=37728 helo=[192.168.20.103])
 by smtp-4.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>)
 id 1hgp0v-00031V-Da; Fri, 28 Jun 2019 23:25:57 +1200
Subject: Re: bug#1343: bug#27397: [PATCH] New commands for bulk tracing of
 elisp functions
To: Lars Ingebrigtsen <larsi@HIDDEN>
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN> <m3sgruykj3.fsf@HIDDEN>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <83fa3d61-9173-c3f6-32b6-87c7c09502b7@HIDDEN>
Date: Fri, 28 Jun 2019 23:25:56 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.7.0
MIME-Version: 1.0
In-Reply-To: <m3sgruykj3.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-GeoIP: NZ
X-Spam_score: -2.9
X-Spam_score_int: -28
X-Spam_bar: --
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 27397
Cc: 1343 <at> debbugs.gnu.org, 27397 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Lars,

On 28/06/19 6:01 AM, Lars Ingebrigtsen wrote:
> The consensus seemed to be that adding commands for tracing a large
> number of functions was welcome, even if Michael had some usability
> concerns.  But it was never applied?

Correct.  This has been languishing on my to-do list for a
long time (albeit not forgotten about), as my time has been
pretty limited, and I've been spending it on other projects.

With so-long.el hopefully out of the way for now, and seeing
as how you've raised it, I'll try to get back to this next
(I had a bunch of work-in-progress based on the previous
discussions at the time I stashed it).


-Phil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 27 Jun 2019 18:01:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 27 14:01:59 2019
Received: from localhost ([127.0.0.1]:39559 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hgYid-0006KA-4W
	for submit <at> debbugs.gnu.org; Thu, 27 Jun 2019 14:01:59 -0400
Received: from quimby.gnus.org ([80.91.231.51]:46358)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>)
 id 1hgYib-0006Hp-7G; Thu, 27 Jun 2019 14:01:57 -0400
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories)
 by quimby.gnus.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89)
 (envelope-from <larsi@HIDDEN>)
 id 1hgYiX-0008O5-3v; Thu, 27 Jun 2019 20:01:55 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Phil Sainty <psainty@HIDDEN>
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
 <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN>
Date: Thu, 27 Jun 2019 20:01:52 +0200
In-Reply-To: <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN> (Phil
 Sainty's message of "Sun, 18 Jun 2017 23:22:31 +1200")
Message-ID: <m3sgruykj3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Phil Sainty <psainty@HIDDEN> writes: > (I guess I'll
 follow up next weekend if no one has anything to add > in the interim.) The
 consensus seemed to be that adding commands for tracing a large number of
 functions was welcome, even if Michael had some usability concerns. But it
 was never applied? 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 27397
Cc: 1343 <at> debbugs.gnu.org, 27397 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Phil Sainty <psainty@HIDDEN> writes:

> (I guess I'll follow up next weekend if no one has anything to add
> in the interim.)

The consensus seemed to be that adding commands for tracing a large
number of functions was welcome, even if Michael had some usability
concerns.  But it was never applied?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 19 Jun 2017 13:07:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 19 09:07:41 2017
Received: from localhost ([127.0.0.1]:55744 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMwP6-0008Hz-FL
	for submit <at> debbugs.gnu.org; Mon, 19 Jun 2017 09:07:41 -0400
Received: from mout.gmx.net ([212.227.15.19]:52277)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>) id 1dMwP4-0008Hm-Vd
 for 27397 <at> debbugs.gnu.org; Mon, 19 Jun 2017 09:07:39 -0400
Received: from detlef.gmx.de ([212.86.44.161]) by mail.gmx.com (mrgmx002
 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LnPGI-1e0xNp0oSE-00hbXX; Mon, 19
 Jun 2017 15:07:27 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN>
 <8760fs5sjw.fsf@detlef>
 <aa357d58-a309-d648-c3f0-47d8cd833581@HIDDEN>
 <871sqg5mig.fsf@detlef>
 <6282010c-b2ec-ebca-35b7-a382b30ea3f0@HIDDEN>
 <87poe0i3mw.fsf@detlef>
 <fdf5533c-f6ef-1ff4-f8f0-9cd2a9e21dd1@HIDDEN>
Date: Mon, 19 Jun 2017 15:07:25 +0200
In-Reply-To: <fdf5533c-f6ef-1ff4-f8f0-9cd2a9e21dd1@HIDDEN> (Dmitry Gutov's
 message of "Mon, 19 Jun 2017 15:50:00 +0300")
Message-ID: <87h8zci0s2.fsf@detlef>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:QtHK3IJSxBPXpkkmK55INYw0UVXGZC0+585Ee6Uw/xC2zuKI+So
 YTEhbX8xVzGCFjhq5hgdyGfq6M9y8KP7WzuXe4DZgU4ED6qqQSOdryDg7qkX53G0iR0dVkM
 lgkkJz3wJMHoS8ir96xHHzHFmZtu965HwWmDxOdLuxmPg5XPs1yoNMh38SmAfBaxKA9Ml3Q
 KnQecNlRQqueJGZiGIGqQ==
X-UI-Out-Filterresults: notjunk:1;V01:K0:TGD9wEFp7ac=:9Tnb23yErEe0AtfxzeW19v
 PcAJUTGBzPEBNn9Pevr55wWQ5s1Ftv8L2kraLXz8P9z9kqPS4WXowT5h921BA9NygjRlKvorr
 7Wy9M22UPxrULQMP1EWLPhUxGVjiDKi1hO1mQDrhRwdVPXlM/Qmfr77yd8eyKRniY6jakTXbY
 kjlpx5ngpyzRyLELKO1Srj6iENgQzD1RSRR8Ks9V/RiXemEGFSBHkgmlEHgmwt5utH3hbKRkN
 M6ithQjgXy2j90AUpOb2X/UQjAM5vGm4aXbQlMlaQrHEUcLlSqrCjT0zsQpZBgPAsQ91QL5OO
 mPJ2fn5rHT6rOy0SUZ9rg1VMvHr53Ot1wqdYJXVvDdrXnTPBnMKA0+vuhwxAmNEQCClU+slmZ
 6XVHB8DMO4AxqlFCbm9PIaEAf3du3fAK4zY6Q2+Ik7y3Rpa0efURtVCWePpYUL+47aga2yPuN
 haqgZ85qQ537NrAMNjMDiRt6t+egZxs78b2jw9ndEwMQ17Ba8iX6Pgn/xCmuz5EkmgpWlPXLa
 VRSuB2YS2o2zS2fP9k3a7+2wQhmll1WKy8r5+lXtMz13AXyM6V1lRpq2pKyXI7XnrfALMtFmU
 KxGQuBGFMdlDZysbwvLwHOOaZh40L5VoL/T7/0xLlFv7tKc/IVTReMI7yvjSi30hVI6I2ZNnQ
 dvnwqE+sb43NMS4xPsHiuNxpSuRzs3FnY+FDDcgSiBPWZlMdpBZ40hEkuZkhFiMnxCkp2qhOH
 ENynsLOGZqKg5IfdX3fbWalu8zX4V7Ekr30U0Esyi9QW3iUEaX44R+lixOC8up2WjiTvx/wEx
 STwXajt
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 27397
Cc: Phil Sainty <psainty@HIDDEN>, 27397 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Dmitry Gutov <dgutov@HIDDEN> writes:

Hi Dmitry,

> I'm not sure I understand. This find the library to which a function
> belongs. How do we find the file corresponding to a package name this
> way?

Forget it. Phil has a simpler approach, based on `load-history'.

> This question aside, I'm not sure we'll always want to ignore
> "tramp-sh" when tracing "tramp". IOW, that this will be every user's
> preference.

Sure. There's still (trace-regexp "^tramp-"), no problem.

> For instance, someone might try to trace-package "cedet", and expect
> every function belonging to CEDET to be traced, subpackages and all.

How do you define you a "subpackage"? In Tramp, I don't know what makes
tramp-sh.el a subpackage of tramp.el, except my knowledge as maintainer.

> And likewise for multi-file ELPA packages. In that case, it's
> understood that a "package" can be spread over several files.

Again, `tramp-regexp' is your friend.

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 19 Jun 2017 12:50:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 19 08:50:12 2017
Received: from localhost ([127.0.0.1]:55728 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMw8C-0007tg-79
	for submit <at> debbugs.gnu.org; Mon, 19 Jun 2017 08:50:12 -0400
Received: from mail-lf0-f41.google.com ([209.85.215.41]:36439)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1dMw8A-0007tT-G6
 for 27397 <at> debbugs.gnu.org; Mon, 19 Jun 2017 08:50:10 -0400
Received: by mail-lf0-f41.google.com with SMTP id o83so54864461lff.3
 for <27397 <at> debbugs.gnu.org>; Mon, 19 Jun 2017 05:50:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=McpB80RdzFhBmF5zcMUv2dilFM/mr346LDMzl/m6P8s=;
 b=JtVrrHBPLFI9PMMVshf/KJUEKlJ+/UBXbXqzrysOkUYvOSIZfB4JH3gbulfTzoG1qP
 8/5jCoXaubVABPZ0YrctnebVTjdBZMAe3EmV5pFIx9jr5W0lhQIAb1fsvJz1sOlS/quU
 L0053Kh8V6tkneduBHcfjnzxhuze44+APtPiml1DPZ/Fpxwp2Mf+aGpjS24Jm11QAGuN
 R6AtXsyBCJpYMA2Y/yV0AfDo5h+N0d356euGB2IR6IfpQTCJfuVIIq6LsK8LIUVPPLns
 MQVtm7iaezVAFUYJYHrmQlf5t1Z/xpnASoHbBXMHtMmKjxBHQBJ4y0j60acVKBOlq69e
 PZ7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=McpB80RdzFhBmF5zcMUv2dilFM/mr346LDMzl/m6P8s=;
 b=kerJ7An0mXn35TtU+NNrkaczmn/0ZewoBONEVkBYs3fgQn3fMlqXMLK+V+7pP/LwgJ
 JV4zq8hV2e9qmsxMyWG0rBlqMUEMlJ1qmiMC381B192+Bx1p/hcINbbn9WDjhRv7qrvo
 YNOqmg7In+phW4YD6TCSUo8bZOEJoVhWONkXHffz3KyS/SEFV4HlQD5y3X85w/9iE2/R
 wGwhCKQO500FnkKNIHq9jWMTXrQyzpuHVv2Zs+QQ0+NxBDKAPu/LS/fkzh+/cbBycFVO
 //Y/jSktOjOiC4EQqCx/+SXCM4s6YKSH06ms2iBH2+C7ZQPyNTIbNtYuClgBwKZdqyQF
 +f8A==
X-Gm-Message-State: AKS2vOzdTNYaO1GaB7c5M2+M8CnJJ1lad7PymqQAfOfUG09V1uNZsYDT
 dyHD1sYB5x962n+XZZk=
X-Received: by 10.80.176.3 with SMTP id i3mr17241124edd.65.1497876603740;
 Mon, 19 Jun 2017 05:50:03 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.193])
 by smtp.googlemail.com with ESMTPSA id c23sm4714727edc.34.2017.06.19.05.50.01
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 19 Jun 2017 05:50:02 -0700 (PDT)
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Michael Albinus <michael.albinus@HIDDEN>,
 Phil Sainty <psainty@HIDDEN>
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN> <8760fs5sjw.fsf@detlef>
 <aa357d58-a309-d648-c3f0-47d8cd833581@HIDDEN> <871sqg5mig.fsf@detlef>
 <6282010c-b2ec-ebca-35b7-a382b30ea3f0@HIDDEN> <87poe0i3mw.fsf@detlef>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <fdf5533c-f6ef-1ff4-f8f0-9cd2a9e21dd1@HIDDEN>
Date: Mon, 19 Jun 2017 15:50:00 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101
 Thunderbird/54.0
MIME-Version: 1.0
In-Reply-To: <87poe0i3mw.fsf@detlef>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
Cc: 27397 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 6/19/17 3:05 PM, Michael Albinus wrote:

> So we shall parse indead every function for the library it belongs to. It
> shouldn't be too hard, based on `autoloadp', `find-lisp-object-file-name'
> and friends, see the implementation in `describe-function-1'. Something
> like this is a very rudimentary implementation:

I'm not sure I understand. This find the library to which a function 
belongs. How do we find the file corresponding to a package name this way?

This question aside, I'm not sure we'll always want to ignore "tramp-sh" 
when tracing "tramp". IOW, that this will be every user's preference.

For instance, someone might try to trace-package "cedet", and expect 
every function belonging to CEDET to be traced, subpackages and all.

And likewise for multi-file ELPA packages. In that case, it's understood 
that a "package" can be spread over several files.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 19 Jun 2017 12:24:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 19 08:24:48 2017
Received: from localhost ([127.0.0.1]:55720 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMvjc-0007KL-2R
	for submit <at> debbugs.gnu.org; Mon, 19 Jun 2017 08:24:48 -0400
Received: from smtp-1.orcon.net.nz ([60.234.4.34]:48435)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1dMvja-0007K9-Jm
 for 27397 <at> debbugs.gnu.org; Mon, 19 Jun 2017 08:24:46 -0400
Received: from [150.107.172.99] (port=44392 helo=[192.168.20.102])
 by smtp-1.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>)
 id 1dMvjT-0008W2-Ce; Tue, 20 Jun 2017 00:24:39 +1200
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Dmitry Gutov <dgutov@HIDDEN>, Michael Albinus <michael.albinus@HIDDEN>
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN> <8760fs5sjw.fsf@detlef>
 <aa357d58-a309-d648-c3f0-47d8cd833581@HIDDEN> <871sqg5mig.fsf@detlef>
 <25ce7f3c-6f70-82f1-b3fb-7dd7362bbdf2@HIDDEN> <87r2ygi4yx.fsf@detlef>
 <948396af-2457-8e15-9523-ac1937c449c4@HIDDEN>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <b7591d3d-35dc-9a12-1951-83f45768877e@HIDDEN>
Date: Tue, 20 Jun 2017 00:24:38 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <948396af-2457-8e15-9523-ac1937c449c4@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-GeoIP: NZ
X-Spam_score: -1.0
X-Spam_score_int: -9
X-Spam_bar: -
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
Cc: 27397 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 20/06/17 00:04, Dmitry Gutov wrote:
> Because we risk stopping now for a while and having two inconsistent
> functions in Emacs. It also adds a burden to the contributor who might
> now have signed up for tackling this particular challenge.
> 
> There will also be some nuances to work out, I'm sure.

I'm open to exploring such enhancements.  If it looks like a can of
worms, I'll be voting to split them out into a separate issue :) but
let's keep the discussion going for now.  At minimum we can figure
out what an ideal end result ought to look like, and it might affect
the names we choose in the interim.


-Phil





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 19 Jun 2017 12:17:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 19 08:17:50 2017
Received: from localhost ([127.0.0.1]:55716 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMvcs-0007AV-B8
	for submit <at> debbugs.gnu.org; Mon, 19 Jun 2017 08:17:50 -0400
Received: from smtp-1.orcon.net.nz ([60.234.4.34]:41221)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1dMvcp-0007AH-T2
 for 27397 <at> debbugs.gnu.org; Mon, 19 Jun 2017 08:17:48 -0400
Received: from [150.107.172.99] (port=45528 helo=[192.168.20.102])
 by smtp-1.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>)
 id 1dMvch-0007nm-33; Tue, 20 Jun 2017 00:17:39 +1200
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Michael Albinus <michael.albinus@HIDDEN>
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN> <8760fs5sjw.fsf@detlef>
 <aa357d58-a309-d648-c3f0-47d8cd833581@HIDDEN> <871sqg5mig.fsf@detlef>
 <6282010c-b2ec-ebca-35b7-a382b30ea3f0@HIDDEN> <87poe0i3mw.fsf@detlef>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <addbcdde-d1b3-0850-eee6-ae7693f9d35b@HIDDEN>
Date: Tue, 20 Jun 2017 00:17:38 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <87poe0i3mw.fsf@detlef>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-GeoIP: NZ
X-Spam_score: -1.0
X-Spam_score_int: -9
X-Spam_bar: -
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
Cc: 27397 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 20/06/17 00:05, Michael Albinus wrote:
> So we shall parse indead every function for the library it belongs to. It
> shouldn't be too hard, based on `autoloadp', `find-lisp-object-file-name'
> and friends, see the implementation in `describe-function-1'. Something
> like this is a very rudimentary implementation:
> 
> (defun my-find-library (fun)
>   "Find library FUN is defined in.
> In case of subroutines, return t"
>   (when (fboundp fun)
>     (let ((def (symbol-function fun)))
>       (cond
>        ((autoloadp def) (cadr def))
>        ((subrp def) t)
>        (t (file-name-base (find-lisp-object-file-name fun nil)))))))

Meanwhile I was experimenting with load-history along these lines:

(require 'seq)
(defun trace-library (library)
  "Trace functions defined by LIBRARY."
  (mapcar 'trace-function-background
          (mapcar 'cdr (seq-filter
                        (lambda (x)
                          (and (consp x) (eq (car x) 'defun)))
                        (load-history-filename-element
                         (load-history-regexp library))))))





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 19 Jun 2017 12:09:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 19 08:09:07 2017
Received: from localhost ([127.0.0.1]:55707 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMvUR-0006xz-6b
	for submit <at> debbugs.gnu.org; Mon, 19 Jun 2017 08:09:07 -0400
Received: from mout.gmx.net ([212.227.17.21]:65030)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>) id 1dMvUP-0006xW-Jk
 for 27397 <at> debbugs.gnu.org; Mon, 19 Jun 2017 08:09:06 -0400
Received: from detlef.gmx.de ([212.86.44.161]) by mail.gmx.com (mrgmx101
 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MGnPx-1dZnex3Hnd-00DWzO; Mon, 19
 Jun 2017 14:08:54 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN>
 <8760fs5sjw.fsf@detlef>
 <aa357d58-a309-d648-c3f0-47d8cd833581@HIDDEN>
 <871sqg5mig.fsf@detlef>
 <25ce7f3c-6f70-82f1-b3fb-7dd7362bbdf2@HIDDEN>
 <87r2ygi4yx.fsf@detlef>
 <948396af-2457-8e15-9523-ac1937c449c4@HIDDEN>
Date: Mon, 19 Jun 2017 14:08:52 +0200
In-Reply-To: <948396af-2457-8e15-9523-ac1937c449c4@HIDDEN> (Dmitry Gutov's
 message of "Mon, 19 Jun 2017 15:04:51 +0300")
Message-ID: <87lgooi3hn.fsf@detlef>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:AGK49C7hWcKCVdrxl6jnbUBpmmaBhog/aaKqoYSTYk5VhQxsaI0
 U3YaCIw3XH4HuqdK8vUebc/6znYRps0gOa2xVExUwWSxVIoQ9TBogDB6tfsjs7xgCplWNuP
 PInJ3l6RHOa3KlRm1VGHaR/RcNvdUirys/CFIHUeeldBjNSXTYCd3VnVkBqWzTJJE9h/srJ
 WKgouDiWVAQ7VRUqdhr7w==
X-UI-Out-Filterresults: notjunk:1;V01:K0:ofejDQTCvDo=:m/UoL80Mv3zlOWs9mCBYQw
 EwSwVAuxz0SVbGKLft2hRcB94WKYQpqXRbwnHcdUOhivKM66CqyAYw4dbjRpfPGHEM9DglWm4
 E+Z9wv8LoSAWEhx1XT2x5yRlA/ScAHBbLgT/K0P9/MwxZbN+QBL5jBDdrtP/F6MzZjCsOC+OJ
 Yqnjl55LMcDAvDTPj/W/jqT7KGdjEIyQV/IvqjU+AW8b316SRcN4YgMxfVD6iiAutkEjtVyZz
 8klesJzWvhDZU3q0Hljzio3QSyjvAXA+3J1mwKenhm7OJRkc4gvsSakWAGUe5ZiDK7HxmC319
 2ZuV+EVcl3yp+YZ8d9KECpNvdUniIrE7t1Zu1N4lGBCJfAQyNutg6HNAl3VVAi0+noQrb3x1U
 dYpkeq76VuUkIxUJKIEEczgpCrPRt/o1L3MYvbjmmj/jiDLdRId8WZegNfk8ub8jRisc9Hvaf
 yRvrtaBXMLuJ5cCKWhgrATopnsozBDLqBztsCxrTmlfkD+nH9mCLeGY1s28uvSxPMQqQ460xR
 Bn2rKmBs6jN9NPb45l8MIXN5ZzPFRh2vMy6DIIG+ay99Iy0Y02dgYPGmWwEx7IPzSc/RR2UCQ
 cmAYfSqtexYmGb7eNZmpAvcNe7T0jv748hhHjEVaBz+iOmH5e8mMmsRG3OMyCAbq+fSEPTlbJ
 wtBy+sF+TItQ1iPnvnHBYv7oLlsSefkA2BG4eKwwhANtLYGF5cMd2VK52oRi6bVtHmWLmKTh7
 KRo+tNbegGotRuzb6sorR5gzrPfpo3GZSZCmYf9jM24yDqaeUtVPz6Q3t5EKHRMxoI7WwTiop
 Eo9VFG+
X-Spam-Score: -1.0 (-)
X-Debbugs-Envelope-To: 27397
Cc: Phil Sainty <psainty@HIDDEN>, 27397 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Dmitry Gutov <dgutov@HIDDEN> writes:

> On 6/19/17 2:36 PM, Michael Albinus wrote:
>
>>> (with-eval-after-load 'tramp
>>>    (trace-package "tramp-"))
>>
>> But this would also trace functions from tramp-sh.el, which I don't want.
>
> What would be the equivalent of your proposal, then?

See my other message.

>>> If we do what you suggest, it should be a new discussion, and it
>>> should improve elp-instrument-package as well.
>>
>> I don't believe it will be too hard to implement; why not doing it just
>> now?
>
> Because we risk stopping now for a while and having two inconsistent
> functions in Emacs. It also adds a burden to the contributor who might
> now have signed up for tackling this particular challenge.
>
> There will also be some nuances to work out, I'm sure.

It's up to Phil to decide what will be implemented. But as a power user
of trace.el, I thought I bring my experience on table.

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 19 Jun 2017 12:05:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 19 08:05:57 2017
Received: from localhost ([127.0.0.1]:55698 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMvRN-0006t3-F9
	for submit <at> debbugs.gnu.org; Mon, 19 Jun 2017 08:05:57 -0400
Received: from mout.gmx.net ([212.227.17.21]:52252)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>) id 1dMvRL-0006so-Do
 for 27397 <at> debbugs.gnu.org; Mon, 19 Jun 2017 08:05:56 -0400
Received: from detlef.gmx.de ([212.86.44.161]) by mail.gmx.com (mrgmx102
 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Mhej1-1d8x5P3CoV-00MsA0; Mon, 19
 Jun 2017 14:05:44 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Phil Sainty <psainty@HIDDEN>
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN>
 <8760fs5sjw.fsf@detlef>
 <aa357d58-a309-d648-c3f0-47d8cd833581@HIDDEN>
 <871sqg5mig.fsf@detlef>
 <6282010c-b2ec-ebca-35b7-a382b30ea3f0@HIDDEN>
Date: Mon, 19 Jun 2017 14:05:43 +0200
In-Reply-To: <6282010c-b2ec-ebca-35b7-a382b30ea3f0@HIDDEN> (Phil
 Sainty's message of "Mon, 19 Jun 2017 23:00:07 +1200")
Message-ID: <87poe0i3mw.fsf@detlef>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:WUDi0OEqwVw4m5WZlw+O4W8k2xAudihOczQPpnOUMkurL9Tt40I
 NbuqDG8yKyC/OiRk0D91svFirxwclQnzaypQUB65awrvo0FE0W1fg6uh0RP5oxsmldxV42b
 +oaxzxBSa93xrGmYbPL3wQfahWGu3NumLM8sB89hk0nzlkraygcxSZVYMMXF/jlPY/gH0Y/
 9/OcqXzOphCEtstJQnLqw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:mVuWmZ6vXA0=:qTVBvtlRC8ljiyhKELAVe2
 JHMYQIqsWrCQBugM9Ee2mxzu+Nx/o7kPJsm+BX79oH15nEE/SvBV46EWS1cUKaMiwpg4xMB4H
 gKKmNI+eOlp9pOxwNuYMSPMGNwTCokb6kVUcEbhFj8X0pjmp1XkY/D8QiQQjxa3LgdDmLr4KW
 R6obNmZmtCicFfQxEF/cqGmAaKOw6AcqsDviKnhpqIs/wfcT6M1Pf7Rl0yBEUdXfWNt6TYljG
 v2bl7UY+pcc8wT2utoTZpkcdnIxIW1bsx0OHZ24g4nbjPAkmeLiY72JsxMJ9tPBXVXma2Syj5
 kfVMq4ld0EbQRVnD6XLybfi1LXIr5RqBjrffAWq/Spdrx2nT0/bizDXPIa+xQLe44KiP2/Y8o
 y0MayJGFtwG66iI0WQzci2zW0C3kFHHgo7Se+Z0svjjRvKc2bEUSfw+WUxnxjra2XNmfBdY8n
 ypoIjeK3+Gu1B3DT1810V3LJlJ5QxwUXkLzjmbqGFf9a8getmrqqDYzocZk41aH4OvmPJsdbT
 FB4+uQuXOIKl7rxpPvU9x9dxmwy3nDYnnZoJg5H5W4qYq1BgxOYZHmeP4Ig0+0qdd1gPai1Ld
 sIq2LqwjawW+5i02QhVi5tx6u9hG8Atfpk/d4y3S8CsBa/5Wpd7FHwxAF3sMd+Xm1vo94WX2F
 eDI78v8vc/BLdgwPUhIR9vlOWFAFycT726F3mbA0EoNy4+0aA37z3OoSZeH79PMax+RXouYGq
 zBKf85OqsZ4c4HQG7oRVs3g54X3u6dJMAuJi/8L9L3AvguadClk9UD5N97EJihMuRL8bDd2sE
 osPHMYq
X-Spam-Score: -1.0 (-)
X-Debbugs-Envelope-To: 27397
Cc: 27397 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Phil Sainty <psainty@HIDDEN> writes:

> I think `trace-library' would be the appropriate name?

As usual, I don't care too much about function names :-)

> Of course we can't guarantee that library foo.el adheres to a foo-*
> naming scheme for all its functions (or that other libraries don't
> define any foo-* functions). Would we just ignore this and trace
> everything starting with foo- on the assumption that this is good
> enough? Or would we parse the library in order to trace that library's
> functions precisely?

We cannot assume that library 'foo prefixes all its functions with
"foo-". Even Tramp libraries have functions which do not fit this
scheme, for historical reasons.

So we shall parse indead every function for the library it belongs to. It
shouldn't be too hard, based on `autoloadp', `find-lisp-object-file-name'
and friends, see the implementation in `describe-function-1'. Something
like this is a very rudimentary implementation:

(defun my-find-library (fun)
  "Find library FUN is defined in.
In case of subroutines, return t"
  (when (fboundp fun)
    (let ((def (symbol-function fun)))
      (cond
       ((autoloadp def) (cadr def))
       ((subrp def) t)
       (t (file-name-base (find-lisp-object-file-name fun nil)))))))

> -Phil

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 19 Jun 2017 12:05:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 19 08:05:02 2017
Received: from localhost ([127.0.0.1]:55694 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMvQU-0006rp-3M
	for submit <at> debbugs.gnu.org; Mon, 19 Jun 2017 08:05:02 -0400
Received: from mail-lf0-f47.google.com ([209.85.215.47]:33618)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1dMvQS-0006rJ-Gu
 for 27397 <at> debbugs.gnu.org; Mon, 19 Jun 2017 08:05:00 -0400
Received: by mail-lf0-f47.google.com with SMTP id m77so53969219lfe.0
 for <27397 <at> debbugs.gnu.org>; Mon, 19 Jun 2017 05:05:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=RpZagNUra9dLMqmeGaT/0/jstsYFvbTmrY1mRp19IoM=;
 b=GJSqCBrc5ouswvmiIs2HDNNsD3x0pkn/XLuRRypvkc4PjkQk7RjmIW0P7jhXVolZ3+
 5S24QERRfyiaqp2ry7tUsU+QAGA52p8oIJYJBGE9huyzzxU/PzvUAdHEoz8Zn+hdbRyb
 yeEcQejxxjw6iUGfPtwr425TqTY0lwP9hhsiUVyFARnj7bn1k0Y7DQVYcoy5wGgwjEE2
 WpSKCsphwpc3pFd2nerNFLMloHXFSxqHDj4S8iB9y9huaLcWRlUrhyxKD1ENP0EM1/Wy
 pXBsQEWRGscGoGLK2pVFqqp8NoONlv4pIJ9Dqo/exWv/uammBKTk39ETPEuXdfprbdtR
 pyFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=RpZagNUra9dLMqmeGaT/0/jstsYFvbTmrY1mRp19IoM=;
 b=eTjxRaIgbDDAGKtlXUpYaYzVDBf6ovf1mKq4j94P1mhYwVofacuC9nb0UuUke1dNpO
 OvTbtNZjNKjHkO+kvBy5CBUchoDEOYLWDz1mUwW+R8n5WBQDSKgtlXAMb/B3cWxMBa9M
 tgz+YiFcAipFE/ut69i14uObyFOjzOmmITYYz/wDyOhsGoe2p6kfU3xETiL4plXAXmdd
 Me+kdVHUBwxvXy4Cp8KNJvqFoWleUwefFvdFWw33UrqjVCZCu6C+1e1k87wNqZpMDstn
 w2IWpABYYRO+ZT6l7HcH9YJsbJceOQETJ9RebOoLda6sWXCrt6SPay4xrzSk1GXmVxpf
 gJzw==
X-Gm-Message-State: AKS2vOxn2lTdmyxWVbzLMMgQyrK279/0stOhrIRr+SdXL6WAEuIPVIJp
 BY8VRDj0WsmmhdqkOwE=
X-Received: by 10.80.168.102 with SMTP id j93mr17265372edc.32.1497873894419;
 Mon, 19 Jun 2017 05:04:54 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.193])
 by smtp.googlemail.com with ESMTPSA id k17sm5799394eda.24.2017.06.19.05.04.52
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 19 Jun 2017 05:04:53 -0700 (PDT)
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Michael Albinus <michael.albinus@HIDDEN>
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN> <8760fs5sjw.fsf@detlef>
 <aa357d58-a309-d648-c3f0-47d8cd833581@HIDDEN> <871sqg5mig.fsf@detlef>
 <25ce7f3c-6f70-82f1-b3fb-7dd7362bbdf2@HIDDEN> <87r2ygi4yx.fsf@detlef>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <948396af-2457-8e15-9523-ac1937c449c4@HIDDEN>
Date: Mon, 19 Jun 2017 15:04:51 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101
 Thunderbird/54.0
MIME-Version: 1.0
In-Reply-To: <87r2ygi4yx.fsf@detlef>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
Cc: Phil Sainty <psainty@HIDDEN>, 27397 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 6/19/17 2:36 PM, Michael Albinus wrote:

>> (with-eval-after-load 'tramp
>>    (trace-package "tramp-"))
> 
> But this would also trace functions from tramp-sh.el, which I don't want.

What would be the equivalent of your proposal, then?

>> If we do what you suggest, it should be a new discussion, and it
>> should improve elp-instrument-package as well.
> 
> I don't believe it will be too hard to implement; why not doing it just
> now?

Because we risk stopping now for a while and having two inconsistent 
functions in Emacs. It also adds a burden to the contributor who might 
now have signed up for tackling this particular challenge.

There will also be some nuances to work out, I'm sure.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 19 Jun 2017 11:37:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 19 07:37:09 2017
Received: from localhost ([127.0.0.1]:55679 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMuzV-0006FI-Kr
	for submit <at> debbugs.gnu.org; Mon, 19 Jun 2017 07:37:09 -0400
Received: from mout.gmx.net ([212.227.15.18]:52286)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>) id 1dMuzT-0006Ev-Dd
 for 27397 <at> debbugs.gnu.org; Mon, 19 Jun 2017 07:37:08 -0400
Received: from detlef.gmx.de ([212.86.44.161]) by mail.gmx.com (mrgmx003
 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M1W5x-1dgNgM3qnp-00tPuG; Mon, 19
 Jun 2017 13:36:56 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN>
 <8760fs5sjw.fsf@detlef>
 <aa357d58-a309-d648-c3f0-47d8cd833581@HIDDEN>
 <871sqg5mig.fsf@detlef>
 <25ce7f3c-6f70-82f1-b3fb-7dd7362bbdf2@HIDDEN>
Date: Mon, 19 Jun 2017 13:36:54 +0200
In-Reply-To: <25ce7f3c-6f70-82f1-b3fb-7dd7362bbdf2@HIDDEN> (Dmitry Gutov's
 message of "Mon, 19 Jun 2017 14:27:43 +0300")
Message-ID: <87r2ygi4yx.fsf@detlef>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:4VyulacK6KvuBpvZ6XDL2Ku5vYV4UEHmOtk3G0t7w+LG3lkR6EX
 /u47Hx8jSupXCssjKg0sbjj6vbkuBGSsXHpcenBE08i+DTdxVMVAzLhvF/ogrRnKTE0M+OW
 2ZUeIdBCJs9aafrskAok4y6z/2sq8uTwl1DA/cPmVNoGasavDeqsc4w/dqlrUgrVp9n3rrY
 tVU3aKANJCd52xQ3iEmSg==
X-UI-Out-Filterresults: notjunk:1;V01:K0:Pzg2BDOkZGI=:+j4DLnIlzanZiMKke2ElQt
 +6MW1+9lHuY4NL0UdDotKo87tN0GZfNo58GE5XDxGTDXmWTa3xiGxmUARTjKzT+kAgqbKaI/d
 w0hI3VP9awnUOTJGme5nJRF2bRcJmymzIMAq3Mbc2diCRn5othFaBPv+frpzywniAKjzvkvg3
 DJim0OI9ZqjQh04T6d5WGcjbY+iuDX3YJPUAZNIPeORGlc7mQnECPZ7iSlzAlyYUR3BmUlUmb
 Zcr8skE9BYzl3GvKKboW27HBh3trmKRNw2is2Qy+09TqplvxDP2Gbagxr/9Eoj+O0gVfd1psk
 7jX5iZp6c2/dQhkS0PzGUArC5p+dKY+icXlC1p1VsqFWTAP3vpdfbpCNad3jOapLMts8BOF7C
 en494eT3aePXFXYzxMOoL1s9pEKnr3kT/rDrJdFfEz4edwe8iK9znY8H+J0ujDTpg2ywwROau
 M7pfVj13x5V0NP6ZM0hdXePLRoyglaZQ8mU8t8z27Ea9PteZpgutfNuqpGbY6DbfOpil/FkqB
 qgNxdDiYGxNC0lbhD/HnqyFTm57PJNNWKMqxNjKa/sSd7LgluyhlV+I2P8EoKokBc1JxjMFnh
 yUvxvpHzRuamTRSnCiYzhvHjq7tbSb4umjiyN6k0w1In0aYr/ZXJf7/BAqSI4X/uvzIm+U7dn
 KQ5cu87wFWbcVr7vsAms77pQrwSkuvzeZ2ZBUXr40geh3Dwozdhh1Jm0779YMuSSaunhL91Mh
 E6cy3OAXJ0KoIqw3U5iiIiYdesWmQ2JKhU0uA0mP7DWrAGnatiA6tqVaLvH0ajs2OXQHuY8o4
 8nPkewv
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 27397
Cc: Phil Sainty <psainty@HIDDEN>, 27397 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Dmitry Gutov <dgutov@HIDDEN> writes:

> Hi Michael,

Hi Dmitry,

> Your case is surely valid, but sounds a bit niche to me. It shouldn't
> be too hard to evaluate this, though:
>
> (with-eval-after-load 'tramp
>   (trace-package "tramp-"))

But this would also trace functions from tramp-sh.el, which I don't want.

>> Yes, that's the idea. If `trace-package' uses as argument a package name
>> as proposed above, the instrumentation shall happen in an
>> `eval-after-load' form for that package.
>
> Considering elp-instrument-package does not do that, I think we should
> limit the scope of the currently discussed patch, and trace only
> already loaded functions.
>
> If we do what you suggest, it should be a new discussion, and it
> should improve elp-instrument-package as well.

I don't believe it will be too hard to implement; why not doing it just
now?

Improving elp* could be a second step then.

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 19 Jun 2017 11:27:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 19 07:27:53 2017
Received: from localhost ([127.0.0.1]:55673 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMuqX-0004DL-OG
	for submit <at> debbugs.gnu.org; Mon, 19 Jun 2017 07:27:53 -0400
Received: from mail-wm0-f41.google.com ([74.125.82.41]:38284)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1dMuqW-0004D9-76
 for 27397 <at> debbugs.gnu.org; Mon, 19 Jun 2017 07:27:52 -0400
Received: by mail-wm0-f41.google.com with SMTP id u195so58801502wmd.1
 for <27397 <at> debbugs.gnu.org>; Mon, 19 Jun 2017 04:27:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=eqWym4DfOy0bShrrWvZWlBXQ4thQi4vpcI+0sMIjmeI=;
 b=naS65J4ZelGogAdGPAMtsF5SugeG3eEui4t6eDoFEREgxsFkTwUU9wRbw+nTpreZ+j
 dPaXMnwX5YrJco+1/rX7UE6aiZ2vix6HlEuigA/+cONDRY7bJMOi/Yi/ZX4+F5hnbRR0
 v4rqNTjSY6vIjq+1FbEnd+n3csEWyEbhYD4obJu//Yu4GgqRjCDbLjG7XOvtbLX7Q2qD
 Ju0WFe/GZZL6682hOoLOpk/+UsBJMqSI6SMqna1m1Lpi8gsxOBFYQqhn4BzLIb0J3BZ0
 WmBUB+HDnyBGmXoGtqJTvYHcs92bCpctYrFz7Kn93Ea0MFLZIJy/Fka6RmOkCdUwKiFh
 lC2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=eqWym4DfOy0bShrrWvZWlBXQ4thQi4vpcI+0sMIjmeI=;
 b=FuQgxfVNKzCMjXKIc4JAzGLEJ0rRyFApz26tgtU9emQJ9JL0iDQg6I8qSGs+lDtghh
 hp/bgoMFaRQJz0CuS58dJ1/Gs1bkbPYrsVOMzW7rfBXpqTmoA0k4AvxQ1R6emnRLYDXn
 oAcr88JbROznb+eDUlMbK88e/VK3aYbV5OHlGPNwE6vW2PV3wdFGE3F1Z7i008fPgMY8
 ryoKIVcEAlWn1X2IQXOdtJ4scYTLTueksx+KQ4nMiVRCC3DTDKCW21aMqN5P/wLMQKRy
 w9+qwViw7o1tX0Ss7oJv67RC7BXHRwfzhmVjJDgHZFgr99bWhU48ApyopOQwoZBdSJCs
 +8Dw==
X-Gm-Message-State: AKS2vOze4OUKEx68VAMU2gt9v6GulAn/yfvMmRS0+hHwcbJECh3NX9SH
 ozL9IOnSX581dZvEGW8=
X-Received: by 10.80.165.243 with SMTP id b48mr16652290edc.84.1497871666123;
 Mon, 19 Jun 2017 04:27:46 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.193])
 by smtp.googlemail.com with ESMTPSA id j2sm4291530edh.60.2017.06.19.04.27.44
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 19 Jun 2017 04:27:45 -0700 (PDT)
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Michael Albinus <michael.albinus@HIDDEN>,
 Phil Sainty <psainty@HIDDEN>
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN> <8760fs5sjw.fsf@detlef>
 <aa357d58-a309-d648-c3f0-47d8cd833581@HIDDEN> <871sqg5mig.fsf@detlef>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <25ce7f3c-6f70-82f1-b3fb-7dd7362bbdf2@HIDDEN>
Date: Mon, 19 Jun 2017 14:27:43 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101
 Thunderbird/54.0
MIME-Version: 1.0
In-Reply-To: <871sqg5mig.fsf@detlef>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
Cc: 27397 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Hi Michael,

On 6/19/17 12:56 PM, Michael Albinus wrote:
> That's not what I want. Often, I hunt bugs related to the order of
> autoloaded functions, and this order shall be kept also when tracing.

Your case is surely valid, but sounds a bit niche to me. It shouldn't be 
too hard to evaluate this, though:

(with-eval-after-load 'tramp
   (trace-package "tramp-"))

And the current patch makes it easier.

>> Perhaps you're actually be suggesting some kind of `eval-after-load'
>> tracing behaviour, though?
> 
> Yes, that's the idea. If `trace-package' uses as argument a package name
> as proposed above, the instrumentation shall happen in an
> `eval-after-load' form for that package.

Considering elp-instrument-package does not do that, I think we should 
limit the scope of the currently discussed patch, and trace only already 
loaded functions.

If we do what you suggest, it should be a new discussion, and it should 
improve elp-instrument-package as well.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 19 Jun 2017 11:00:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 19 07:00:21 2017
Received: from localhost ([127.0.0.1]:55654 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMuPs-0003Z3-CD
	for submit <at> debbugs.gnu.org; Mon, 19 Jun 2017 07:00:21 -0400
Received: from smtp-1.orcon.net.nz ([60.234.4.34]:56309)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1dMuPp-0003Yp-NL
 for 27397 <at> debbugs.gnu.org; Mon, 19 Jun 2017 07:00:19 -0400
Received: from [150.107.172.99] (port=65482 helo=[192.168.20.102])
 by smtp-1.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>)
 id 1dMuPf-000111-I1; Mon, 19 Jun 2017 23:00:07 +1200
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Michael Albinus <michael.albinus@HIDDEN>
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN> <8760fs5sjw.fsf@detlef>
 <aa357d58-a309-d648-c3f0-47d8cd833581@HIDDEN> <871sqg5mig.fsf@detlef>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <6282010c-b2ec-ebca-35b7-a382b30ea3f0@HIDDEN>
Date: Mon, 19 Jun 2017 23:00:07 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <871sqg5mig.fsf@detlef>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-GeoIP: NZ
X-Spam_score: -1.0
X-Spam_score_int: -9
X-Spam_bar: -
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
Cc: 27397 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 19/06/17 21:56, Michael Albinus wrote:
> Ahh, my error. I thought that `trace-package' takes a package name
> (or symbol), and traces only all functions which have been loaded by
> this package.

I concede that the name may cause some confusion, but I chose it
for consistency with `elp-instrument-package' which uses the same
function-name-prefix meaning, so the name makes sense from that
perspective. Obviously ELP pre-dates package.el. YMMV.

Maybe `elp-instrument-package' and `trace-package' should become
`elp-instrument-prefix' and `trace-prefix' ? (I'm not against that
idea.)


>> some kind of `eval-after-load' tracing behaviour
>
> Yes, that's the idea. If `trace-package' uses as argument a package
> name as proposed above, the instrumentation shall happen in an
> `eval-after-load' form for that package.

I think `trace-library' would be the appropriate name?

(If `trace-package' were about ELPA packages, then we have multi-file
packages to consider, which expands the scope further.)

Of course we can't guarantee that library foo.el adheres to a foo-*
naming scheme for all its functions (or that other libraries don't
define any foo-* functions). Would we just ignore this and trace
everything starting with foo- on the assumption that this is good
enough? Or would we parse the library in order to trace that library's
functions precisely?


> `trace-regexp', on the other hand, shall instrument the functions in
> a form added to `after-load-functions', additonally to the functions
> already loaded.

Which could also apply to (the current meaning of) `trace-package'.

I suppose this could potentially be an additional y-or-n-p prompt for
the extended interactive argument input (after BUFFER and CONTEXT)
when using a prefix arg.

I think that the equivalent `untrace-*' commands would need to remove
such `after-load-functions' entries by default, but perhaps a prefix
argument to those would allow users to choose.

I can see potential for users to end up with unwanted remnant entries
in after-load-functions (e.g. trace-regexp "A\\|B", then untrace-regexp
"A" and "B" separately), so I think there could be some fiddly aspects
to all of this; although one could argue that anyone using these
features in the first place is likely to know what they're doing, and
would be able to cope with such situations easily enough; especially
if `untrace-all' takes care of the after-load cases.


-Phil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 19 Jun 2017 09:56:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 19 05:56:37 2017
Received: from localhost ([127.0.0.1]:55629 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMtQD-00023v-1v
	for submit <at> debbugs.gnu.org; Mon, 19 Jun 2017 05:56:37 -0400
Received: from mout.gmx.net ([212.227.15.15]:61301)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>) id 1dMtQB-00023h-VZ
 for 27397 <at> debbugs.gnu.org; Mon, 19 Jun 2017 05:56:36 -0400
Received: from detlef.gmx.de ([212.86.44.161]) by mail.gmx.com (mrgmx002
 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MS5Dm-1dFprf1xhS-00TFqP; Mon, 19
 Jun 2017 11:56:25 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Phil Sainty <psainty@HIDDEN>
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN>
 <8760fs5sjw.fsf@detlef>
 <aa357d58-a309-d648-c3f0-47d8cd833581@HIDDEN>
Date: Mon, 19 Jun 2017 11:56:23 +0200
In-Reply-To: <aa357d58-a309-d648-c3f0-47d8cd833581@HIDDEN> (Phil
 Sainty's message of "Mon, 19 Jun 2017 21:35:11 +1200")
Message-ID: <871sqg5mig.fsf@detlef>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:tsGD5pfluA1VyMIn4wrWJ3QyCSvek+bNqtO8aZtP0Tsvuj3NEH3
 S1xxZSqolyIsDWhGre+xhoW0yigvorInq1fRn/ddu4mT7isJkV/rYuznucFP3/BtUREiOE1
 MzCZ96Uq3t+f4cIhkDHM1OcztX8FTsGkm0SWbdjkooQfXHFwWc7ni3D72HVifGxkqY4iu29
 sHofER6w39nEHLCPlFy+w==
X-UI-Out-Filterresults: notjunk:1;V01:K0:lz44Xuta9vc=:OHTlQ1gZs4ah+9aNZDEuj8
 3/SOK5fO69tXI2PnH+ORcFlYMm9Zf4gneRkpbPQkur04+pDuSKjx8hMBtTQxgheTzWUgNM5mi
 qvpm+uXnDpvWHgYCfw5Oi3p5QAlJN7X41rcgNQPkpVdL0MYihJyBzJeaefli9XC9B6hZIOkbv
 QdWEr1xvfrK5+/IbzWHHNRTPWDEBGBoGAr6p6Wknctecj4JihAbYrqg3oHh6ukELQhqePyfpb
 YRhADSjnpeDBuzcOmYQtcN3VtUXCG4IZohbSUkKHfve2KhEcHm42OBK22pH85M5ieqNVZAmqk
 PkyBETVdM/ujTzeHJW6krlX2qm2Akrk1UKKm8z9CdB/uyfg2C1Jx5FWEL0NnD8lnnhhuwWbKr
 wMNwGHtSoTV0NmkKMP6AAKDVtFiLXQ/BWgX8Un+WOVVc+ecd94JSiw2U64++vwjDvYgXsMTky
 uj0M97xDmoqAdybfe9rst2NWpgHCwhVw1p+3E0lP6YL6jiQ9DaA+eMDVTUoPr/JyeqQU4QPWI
 Banl6q2RhGd+AI6d/zlWGqn+L4CHWX4m8IxR1P4TXKlg1yYAsnXNKgtqm8KXuaFmithgZZkOz
 ZV8hC3MBVD8sKq8gArZNpqIj0vODHpIm613BFwLoYeYF+LycGdOfL/G2NS+ctBsQaG21cq6Zb
 yh3XwWygvDEL3vFke/wCw55QMuyxMfHwcYBJPfuD+CgMFjEa73qd6Q778bDhDrX0XkfphvTJd
 Zy96/CSREuMqHnvMF8p+qLL3+ZscEtplJmMWwaVsoojxfjCMJ7R4q5Xq9M89sHCyHsRsp4JSI
 Li7MmSF
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 27397
Cc: 27397 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Phil Sainty <psainty@HIDDEN> writes:

Hi Phil,

>> There's no package "tramp-". Better would be
>>
>>         (trace-regexp "^tramp-")
>
> To be clear, the two are functionally equivalent; but if you'd prefer
> it written that way then I'm happy to make that change.

Ahh, my error. I thought that `trace-package' takes a package name (or
symbol), and traces only all functions which have been loaded by this
package. (trace-package 'tramp) would then trace the function
`tramp-file-name-handler (defined in tramp.el) , but not the function
`tramp-sh-file-name-handler'. The latter one is defined in tramp-sh.el.

> With respect to the manual entry being discussed here, we could
> trivially show code to `require' all of the tramp-* libraries prior
> to calling trace-package or trace-regexp. e.g.:
>
> (mapc 'require '(tramp tramp-adb tramp-cache tramp-cmds
>                        tramp-compat tramp-ftp tramp-gvfs tramp-sh
>                        tramp-smb tramp-uu trampver))
>
> (or else something which automatically locates library names starting
> with "tramp-" and loads them all).

That's not what I want. Often, I hunt bugs related to the order of
autoloaded functions, and this order shall be kept also when tracing.

> Perhaps you're actually be suggesting some kind of `eval-after-load'
> tracing behaviour, though?

Yes, that's the idea. If `trace-package' uses as argument a package name
as proposed above, the instrumentation shall happen in an
`eval-after-load' form for that package.

`trace-regexp', on the other hand, shall instrument the functions in a
form added to `after-load-functions', additonally to the functions
already loaded.

> -Phil

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 19 Jun 2017 09:35:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 19 05:35:22 2017
Received: from localhost ([127.0.0.1]:55622 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMt5e-0001Xo-7f
	for submit <at> debbugs.gnu.org; Mon, 19 Jun 2017 05:35:22 -0400
Received: from smtp-3.orcon.net.nz ([60.234.4.44]:42318)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1dMt5c-0001Xa-5K
 for 27397 <at> debbugs.gnu.org; Mon, 19 Jun 2017 05:35:20 -0400
Received: from [150.107.172.99] (port=11950 helo=[192.168.20.102])
 by smtp-3.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>)
 id 1dMt5U-0005m6-BW; Mon, 19 Jun 2017 21:35:12 +1200
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Michael Albinus <michael.albinus@HIDDEN>
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN> <8760fs5sjw.fsf@detlef>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <aa357d58-a309-d648-c3f0-47d8cd833581@HIDDEN>
Date: Mon, 19 Jun 2017 21:35:11 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <8760fs5sjw.fsf@detlef>
Content-Type: text/plain; charset=utf-8
Content-Language: en-GB
Content-Transfer-Encoding: 7bit
X-GeoIP: NZ
X-Spam_score: -1.0
X-Spam_score_int: -9
X-Spam_bar: -
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
Cc: 27397 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 19/06/17 19:45, Michael Albinus wrote:
>>      (trace-package "tramp-")
>
> There's no package "tramp-". Better would be
>
>         (trace-regexp "^tramp-")

To be clear, the two are functionally equivalent; but if you'd prefer
it written that way then I'm happy to make that change.


> One problem I'm always faced with Tramp are autoloaded functions.
> The code as given in the Tramp manual instruments only functions
> which are either already loaded, or which are marked as to be
> autoloaded. Functions from a Tramp package, which are loaded later
> on, are not handled.
>
> Could you add this functionality?

I'm not certain what you're asking here.

With respect to the manual entry being discussed here, we could
trivially show code to `require' all of the tramp-* libraries prior
to calling trace-package or trace-regexp. e.g.:

(mapc 'require '(tramp tramp-adb tramp-cache tramp-cmds
                       tramp-compat tramp-ftp tramp-gvfs tramp-sh
                       tramp-smb tramp-uu trampver))

(or else something which automatically locates library names starting
with "tramp-" and loads them all).

Perhaps you're actually be suggesting some kind of `eval-after-load'
tracing behaviour, though?


-Phil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 19 Jun 2017 07:46:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 19 03:46:11 2017
Received: from localhost ([127.0.0.1]:55583 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMrNz-0007Nt-Fy
	for submit <at> debbugs.gnu.org; Mon, 19 Jun 2017 03:46:11 -0400
Received: from mout.gmx.net ([212.227.17.22]:60829)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>) id 1dMrNx-0007Nc-5s
 for 27397 <at> debbugs.gnu.org; Mon, 19 Jun 2017 03:46:09 -0400
Received: from detlef.gmx.de ([212.86.44.161]) by mail.gmx.com (mrgmx102
 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MUCTO-1dDcFr0oEs-00Qyi2; Mon, 19
 Jun 2017 09:45:57 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Phil Sainty <psainty@HIDDEN>
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN>
Date: Mon, 19 Jun 2017 09:45:55 +0200
In-Reply-To: <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN> (Phil
 Sainty's message of "Sat, 17 Jun 2017 20:43:00 +1200")
Message-ID: <8760fs5sjw.fsf@detlef>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:pDTPoZ47dPmkcwkDVhs68bNFamXTbfp3aVM4AtM+6mWQcafd/jh
 7mpsUer3ShYkNNnx51MQei0d85IhmTL4s5oCNbiZFlEjom7ltxbhQz/3wexwLJlO3MTngFH
 tCgZY/pwCsdkb6klYuB6ieSQhpiBVuaafbNJ9kUn45ECyEhFyuHRFWx58MdQzRZjrkS2GJx
 cz/1asMCTx9iOoQBm4wIA==
X-UI-Out-Filterresults: notjunk:1;V01:K0:mVCjV3rjcUY=:UAZh8JEsc+iEevgFAOin/d
 npx+xuvU1GxbDyQa2zVyN/CCVtuYiMiCbnxTYUjS2YcflBVyATNws3mURbDNZZjULNGst/1t9
 Rp4lcnq6uSPpA/B477aumGt4bzQvClCJG43RWhQsVYLXxitjSxqN+BP28sqn5fCXffAlDp79w
 jf5J+ZCpTIZFV1uONEy3lVcb73NwDhHM4N0ahnBK/oMdfZsZye2hqVlWj2HBEcrFxQ6reTcuu
 KUDlie4hKIzIOPpg9v+WV4UcqJsRI3a03SH1m7GlA65Jpw9rth5BLgWKZ0FdeUF7jEdTNFN3V
 mrN0Op6Lr/AJ7frJ5z6u35Vz3fSk0w0ckxcb3d+2fQahfuAc4Pq8Pu1Y7CASQ1aJ2KE2UGccA
 HNA/JyNhht2zj1ypAPN8/T184x/c3SQ/CkFAFX8EBupVFzBqHzGwZqPBYGYt02+hWcMS2rIbg
 48wbjlqYEy9YgrSJiZNP8TyNv1wazKGOmAAr9TD52+fFbdARR+9lb0efpvZIJcDzvJokkRigs
 lKDlthfu1Y8g1jd8mEjhWy7JqDdOK2kidO0eiL92zBwsD5enj0XCn7zRev5bcjnXMWSW3VedF
 /GByuXk54sPH0kS8sSQytQM5qDr2Q2qOH3D3IwMHDN2XH0nhYGFLwSS7PHRNtkk6Y26Dyi/O6
 gMRi+H4of4BATGHArdedD+ICMFKVVfrPO6ZIaAQB4njgVnFDg8+FcsZblrmOi6J/jTAwEkkFs
 J+dLmIUeCoS4qalQD5k3aZNc7eR6ewQxcGd7b7s6PlzMiSgrdBm5zgLiVvTmh45pXifuDd8Xt
 41SKC7H
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 27397
Cc: 27397 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Phil Sainty <psainty@HIDDEN> writes:

Hi Phil,

> As there's no info node for trace.el, that could perhaps be a +++
> entry; although a grep shows me that "(tramp) Traces and Profiles"
> could be amended to change:
>
>      (require 'trace)
>      (dolist (elt (all-completions "tramp-" obarray 'functionp))
>        (trace-function-background (intern elt)))
>
> to:
>
>      (trace-package "tramp-")

There's no package "tramp-". Better would be

        (trace-regexp "^tramp-")

Could be changed in the Tramp manual (modulo backwards
compatibility). One problem I'm always faced with Tramp are autoloaded
functions. The code as given in the Tramp manual instruments only
functions, which are either already loaded, or which are marked as to be
autoloaded. Functions from a Tramp package, which are loaded later on,
are not handled.

Could you add this functionality?

> -Phil

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Jun 2017 11:23:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 18 07:23:10 2017
Received: from localhost ([127.0.0.1]:54031 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMYIQ-0005ad-4N
	for submit <at> debbugs.gnu.org; Sun, 18 Jun 2017 07:23:10 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45453)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1dMYIO-0005aN-8L
 for submit <at> debbugs.gnu.org; Sun, 18 Jun 2017 07:23:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1dMYIG-0005ka-S0
 for submit <at> debbugs.gnu.org; Sun, 18 Jun 2017 07:23:03 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:38817)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <psainty@HIDDEN>)
 id 1dMYIG-0005k5-NP
 for submit <at> debbugs.gnu.org; Sun, 18 Jun 2017 07:23:00 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36410)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1dMYIE-0005qW-5h
 for bug-gnu-emacs@HIDDEN; Sun, 18 Jun 2017 07:23:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1dMYI9-0005cp-6t
 for bug-gnu-emacs@HIDDEN; Sun, 18 Jun 2017 07:22:58 -0400
Received: from smtp-3.orcon.net.nz ([60.234.4.44]:46220)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <psainty@HIDDEN>)
 id 1dMYI8-0005a2-K1
 for bug-gnu-emacs@HIDDEN; Sun, 18 Jun 2017 07:22:53 -0400
Received: from [150.107.172.87] (port=24191 helo=[192.168.20.102])
 by smtp-3.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>) id 1dMYHo-0002fl-Br
 for bug-gnu-emacs@HIDDEN; Sun, 18 Jun 2017 23:22:42 +1200
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: bug-gnu-emacs@HIDDEN
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <d8ba5a45-ae3b-7f05-1749-ca5032d4bee9@HIDDEN>
Date: Sun, 18 Jun 2017 23:22:31 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
Content-Type: multipart/mixed; boundary="------------5BDDD4D8641D5478F16D92E0"
Content-Language: en-US
X-GeoIP: NZ
X-Spam_score: -1.0
X-Spam_score_int: -9
X-Spam_bar: -
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -2.7 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.7 (--)

This is a multi-part message in MIME format.
--------------5BDDD4D8641D5478F16D92E0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Just attaching the current patch.  Thanks for the input Dmitry and
Kaushal.  I'll leave it a while to see whether anyone else wishes to
weigh in on the outstanding items:

* The inconsistent predicate naming of `trace-is-traced' vs
  `trace-is-traceable-p'.
  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27397#19

* Whether foreground-tracing variants of the new commands are wanted.
  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27397#25
  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27397#34

* Whether it's a good idea to display the trace buffer initially
  when one of the background tracing commands is invoked.


(I guess I'll follow up next weekend if no one has anything to add
in the interim.)


-Phil

--------------5BDDD4D8641D5478F16D92E0
Content-Type: text/x-patch;
 name="0001-New-commands-for-bulk-tracing-of-elisp-functions.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0001-New-commands-for-bulk-tracing-of-elisp-functions.patch"

From 5ca9108f585a06c2085ab180c390bf85d3657230 Mon Sep 17 00:00:00 2001
From: Phil Sainty <psainty@HIDDEN>
Date: Sun, 11 Jun 2017 17:29:53 +1200
Subject: [PATCH] New commands for bulk tracing of elisp functions

* lisp/emacs-lisp/trace.el (trace-package, untrace-package)
(trace-regexp, untrace-regexp, trace-is-traceable-p): New functions.

(trace--read-function): New function, split from `trace--read-args'.
Changed to use the new `trace-is-traceable-p' predicate.

(trace--read-extra-args): New function, split from `trace--read-args'.
Changed to allow the user to enter an empty string at the context
expression prompt (previously an error; now treated as "nil"), and to
cause a "nil" context expression to produce no context output in the
trace buffer.

(trace--read-args): Removed function.  Replaced by the combination of
`trace--read-function' and `trace--read-extra-args'.

(trace-function-foreground, trace-function-background): Updated
interactive specs to use the new functions.

(trace-is-traced, untrace-function, untrace-all): Doc updates/fixes.

Commentary updated to cover the new commands.

Change log updated to cover the main changes since 1993.

* etc/NEWS: Mention the new trace commands.

* doc/misc/tramp.texi: Update "(tramp) Traces and Profiles" to use
`trace-package'.
---
 doc/misc/tramp.texi      |   4 +-
 etc/NEWS                 |   8 ++
 lisp/emacs-lisp/trace.el | 206 ++++++++++++++++++++++++++++++++++++++---------
 3 files changed, 176 insertions(+), 42 deletions(-)

diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 4ca3932..54d5d00 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -3672,9 +3672,7 @@ Traces and Profiles
 
 @lisp
 @group
-(require 'trace)
-(dolist (elt (all-completions "tramp-" obarray 'functionp))
-  (trace-function-background (intern elt)))
+(trace-package "tramp-")
 (untrace-function 'tramp-read-passwd)
 @end group
 @end lisp
diff --git a/etc/NEWS b/etc/NEWS
index 7972511..d3d73cc 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -743,6 +743,14 @@ header's value.
 where the GnuPG home directory (used for signature verification) is
 located and whether GnuPG's option "--homedir" is used or not.
 
+** Trace
+
++++
+*** New commands 'trace-package' and 'trace-regexp' (and their
+counterparts 'untrace-package' and 'untrace-regexp') allow for the
+bulk tracing of calls to functions with names matching a specified
+prefix or regexp.
+
 ** Tramp
 
 +++
diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el
index 1c57d73..05ee780 100644
--- a/lisp/emacs-lisp/trace.el
+++ b/lisp/emacs-lisp/trace.el
@@ -52,14 +52,20 @@
 
 ;; Usage:
 ;; ======
-;; - To trace a function say `M-x trace-function', which will ask you for the
+;; - To trace a function use `M-x trace-function', which will ask you for the
 ;;   name of the function/subr/macro to trace.
 ;; - If you want to trace a function that switches buffers or does other
 ;;   display oriented stuff use `M-x trace-function-background', which will
 ;;   generate the trace output silently in the background without popping
 ;;   up windows and doing other irritating stuff.
-;; - To untrace a function say `M-x untrace-function'.
-;; - To untrace all currently traced functions say `M-x untrace-all'.
+;; - `M-x trace-package' will ask you for a function name prefix, and trace
+;;   (in the background) all matching functions.
+;; - `M-x trace-regexp' will ask you for a function name pattern (regexp),
+;;   and trace (in the background) all matching functions.
+;; - To untrace a function use `M-x untrace-function'.
+;; - To untrace multiple functions by prefix use `M-x untrace-package'.
+;; - To untrace multiple functions by regexp use `M-x untrace-regexp'.
+;; - To untrace all currently traced functions use `M-x untrace-all'.
 
 ;; Examples:
 ;; =========
@@ -120,6 +126,22 @@
 
 ;;; Change Log:
 
+;; 2017-06-17  Phil Sainty
+;;	* New commands `trace-package', `untrace-package', `trace-regexp',
+;;	  `untrace-regexp'
+;;
+;; 2012-2014  Stefan Monnier, Glenn Morris
+;;	* Adapted for nadvice.el
+;;	* New `context' argument and display in trace buffer
+;;	* `trace-function' renamed to (and now an alias of)
+;;	  `trace-function-foreground'
+;;
+;; 2005-02-27  Stefan Monnier
+;;	* New `inhibit-trace' variable
+;;
+;; 1998-04-05  Stephen Eglen
+;;	* New customize group `trace'
+;;
 ;; Revision 2.0 1993/05/18 00:41:16 hans
 ;;	* Adapted for advice.el 2.0; it now also works
 ;;	  for GNU Emacs-19 and Lemacs
@@ -257,42 +279,48 @@ trace-function-internal
                       (or context (lambda () "")))
    `((name . ,trace-advice-name) (depth . -100))))
 
+(defun trace-is-traceable-p (sym)
+  "Whether the given symbol is a traceable function."
+  (or (functionp sym) (macrop sym)))
+
 (defun trace-is-traced (function)
+  "Whether FUNCTION is currently traced."
   (advice-member-p trace-advice-name function))
 
-(defun trace--read-args (prompt)
-  "Read a function name, prompting with string PROMPT.
-If `current-prefix-arg' is non-nil, also read a buffer and a \"context\"
-\(Lisp expression).  Return (FUNCTION BUFFER FUNCTION-CONTEXT)."
-  (cons
-   (let ((default (function-called-at-point))
-         (beg (string-match ":[ \t]*\\'" prompt)))
-     (intern (completing-read (if default
-                                  (format
-                                   "%s (default %s)%s"
-                                   (substring prompt 0 beg)
-                                   default
-                                   (if beg (substring prompt beg) ": "))
-                                prompt)
-                              obarray 'fboundp t nil nil
-                              (if default (symbol-name default)))))
-   (when current-prefix-arg
-     (list
-      (read-buffer "Output to buffer: " trace-buffer)
-      (let ((exp
-             (let ((minibuffer-completing-symbol t))
-               (read-from-minibuffer "Context expression: "
-                                     nil read-expression-map t
-                                     'read-expression-history))))
-        (lambda ()
-          (let ((print-circle t))
-            (concat " [" (prin1-to-string (eval exp t)) "]"))))))))
+(defun trace--read-function (prompt)
+  "Read a function name, prompting with string PROMPT."
+  (let ((default (function-called-at-point))
+        (beg (string-match ":[ \t]*\\'" prompt)))
+    (intern (completing-read (if default
+                                 (format
+                                  "%s (default %s)%s"
+                                  (substring prompt 0 beg)
+                                  default
+                                  (if beg (substring prompt beg) ": "))
+                               prompt)
+                             obarray 'trace-is-traceable-p t nil nil
+                             (if default (symbol-name default))))))
+
+(defun trace--read-extra-args ()
+  "Read a buffer and a \"context\" (Lisp expression).
+Return (BUFFER CONTEXT)."
+  (list
+   (read-buffer "Output to buffer: " trace-buffer)
+   (let ((exp
+          (let ((minibuffer-completing-symbol t))
+            (read-from-minibuffer "Context expression: "
+                                  nil read-expression-map t
+                                  'read-expression-history "nil"))))
+     (and exp
+          (lambda ()
+            (let ((print-circle t))
+              (concat " [" (prin1-to-string (eval exp t)) "]")))))))
 
 ;;;###autoload
 (defun trace-function-foreground (function &optional buffer context)
   "Trace calls to function FUNCTION.
-With a prefix argument, also prompt for the trace buffer (default
-`trace-buffer'), and a Lisp expression CONTEXT.
+With a prefix argument, also prompt for the trace output BUFFER
+\(default `trace-buffer'), and a Lisp expression CONTEXT.
 
 Tracing a function causes every call to that function to insert
 into BUFFER Lisp-style trace messages that display the function's
@@ -306,7 +334,9 @@ trace-function-foreground
 stuff - use `trace-function-background' instead.
 
 To stop tracing a function, use `untrace-function' or `untrace-all'."
-  (interactive (trace--read-args "Trace function: "))
+  (interactive
+   (cons (trace--read-function "Trace function: ")
+         (and current-prefix-arg (trace--read-extra-args))))
   (trace-function-internal function buffer nil context))
 
 ;;;###autoload
@@ -314,24 +344,122 @@ trace-function-background
   "Trace calls to function FUNCTION, quietly.
 This is like `trace-function-foreground', but without popping up
 the output buffer or changing the window configuration."
-  (interactive (trace--read-args "Trace function in background: "))
+  (interactive
+   (cons (trace--read-function "Trace function in background: ")
+         (and current-prefix-arg (trace--read-extra-args))))
   (trace-function-internal function buffer t context))
 
 ;;;###autoload
 (defalias 'trace-function 'trace-function-foreground)
 
 (defun untrace-function (function)
-  "Untraces FUNCTION and possibly activates all remaining advice.
-Activation is performed with `ad-update', hence remaining advice will get
-activated only if the advice of FUNCTION is currently active.  If FUNCTION
-was not traced this is a noop."
+  "Remove trace from FUNCTION.  If FUNCTION was not traced this is a noop."
   (interactive
    (list (intern (completing-read "Untrace function: "
                                   obarray #'trace-is-traced t))))
   (advice-remove function trace-advice-name))
 
+;;;###autoload
+(defun trace-package (prefix &optional buffer context)
+  "Trace all functions with names starting with PREFIX.
+For example, to trace all diff functions, do the following:
+
+\\[trace-package] RET diff- RET
+
+With a prefix argument, also prompt for the trace output BUFFER
+\(default `trace-buffer'), and a Lisp expression CONTEXT.
+
+Background tracing is used.  Switch to the trace output buffer to view
+the results.
+
+See `trace-function-foreground' for details on the optional arguments
+and foreground vs background tracing.
+
+See also `untrace-package'."
+  ;; Derived in part from `elp-instrument-package'.
+  (interactive
+   (cons (completing-read "Prefix of package to trace: "
+                          obarray #'trace-is-traceable-p)
+         (and current-prefix-arg (trace--read-extra-args))))
+  (when (zerop (length prefix))
+    (error "Tracing all Emacs functions would render Emacs unusable"))
+  (mapc (lambda (name)
+          (trace-function-background (intern name) buffer context))
+        (all-completions prefix obarray #'trace-is-traceable-p))
+  (message
+   "Tracing to %s.  Use %s to untrace a package, or %s to remove all traces."
+   (or buffer trace-buffer)
+   (substitute-command-keys "\\[untrace-package]")
+   (substitute-command-keys "\\[untrace-all]")))
+
+(defun untrace-package (prefix)
+  "Remove all traces from functions with names starting with PREFIX.
+
+See also `trace-package'."
+  (interactive
+   (list (completing-read "Prefix of package to untrace: "
+                          obarray #'trace-is-traced)))
+  (if (and (zerop (length prefix))
+           (y-or-n-p "Remove all function traces?"))
+      (untrace-all)
+    (mapc (lambda (name)
+            (untrace-function (intern name)))
+          (all-completions prefix obarray #'trace-is-traceable-p))))
+
+;;;###autoload
+(defun trace-regexp (regexp &optional buffer context)
+  "Trace all functions with names matching REGEXP.
+For example, to trace indentation-related functions, you could try:
+
+\\[trace-regexp] RET indent\\|offset RET
+
+Warning: Do not attempt to trace all functions.  Tracing too many
+functions at one time will render Emacs unusable.
+
+With a prefix argument, also prompt for the trace output BUFFER
+\(default `trace-buffer'), and a Lisp expression CONTEXT.
+
+Background tracing is used.  Switch to the trace output buffer to view
+the results.
+
+See `trace-function-foreground' for details on the optional arguments
+and foreground vs background tracing.
+
+See also `untrace-regexp'."
+  (interactive
+   (cons (read-regexp "Regexp matching functions to trace: ")
+         (and current-prefix-arg (trace--read-extra-args))))
+  (when (member regexp '("" "." ".+" ".*"))
+    ;; Not comprehensive, but it catches the most likely attempts.
+    (error "Tracing all Emacs functions would render Emacs unusable"))
+  (mapatoms
+   (lambda (sym)
+     (and (trace-is-traceable-p sym)
+          (string-match-p regexp (symbol-name sym))
+          (trace-function-background sym buffer context))))
+  (message
+   "Tracing to %s.  Use %s to untrace by regexp, or %s to remove all traces."
+   (or buffer trace-buffer)
+   (substitute-command-keys "\\[untrace-regexp]")
+   (substitute-command-keys "\\[untrace-all]")))
+
+(defun untrace-regexp (regexp)
+  "Remove all traces from functions with names matching REGEXP.
+
+See also `trace-regexp'."
+  (interactive
+   (list (read-regexp "Regexp matching functions to untrace: ")))
+  (if (and (zerop (length regexp))
+           (y-or-n-p "Remove all function traces?"))
+      (untrace-all)
+    (mapatoms
+     (lambda (sym)
+       (and (trace-is-traceable-p sym)
+            (string-match-p regexp (symbol-name sym))
+            (untrace-function sym))))))
+
 (defun untrace-all ()
-  "Untraces all currently traced functions."
+  "Remove traces from all currently traced functions."
   (interactive)
   (mapatoms #'untrace-function))
 
-- 
2.8.3


--------------5BDDD4D8641D5478F16D92E0--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 18 Jun 2017 06:32:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 18 02:32:16 2017
Received: from localhost ([127.0.0.1]:53912 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMTkt-0004sk-TV
	for submit <at> debbugs.gnu.org; Sun, 18 Jun 2017 02:32:16 -0400
Received: from mail-wm0-f47.google.com ([74.125.82.47]:37440)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1dMTks-0004sU-C2
 for 27397 <at> debbugs.gnu.org; Sun, 18 Jun 2017 02:32:14 -0400
Received: by mail-wm0-f47.google.com with SMTP id d73so50459605wma.0
 for <27397 <at> debbugs.gnu.org>; Sat, 17 Jun 2017 23:32:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=fKb7LRoepipmSbbwqOLclnDY/RvqWAJlgm0gOr85kc0=;
 b=XFXk35AlXM1dMoj0EH6c1AEwlkmAbd6o7XkE2n03OtZSjerR+zE4/AM6qd3IAOjD3l
 kocG/A0BKEZnogr2XEkFOuiCGEEHKG3GKvDL1+X04pB484NeQftH0O+8rQb7PQ04ga0v
 WOS9wr5DixpLIn72ZQ8VmCDNhaNyvs1UMQFHb7ixoar5re+jLZFIEh/MPnL6xnOXPpJx
 T7BOwxs84IbMA5QNy9iF2zVE+BBOPHFW6pgAfwrPJcmCQdP/n2MbHoD6hdIvNfkFoQKv
 rzJmUwR8RgdLomwVsIa1tCbIfJ5qJss22vLXzls1ISOiJaofiCE9i80NtYcpOti4Sicz
 gwdw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=fKb7LRoepipmSbbwqOLclnDY/RvqWAJlgm0gOr85kc0=;
 b=gyW59v/QC2RE3Qpm6pc9+UXCmSOGXEMLC0V+0+tBdKEusgSnrYKJ4XkfYZV0WwxI6h
 RP1l2NVepiiGF/uklesUXWs1rW71ZBzsHkU9VN6IG67ncyPe9VZwCpI6Up3A5KXb3RWI
 05Y3CbabPlS3ONWFYqrK34QWFIJXJX8D1d6lqiSjf2UjfqSau+Y4yx8Cz4EI+/CRJCEM
 l4+9b8ANyrgPsrWWdRlsJBFcJlJ0atUhffFvZot/AKmjqgbmVxcvbvjYJ4JLX8JPx3Bd
 CgdKDWtEhY9pWbYSUA86EKv86SLMjgrRdK2Nk3DL0sj8Q3tP9c5jBdBMpXFxRlfaihZe
 XY/A==
X-Gm-Message-State: AKS2vOyBs4jyxg57CN0xiGoA3UbrxJf3fUJTB3U1e9KaNtdZVX+OkbJi
 chkuWddPBs19sN4B7H8=
X-Received: by 10.80.180.188 with SMTP id w57mr12877799edd.42.1497767528076;
 Sat, 17 Jun 2017 23:32:08 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.193])
 by smtp.googlemail.com with ESMTPSA id d37sm3854733edb.54.2017.06.17.23.32.05
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 17 Jun 2017 23:32:07 -0700 (PDT)
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Phil Sainty <psainty@HIDDEN>, 27397 <at> debbugs.gnu.org
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
 <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <132824c4-39b4-a46c-79e6-0d48d3d88c0e@HIDDEN>
Date: Sun, 18 Jun 2017 09:32:04 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101
 Thunderbird/54.0
MIME-Version: 1.0
In-Reply-To: <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 6/18/17 4:06 AM, Phil Sainty wrote:

> I've now refactored this like so:
> 
> * `trace--read-args' has been split into `trace--read-function` and
>    `trace--read-extra-args'.
> 
> * `trace--read-function` reads only a function.

That sounds better, thanks!




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 18 Jun 2017 01:06:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 17 21:06:25 2017
Received: from localhost ([127.0.0.1]:53857 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMOfZ-00054O-4w
	for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 21:06:25 -0400
Received: from smtp-3.orcon.net.nz ([60.234.4.44]:45801)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1dMOfW-00054B-Ly
 for 27397 <at> debbugs.gnu.org; Sat, 17 Jun 2017 21:06:23 -0400
Received: from [150.107.172.87] (port=17473 helo=[192.168.20.102])
 by smtp-3.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>)
 id 1dMOfP-0001n2-8n; Sun, 18 Jun 2017 13:06:15 +1200
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Dmitry Gutov <dgutov@HIDDEN>, 27397 <at> debbugs.gnu.org
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
 <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <6b195c26-066c-870f-3432-0b24c6f619ec@HIDDEN>
Date: Sun, 18 Jun 2017 13:06:14 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-GB
Content-Transfer-Encoding: 7bit
X-GeoIP: NZ
X-Spam_score: -1.0
X-Spam_score_int: -9
X-Spam_bar: -
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 18/06/17 10:59, Dmitry Gutov wrote:
> Why the rename, though? Those are not arguments for the function we're
> going to trace. trace--read-args sounds as appropriate, if not more.

That was because the behaviour of `trace--read-args' had been quite
specific to the `trace-function*' commands -- its primary purpose was
to prompt for a single function -- and I thought the name should reflect
that.  I agree with you, though -- the new name wasn't ideal either.

I've now refactored this like so:

* `trace--read-args' has been split into `trace--read-function` and
  `trace--read-extra-args'.

* `trace--read-function` reads only a function.

* `The interactive specs for the trace-function*' commands are now
   similar to those of the new bulk trace commands, in explicitly
   calling `trace--read-extra-args':

  (interactive
   (cons (trace--read-function "Trace function: ")
         (and current-prefix-arg (trace--read-extra-args))))

I think this name change makes better sense, and the code is now more
consistent between commands.


-Phil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 17 Jun 2017 23:04:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 17 19:04:03 2017
Received: from localhost ([127.0.0.1]:53803 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMMl9-0005FR-1t
	for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 19:04:03 -0400
Received: from mail-wr0-f171.google.com ([209.85.128.171]:33607)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1dMMl7-0005Ex-3P
 for 27397 <at> debbugs.gnu.org; Sat, 17 Jun 2017 19:04:01 -0400
Received: by mail-wr0-f171.google.com with SMTP id r103so54388807wrb.0
 for <27397 <at> debbugs.gnu.org>; Sat, 17 Jun 2017 16:04:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=1y9yJMFHzpG3xQ1LY5vHWNZm8kFPQSF0NyZzKolHDcU=;
 b=r4wIdQHZ/iPgNrszbM7snqz3pzzRgtjj4lmTtwRPYV6rXhR06N7zwBjFzkhjPXwYNN
 mQWQOrWuzADiiQ+qFcxBSzdRA+vSAcGJ13OoYKFtDGxNdWTB8y8wLWyDK422LsJcDGVy
 3XTDW35gZQkqEZpJ45itbkWOZTuwWFAS8+ps9y97Y7HlELRhTejuuCnfBa7OlhltlsAS
 aGrXgNybbf09mCHB0Jk0TiKbvMTnH7zMmY7ivbZg1e7iRF/vJAu7hwG1eET1KjonJkt9
 +X+SsMRtpNBRq2TooAcsq0Pflut737L95Z+hSC6FiJcKTu0M2Un0GQ1kiw71Jb+ZbQ2D
 7V3Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=1y9yJMFHzpG3xQ1LY5vHWNZm8kFPQSF0NyZzKolHDcU=;
 b=hvUxy0vxhnD+Z56EDyY6BPq0e+uiUiCr1AESL/Ac105kjKxYwGatyHdSt+90l9Ehft
 Ob2JMFWc0azSZuVBGooCjh2KRxod4oQ3b+woBdRUR2Mo8S5OZWKCoBrD9ml3KOEaBx3p
 Ft6Sh3He1m/XzwtAV+k2laVW+1bRKpwATaOgE56dN8KlItiDByWVecGO9R6bEG9XWSwJ
 vIGIGw+8NRn1YOmCM8kIxTGARZlCk2qPGi5T6aBNYWaRWRD5zZS3LS+YS9SZEijuQHmT
 Dk3GGAH0779ndt1Ynz7iRG0C6uef6C81kgy6LdEtnDL3FJBIA+KbvvXDguNA15mYrqMd
 5cEA==
X-Gm-Message-State: AKS2vOwRyt/8+nD1SsfxWO7m1BmIJUtMcey9lVaKO83nd/OlC31Gciax
 3sbafC+0tdO4QaluvEo=
X-Received: by 10.223.162.151 with SMTP id s23mr10725895wra.68.1497740635059; 
 Sat, 17 Jun 2017 16:03:55 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.193])
 by smtp.googlemail.com with ESMTPSA id x71sm11797951wmd.32.2017.06.17.16.03.53
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 17 Jun 2017 16:03:54 -0700 (PDT)
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Phil Sainty <psainty@HIDDEN>, 27397 <at> debbugs.gnu.org
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <7aecfe49-89bd-f684-20e7-9d75572eb6a6@HIDDEN>
Date: Sun, 18 Jun 2017 02:03:52 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101
 Thunderbird/54.0
MIME-Version: 1.0
In-Reply-To: <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -1.0 (-)
X-Debbugs-Envelope-To: 27397
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 6/17/17 12:20 PM, Phil Sainty wrote:

> Actually popping up that buffer when
> the `trace-package' or `trace-regexp' command is used would be another
> (perhaps nicer) option?

Perhaps.

> Do others think that foreground versions of these commands would be
> a good idea?

I'm fine with having only the background versions, but others are 
welcome to weigh in.

> A prefix argument could mean "use foreground tracing"

Nah, if we do want foreground tracing, adding separate commands 
shouldn't be a problem.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 17 Jun 2017 23:00:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 17 19:00:08 2017
Received: from localhost ([127.0.0.1]:53799 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMMhM-0005A5-Bz
	for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 19:00:08 -0400
Received: from mail-wm0-f50.google.com ([74.125.82.50]:36773)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1dMMhK-00057t-R9
 for 27397 <at> debbugs.gnu.org; Sat, 17 Jun 2017 19:00:07 -0400
Received: by mail-wm0-f50.google.com with SMTP id m125so51621086wmm.1
 for <27397 <at> debbugs.gnu.org>; Sat, 17 Jun 2017 16:00:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=CL3YP4AiD2Q4CVF3b3CbmOOn7NkwMcGpqV2pT0yRspI=;
 b=OFL1XMug7DXEGoTyvDR3MOsKXYyBbjqJsTfwn6CgbvDiwTZQr0KtCvG/f7oNH7D4+m
 8aDcCcJJWS3V++SiXguq5d6K9Xf0A57XBSF4ctveIf8cxFuf1lNufZG/IJCc0mWw/gFN
 7JDV4bVpwkC0yEShQ9pkX9SXMUT4kl3+4T5JBlgqMNaYdKKwzRnUeSqqF+cpmVmWyPMn
 UJx8D8ayf2N3sEAcfjMcYTybTDFQvCCErYEe+KXz0QHvkp/Rv0izJWfGXSm50t6KGYkE
 A2J5tDYHv4oWDEMDuV0ZZhn0brKHdS+Aywz3Q9bxXdaMKYXOaAlPF6RUUxfCCzHIap3s
 iSCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=CL3YP4AiD2Q4CVF3b3CbmOOn7NkwMcGpqV2pT0yRspI=;
 b=DScI5C0Kxk33DHRLUYaWKRLc7v/UCE0CPir0ktn4chiwHBbJR3wMSjXucz9vS96I37
 s4ERiIBqnHZJaoSJXeZb9zlEdC0NM4EoyLx4yt5eKeknsRm6V0+RGpBKT/ROxxJZvRls
 WZv8fcnR/519g5IJCZPA7NQNkoYqM2gwyIkfCKCqt9sD/ZijcRs6wnguvJfDkKwsds+v
 2eqEnFYN/2lku1qX0GI0Onq72ObX2IxrCLgtFEdAV9+baQxYKoO6hHIt4BpEPPPhgQA3
 Uxiy6CMBfgZ12geAsXHYxZTcF3SXZzuRC9WSoFpF1vH/HB0kz9Om6UXBkJU2DdJfCuoj
 yxhw==
X-Gm-Message-State: AKS2vOzd0pgDz2fijTuTxvGKpUSKtJx/8G4VopZ7YAhmjY1DgeSCkgwR
 h9u7lu3k0Pk08zI2Woo=
X-Received: by 10.28.145.12 with SMTP id t12mr2482306wmd.7.1497740400649;
 Sat, 17 Jun 2017 16:00:00 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.193])
 by smtp.googlemail.com with ESMTPSA id j10sm4979295wre.67.2017.06.17.15.59.58
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 17 Jun 2017 15:59:59 -0700 (PDT)
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Phil Sainty <psainty@HIDDEN>, 27397 <at> debbugs.gnu.org
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
 <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <adbc18a1-20ef-5261-6d8e-149b13d61674@HIDDEN>
Date: Sun, 18 Jun 2017 01:59:57 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101
 Thunderbird/54.0
MIME-Version: 1.0
In-Reply-To: <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 6/17/17 3:31 PM, Phil Sainty wrote:

> In the process I noticed that the existing behaviour of trace--read-args
> was quite unfriendly if you wanted to set a trace buffer but had no need
> of a context expression -- typing RET at the context expression prompt
> triggered an "End of file during parsing" error, as that input string
> is processed by `read-from-string'.
> 
> I've changed that code to treat an empty input as "nil" (which is read
> to `nil'), and to ignore `nil' context expressions entirely (as opposed
> to printing their evaluated value as "[nil]" in the trace buffer).

Sounds good.

Why the rename, though? Those are not arguments for the function we're 
going to trace. trace--read-args sounds as appropriate, if not more.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 Jun 2017 12:31:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 17 08:31:33 2017
Received: from localhost ([127.0.0.1]:52202 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dMCt3-0001Gx-94
	for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 08:31:33 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48591)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1dMCt1-0001Gi-Cj
 for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 08:31:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1dMCsu-0007km-Ig
 for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 08:31:26 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:51882)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <psainty@HIDDEN>)
 id 1dMCsu-0007kg-E6
 for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 08:31:24 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39560)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1dMCss-00042T-Dj
 for bug-gnu-emacs@HIDDEN; Sat, 17 Jun 2017 08:31:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1dMCsp-0007kP-A0
 for bug-gnu-emacs@HIDDEN; Sat, 17 Jun 2017 08:31:22 -0400
Received: from smtp-1.orcon.net.nz ([60.234.4.34]:47346)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <psainty@HIDDEN>)
 id 1dMCso-0007kG-NS
 for bug-gnu-emacs@HIDDEN; Sat, 17 Jun 2017 08:31:19 -0400
Received: from [150.107.172.84] (port=6352 helo=[192.168.20.102])
 by smtp-1.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>) id 1dMCsh-0003YN-IG
 for bug-gnu-emacs@HIDDEN; Sun, 18 Jun 2017 00:31:15 +1200
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: bug-gnu-emacs@HIDDEN
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <70000e90-328c-c084-3e3c-bbde96b16110@HIDDEN>
Date: Sun, 18 Jun 2017 00:31:10 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
Content-Type: multipart/mixed; boundary="------------E1EE229F6C2D01E03D4D939F"
Content-Language: en-GB
X-GeoIP: NZ
X-Spam_score: -1.0
X-Spam_score_int: -9
X-Spam_bar: -
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -2.7 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.7 (--)

This is a multi-part message in MIME format.
--------------E1EE229F6C2D01E03D4D939F
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On 17/06/17 21:20, Phil Sainty wrote:
> inconsistent with `trace--read-args' which uses a prefix arg to prompt
> the user for the trace buffer and a context expression -- which I now
> realise is behaviour that my commands should incorporate as well.

I've implemented this change, and attached the current WIP patch.

In the process I noticed that the existing behaviour of trace--read-args
was quite unfriendly if you wanted to set a trace buffer but had no need
of a context expression -- typing RET at the context expression prompt
triggered an "End of file during parsing" error, as that input string
is processed by `read-from-string'.

I've changed that code to treat an empty input as "nil" (which is read
to `nil'), and to ignore `nil' context expressions entirely (as opposed
to printing their evaluated value as "[nil]" in the trace buffer).


-Phil

--------------E1EE229F6C2D01E03D4D939F
Content-Type: text/x-patch;
 name="0001-New-commands-for-bulk-tracing-of-elisp-functions.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0001-New-commands-for-bulk-tracing-of-elisp-functions.patch"

From 4d9ea7ac95b070d55b8e1502c3091168891f433e Mon Sep 17 00:00:00 2001
From: Phil Sainty <psainty@HIDDEN>
Date: Sun, 11 Jun 2017 17:29:53 +1200
Subject: [PATCH] New commands for bulk tracing of elisp functions

* lisp/emacs-lisp/trace.el (trace-package, untrace-package)
(trace-regexp, untrace-regexp, trace-is-traceable-p): New functions.

(trace--read-extra-args): New function, split from `trace--read-args'.
Changed to allow the user to enter an empty string at the context
expression prompt (previously an error; now treated as "nil"), and to
cause a "nil" context expression to produce no context output in the
trace buffer.

(trace--read-function-args): New name for `trace--read-args'.
Changed to use the new `trace-is-traceable-p' predicate.
(trace--read-args): Renamed to `trace--read-function-args'
(trace-function-foreground, trace-function-background): Call the
renamed `trace--read-function-args'.

(trace-is-traced, untrace-function, untrace-all): Doc updates/fixes.

* etc/NEWS: Mention the new trace commands.

* doc/misc/tramp.texi: Update "(tramp) Traces and Profiles" to use
`trace-package'.
---
 doc/misc/tramp.texi      |   4 +-
 etc/NEWS                 |   8 +++
 lisp/emacs-lisp/trace.el | 133 ++++++++++++++++++++++++++++++++++++++++-------
 3 files changed, 123 insertions(+), 22 deletions(-)

diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 4ca3932..54d5d00 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -3672,9 +3672,7 @@ Traces and Profiles
 
 @lisp
 @group
-(require 'trace)
-(dolist (elt (all-completions "tramp-" obarray 'functionp))
-  (trace-function-background (intern elt)))
+(trace-package "tramp-")
 (untrace-function 'tramp-read-passwd)
 @end group
 @end lisp
diff --git a/etc/NEWS b/etc/NEWS
index 7972511..d3d73cc 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -743,6 +743,14 @@ header's value.
 where the GnuPG home directory (used for signature verification) is
 located and whether GnuPG's option "--homedir" is used or not.
 
+** Trace
+
++++
+*** New commands 'trace-package' and 'trace-regexp' (and their
+counterparts 'untrace-package' and 'untrace-regexp') allow for the
+bulk tracing of calls to functions with names matching a specified
+prefix or regexp.
+
 ** Tramp
 
 +++
diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el
index 1c57d73..949bb54 100644
--- a/lisp/emacs-lisp/trace.el
+++ b/lisp/emacs-lisp/trace.el
@@ -257,10 +257,15 @@ trace-function-internal
                       (or context (lambda () "")))
    `((name . ,trace-advice-name) (depth . -100))))
 
+(defun trace-is-traceable-p (sym)
+  "Whether the given symbol is a traceable function."
+  (or (functionp sym) (macrop sym)))
+
 (defun trace-is-traced (function)
+  "Whether FUNCTION is currently traced."
   (advice-member-p trace-advice-name function))
 
-(defun trace--read-args (prompt)
+(defun trace--read-function-args (prompt)
   "Read a function name, prompting with string PROMPT.
 If `current-prefix-arg' is non-nil, also read a buffer and a \"context\"
 \(Lisp expression).  Return (FUNCTION BUFFER FUNCTION-CONTEXT)."
@@ -274,19 +279,25 @@ trace--read-args
                                    default
                                    (if beg (substring prompt beg) ": "))
                                 prompt)
-                              obarray 'fboundp t nil nil
+                              obarray 'trace-is-traceable-p t nil nil
                               (if default (symbol-name default)))))
    (when current-prefix-arg
-     (list
-      (read-buffer "Output to buffer: " trace-buffer)
-      (let ((exp
-             (let ((minibuffer-completing-symbol t))
-               (read-from-minibuffer "Context expression: "
-                                     nil read-expression-map t
-                                     'read-expression-history))))
-        (lambda ()
-          (let ((print-circle t))
-            (concat " [" (prin1-to-string (eval exp t)) "]"))))))))
+     (trace--read-extra-args))))
+
+(defun trace--read-extra-args ()
+  "Read a buffer and a \"context\" (Lisp expression).
+Return (BUFFER FUNCTION-CONTEXT)."
+  (list
+   (read-buffer "Output to buffer: " trace-buffer)
+   (let ((exp
+          (let ((minibuffer-completing-symbol t))
+            (read-from-minibuffer "Context expression: "
+                                  nil read-expression-map t
+                                  'read-expression-history "nil"))))
+     (and exp
+          (lambda ()
+            (let ((print-circle t))
+              (concat " [" (prin1-to-string (eval exp t)) "]")))))))
 
 ;;;###autoload
 (defun trace-function-foreground (function &optional buffer context)
@@ -306,7 +317,7 @@ trace-function-foreground
 stuff - use `trace-function-background' instead.
 
 To stop tracing a function, use `untrace-function' or `untrace-all'."
-  (interactive (trace--read-args "Trace function: "))
+  (interactive (trace--read-function-args "Trace function: "))
   (trace-function-internal function buffer nil context))
 
 ;;;###autoload
@@ -314,24 +325,108 @@ trace-function-background
   "Trace calls to function FUNCTION, quietly.
 This is like `trace-function-foreground', but without popping up
 the output buffer or changing the window configuration."
-  (interactive (trace--read-args "Trace function in background: "))
+  (interactive (trace--read-function-args "Trace function in background: "))
   (trace-function-internal function buffer t context))
 
 ;;;###autoload
 (defalias 'trace-function 'trace-function-foreground)
 
 (defun untrace-function (function)
-  "Untraces FUNCTION and possibly activates all remaining advice.
-Activation is performed with `ad-update', hence remaining advice will get
-activated only if the advice of FUNCTION is currently active.  If FUNCTION
-was not traced this is a noop."
+  "Remove trace from FUNCTION.  If FUNCTION was not traced this is a noop."
   (interactive
    (list (intern (completing-read "Untrace function: "
                                   obarray #'trace-is-traced t))))
   (advice-remove function trace-advice-name))
 
+;;;###autoload
+(defun trace-package (prefix &optional buffer context)
+  "Trace all functions with names starting with PREFIX.
+For example, to trace all diff functions, do the following:
+
+\\[trace-package] RET diff- RET
+
+Background tracing is used.  Switch to the trace output buffer to
+view the results.
+
+See also `untrace-package'."
+  ;; Derived in part from `elp-instrument-package'.
+  (interactive
+   (cons (completing-read "Prefix of package to trace: "
+                          obarray #'trace-is-traceable-p)
+         (and current-prefix-arg (trace--read-extra-args))))
+  (when (zerop (length prefix))
+    (error "Tracing all Emacs functions would render Emacs unusable"))
+  (mapc (lambda (name)
+          (trace-function-background (intern name) buffer context))
+        (all-completions prefix obarray #'trace-is-traceable-p))
+  (message
+   "Tracing to %s.  Use %s to untrace a package, or %s to remove all traces."
+   (or buffer trace-buffer)
+   (substitute-command-keys "\\[untrace-package]")
+   (substitute-command-keys "\\[untrace-all]")))
+
+(defun untrace-package (prefix)
+  "Remove traces from all functions with names starting with PREFIX.
+
+See also `trace-package'."
+  (interactive
+   (list (completing-read "Prefix of package to untrace: "
+                          obarray #'trace-is-traced)))
+  (if (and (zerop (length prefix))
+           (y-or-n-p "Remove all function traces?"))
+      (untrace-all)
+    (mapc (lambda (name)
+            (untrace-function (intern name)))
+          (all-completions prefix obarray #'trace-is-traceable-p))))
+
+;;;###autoload
+(defun trace-regexp (regexp &optional buffer context)
+  "Trace all functions with names matching REGEXP.
+For example, to trace indentation-related functions, you could try:
+
+\\[trace-regexp] RET indent\\|offset RET
+
+Warning: Do not attempt to trace all functions.  Tracing too many
+functions at one time will render Emacs unusable.
+
+Background tracing is used.  Switch to the trace output buffer to
+view the results.
+
+See also `untrace-regexp'."
+  (interactive
+   (cons (read-regexp "Regexp matching functions to trace: ")
+         (and current-prefix-arg (trace--read-extra-args))))
+  (when (member regexp '("" "." ".+" ".*"))
+    ;; Not comprehensive, but it catches the most likely attempts.
+    (error "Tracing all Emacs functions would render Emacs unusable"))
+  (mapatoms
+   (lambda (sym)
+     (and (trace-is-traceable-p sym)
+          (string-match-p regexp (symbol-name sym))
+          (trace-function-background sym buffer context))))
+  (message
+   "Tracing to %s.  Use %s to untrace by regexp, or %s to remove all traces."
+   (or buffer trace-buffer)
+   (substitute-command-keys "\\[untrace-regexp]")
+   (substitute-command-keys "\\[untrace-all]")))
+
+(defun untrace-regexp (regexp)
+  "Remove traces from all functions with names matching REGEXP.
+
+See also `trace-regexp'."
+  (interactive
+   (list (read-regexp "Regexp matching functions to untrace: ")))
+  (if (and (zerop (length regexp))
+           (y-or-n-p "Remove all function traces?"))
+      (untrace-all)
+    (mapatoms
+     (lambda (sym)
+       (and (trace-is-traceable-p sym)
+            (string-match-p regexp (symbol-name sym))
+            (untrace-function sym))))))
+
 (defun untrace-all ()
-  "Untraces all currently traced functions."
+  "Remove traces from all currently traced functions."
   (interactive)
   (mapatoms #'untrace-function))
 
-- 
2.8.3


--------------E1EE229F6C2D01E03D4D939F--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 Jun 2017 09:20:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 17 05:20:32 2017
Received: from localhost ([127.0.0.1]:52108 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dM9uC-0003TB-AD
	for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 05:20:32 -0400
Received: from eggs.gnu.org ([208.118.235.92]:49958)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1dM9uA-0003Sw-Al
 for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 05:20:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1dM9u4-0002gw-3K
 for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 05:20:25 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:53703)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <psainty@HIDDEN>)
 id 1dM9u4-0002gr-0E
 for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 05:20:24 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:40920)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1dM9u2-0004Ta-Jo
 for bug-gnu-emacs@HIDDEN; Sat, 17 Jun 2017 05:20:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1dM9tx-0002cs-Lb
 for bug-gnu-emacs@HIDDEN; Sat, 17 Jun 2017 05:20:22 -0400
Received: from smtp-3.orcon.net.nz ([60.234.4.44]:40173)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <psainty@HIDDEN>)
 id 1dM9tx-0002bq-B1
 for bug-gnu-emacs@HIDDEN; Sat, 17 Jun 2017 05:20:17 -0400
Received: from [150.107.172.84] (port=54249 helo=[192.168.20.102])
 by smtp-3.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>) id 1dM9tg-0005Tu-NR
 for bug-gnu-emacs@HIDDEN; Sat, 17 Jun 2017 21:20:12 +1200
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: bug-gnu-emacs@HIDDEN
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <94d27dbb-46d3-1d6f-4849-251a0929d413@HIDDEN>
Date: Sat, 17 Jun 2017 21:20:00 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-GB
Content-Transfer-Encoding: 8bit
X-GeoIP: NZ
X-Spam_score: -1.0
X-Spam_score_int: -9
X-Spam_bar: -
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -2.7 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.7 (--)

Thanks to the merge with
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=1343 and
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=6464 I see that there
was a previous submission of a `trace-package' command which (a) used
foreground tracing, and (b) provided `trace-package-background' as a
separate command.

I should note that I elected not to support foreground tracing for
my proposed commands, simply because it seemed to me that foreground
tracing could be problematic in too many cases, when the traces are
being applied en masse on the basis of function name pattern matching.

The current `trace-function-foreground' docstring says:

> This function creates BUFFER if it does not exist.  This buffer will
> popup whenever FUNCTION is called.  Do not use this function to trace
> functions that switch buffers, or do any other display-oriented
> stuff - use ‘trace-function-background’ instead.

My compromise was to indicate the `trace-buffer' value in the echo
area when the commands are invoked, so that the user would know where
the trace output was happening.  Actually popping up that buffer when
the `trace-package' or `trace-regexp' command is used would be another
(perhaps nicer) option?

I'm open to recommendations for the most useful approach.

Do others think that foreground versions of these commands would be
a good idea?

A prefix argument could mean "use foreground tracing", but that's
inconsistent with `trace--read-args' which uses a prefix arg to prompt
the user for the trace buffer and a context expression -- which I now
realise is behaviour that my commands should incorporate as well.


-Phil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 17 Jun 2017 09:13:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 17 05:13:16 2017
Received: from localhost ([127.0.0.1]:52099 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dM9nA-0003Hy-2C
	for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 05:13:16 -0400
Received: from mail-wr0-f179.google.com ([209.85.128.179]:33213)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1dM9n8-0003Hm-Ok
 for 27397 <at> debbugs.gnu.org; Sat, 17 Jun 2017 05:13:15 -0400
Received: by mail-wr0-f179.google.com with SMTP id r103so48968353wrb.0
 for <27397 <at> debbugs.gnu.org>; Sat, 17 Jun 2017 02:13:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=GULtWU2/tGwhCejdCH1ibo18V+yOFZ1gZ6XJ40oGxB8=;
 b=PJKdDCZHyNDl1Q694QDrWM5IDc0ZYBdQgrZ3k3oNqMNgKXGmcG0nXl1ltBD0ZHEKRM
 uUllQak90t2UAGoGrnnQk2qzc0Rt2DLj9SCZ9YZaJ0bLv7LagPAyDdhqvn/XBXs9j1MP
 ZSdKtPPRubTPy4x++dfNaJZFoQSD/nmHnF+fne9PJ2fOkB8ysDZHkTmANuD0C8ZnbhzH
 fxYJq2nGjNC12mmPi/XlujOyNtiCdt4yUvQHD8XmknEFB736W1yweoztWxWKxpNSpJkI
 tI7IcFvA+kL0SPoWhcjqJ7VkPKlTR4s+OmZAKcsBCOuglx01edlOBjiC19AMZcZCyPGV
 BVgw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=GULtWU2/tGwhCejdCH1ibo18V+yOFZ1gZ6XJ40oGxB8=;
 b=sHvmnsbSqLGK587zgyO6QJ8H8kLEtwAegECqFBLWSQZS2zXOVs043UqfD2100q3v0i
 rNVuUNYQ/djltt5ePlSDpOvPMdYFkZE/cAGAAHGe1ErEa9W9LaTKjY/St8pO6DeiTfLu
 CYkabztGn5k29aitnkAU7/rgn0ZBTiPBI+Wk0jPxLj5XFEvjzuGn1inqeS8nnTwqs6JJ
 pP7/4O1JJ+7Q/LMJKOebljfdPfo5VoWfpSsrO5LL6NBul+Y8iGanRuyGmeNMX3yVlOOL
 9lp+fAOOfQL3wJ9gkRtaIGBmpHHTBDNSt0RahYoyzUuIBSzJ/uUD9l2NhGuRnQ+vUwFc
 aagA==
X-Gm-Message-State: AKS2vOzy/pySho22VFhDjP0CgJOqSWQlIsRe9VvpO1WVFyzkJzthmvvQ
 HNT1/i3/5Cis4b2JFVw=
X-Received: by 10.223.160.1 with SMTP id k1mr11063372wrk.102.1497690788797;
 Sat, 17 Jun 2017 02:13:08 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.193])
 by smtp.googlemail.com with ESMTPSA id a28sm6622606wra.17.2017.06.17.02.13.07
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 17 Jun 2017 02:13:07 -0700 (PDT)
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Phil Sainty <psainty@HIDDEN>, 27397 <at> debbugs.gnu.org
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
 <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <5c1f6ddd-9589-6726-0536-730e20dbe249@HIDDEN>
Date: Sat, 17 Jun 2017 12:13:06 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101
 Thunderbird/54.0
MIME-Version: 1.0
In-Reply-To: <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 27397
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

On 6/17/17 11:43 AM, Phil Sainty wrote:
> On 17/06/17 02:58, Dmitry Gutov wrote:
>> This patch could probably use a NEWS entry, though.
> 
> Yes, that's a good point. I'll add one to the next revision.
> Something like this?

Looks good to me, both proposed changes.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 17 Jun 2017 08:49:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 17 04:49:08 2017
Received: from localhost ([127.0.0.1]:52079 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dM9Po-0002k5-GX
	for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 04:49:08 -0400
Received: from smtp-3.orcon.net.nz ([60.234.4.44]:48518)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1dM9Pm-0002jY-Hd
 for 27397 <at> debbugs.gnu.org; Sat, 17 Jun 2017 04:49:07 -0400
Received: from [150.107.172.84] (port=44275 helo=[192.168.20.102])
 by smtp-3.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>)
 id 1dM9PT-00026X-CN; Sat, 17 Jun 2017 20:48:57 +1200
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Kaushal Modi <kaushal.modi@HIDDEN>, 27397 <at> debbugs.gnu.org,
 Dmitry Gutov <dgutov@HIDDEN>
References: <CAFyQvY00pMR6u_7NA00GUuUe90eX0_OXxP5vPjZAzAEfrdGCCQ@HIDDEN>
From: Phil Sainty <psainty@HIDDEN>
Message-ID: <ecdd1135-93fe-f6b8-77c0-99c94bc7eb08@HIDDEN>
Date: Sat, 17 Jun 2017 20:48:46 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <CAFyQvY00pMR6u_7NA00GUuUe90eX0_OXxP5vPjZAzAEfrdGCCQ@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-GeoIP: NZ
X-Spam_score: -1.0
X-Spam_score_int: -9
X-Spam_bar: -
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

> On 6/16/17 4:32 PM, Phil Sainty wrote:
>> (I note that the `trace-is-traced' function does not follow the usual
>> naming convention for predicates.  Should this be renamed to
>> `trace-is-traced-p' ?)


On 17/06/17 02:58, Dmitry Gutov wrote:
> I'm not 100% sure about the protocol here, but including both "-is-"
> and "-p" in a function name seems too much.
>
> So maybe you should do the opposite and rename trace-is-traceable-p to
> trace-is-traceable.


On 17/06/17 03:43, Kaushal Modi wrote:
> Based on current examples[1], it is more common to see predicate
> *functions* end in "-p". So the "-is-" portion is maybe redundant.
>
> My suggestion would be something like "trace-traced-p" or
> "trace-fn-traced-p".
>
> [1]: https://debbugs.gnu.org/cgi/bugreport.cgi?att=0;bug=26564;msg=5


FWIW, after loading more or less all the lisp in trunk, apropos tells me:

2381 matches for ".*-p$"
126 matches for "-is-"
28 matches for "-is-.*-p$"


The -p suffix is certainly what I'm used to seeing, but -is- is entirely
readable to my mind, so I'm happy either way.  Consistency is good, so
some kind of change seemed sensible to me, but I don't especially mind
one way or the other.

If one of the maintainers wants to make a recommendation, I'll update
the code (or leave it as-is) accordingly.


-Phil





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 17 Jun 2017 08:43:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 17 04:43:14 2017
Received: from localhost ([127.0.0.1]:52073 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dM9K5-0002bg-Rt
	for submit <at> debbugs.gnu.org; Sat, 17 Jun 2017 04:43:13 -0400
Received: from smtp-3.orcon.net.nz ([60.234.4.44]:44695)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1dM9K4-0002bT-4A
 for 27397 <at> debbugs.gnu.org; Sat, 17 Jun 2017 04:43:12 -0400
Received: from [150.107.172.84] (port=26965 helo=[192.168.20.102])
 by smtp-3.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>)
 id 1dM9Js-0001bT-TX; Sat, 17 Jun 2017 20:43:02 +1200
From: Phil Sainty <psainty@HIDDEN>
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Dmitry Gutov <dgutov@HIDDEN>, 27397 <at> debbugs.gnu.org
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
 <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
Message-ID: <aeea08bc-f2e1-f6de-e3c0-a2389643eb81@HIDDEN>
Date: Sat, 17 Jun 2017 20:43:00 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-GeoIP: NZ
X-Spam_score: -1.0
X-Spam_score_int: -9
X-Spam_bar: -
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 17/06/17 02:58, Dmitry Gutov wrote:
> This patch could probably use a NEWS entry, though.

Yes, that's a good point. I'll add one to the next revision.
Something like this?


** Trace

*** New commands 'trace-package' and 'trace-regexp' (and their
counterparts 'untrace-package' and 'untrace-regexp') allow for the
bulk tracing of calls to functions with names matching a specified
prefix or regexp.


As there's no info node for trace.el, that could perhaps be a +++
entry; although a grep shows me that "(tramp) Traces and Profiles"
could be amended to change:

     (require 'trace)
     (dolist (elt (all-completions "tramp-" obarray 'functionp))
       (trace-function-background (intern elt)))

to:

     (trace-package "tramp-")


It would be good to add a node to the elisp manual covering trace.el,
but that's not strictly part of this patch.


-Phil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 16 Jun 2017 15:43:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 16 11:43:52 2017
Received: from localhost ([127.0.0.1]:51544 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dLtPc-0004MJ-7c
	for submit <at> debbugs.gnu.org; Fri, 16 Jun 2017 11:43:52 -0400
Received: from mail-lf0-f44.google.com ([209.85.215.44]:34138)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kaushal.modi@HIDDEN>) id 1dLtPa-0004M4-4o
 for 27397 <at> debbugs.gnu.org; Fri, 16 Jun 2017 11:43:50 -0400
Received: by mail-lf0-f44.google.com with SMTP id v20so27475897lfa.1
 for <27397 <at> debbugs.gnu.org>; Fri, 16 Jun 2017 08:43:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=XuQg6Eh+hM85UybIt5FY26EZWaYiHOzKOFTcBsutJ1c=;
 b=Wzqtqo25dG7Ab+wS9BBMuH2OEI8HZXq3+suPlQ3hstRZQJubzbxmNQ4YYAh5gZpIH0
 TkmS1MfiwzLUcplLyinJLKEnU16jgGBW4SLYx31allVWCfeKtwcLOvamFI0DL1JiCxCI
 7IDnHm8zgqHx2J8IvxatQRkOvubluxZWs3PdEFtOvYmeblobr2DsBo/k4rXZVu6z/b0z
 A+TPbD32JrF09C6QIjujs8QEtHfbeP+j6RWWJKJ56ubR72dFb0Pjp3yEXpVvuRo7+Cxr
 w9aK9tBA3KMTtaHYifMsY4rBb7lXb43WViPrde9Y57rfDUubidfRiDWquTd3DZvM4GvM
 JGlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=XuQg6Eh+hM85UybIt5FY26EZWaYiHOzKOFTcBsutJ1c=;
 b=qrTjtGO1hs4K5+croiblNwed+TX3wYzumC+RZSWYSs7TcRxjuR9GhfMlma8xFUEPw4
 CTDHRG2ABQS1CPGWP5gHswVNk/VJsQERtITokQSzyX7vNoaLhA4zkHeszYgBqEItHusJ
 HxAqx5LwIg1OIXiiJZoGnvkFJSxZYAfTGikiDy1QsoN3LB3Ow9rcwlRiQXBprQ32INUA
 A47IyPF4cB0bVbM0+xJ5VLaxQkGSVvbA5dm/9xcP+0vOZ9hwscaIIZe6PUrLtBic80BQ
 E8FNBXmAe8zBMVmo/i4zmxrSjEDjH8QB01NmZLPeccOYctc9JFnwaemjlk2gp/jTCnog
 K7rg==
X-Gm-Message-State: AKS2vOy5CiIfh0+U0Rihyj7KT4hTncINbAXF8eEFqs3VKcgjDH4dm/W0
 oTZ/mCaDzLQcu90y+KJVBx+z6ituTA==
X-Received: by 10.46.81.26 with SMTP id f26mr880079ljb.33.1497627823791; Fri,
 16 Jun 2017 08:43:43 -0700 (PDT)
MIME-Version: 1.0
From: Kaushal Modi <kaushal.modi@HIDDEN>
Date: Fri, 16 Jun 2017 15:43:32 +0000
Message-ID: <CAFyQvY00pMR6u_7NA00GUuUe90eX0_OXxP5vPjZAzAEfrdGCCQ@HIDDEN>
Subject: [PATCH] New commands for bulk tracing of elisp functions
To: 27397 <at> debbugs.gnu.org, psainty@HIDDEN, 
 Dmitry Gutov <dgutov@HIDDEN>
Content-Type: multipart/alternative; boundary="f403045fff247167d4055215a62b"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 27397
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--f403045fff247167d4055215a62b
Content-Type: text/plain; charset="UTF-8"

> I note that the `trace-is-traced' function does not follow the usual
> naming convention for predicates.  Should this be renamed to
> `trace-is-traced-p'

Based on current examples[1], it is more common to see predicate
*functions* end in "-p". So the "-is-" portion is maybe redundant.

My suggestion would be something like "trace-traced-p" or
"trace-fn-traced-p".

[1]: https://debbugs.gnu.org/cgi/bugreport.cgi?att=0;bug=26564;msg=5

-- 

Kaushal Modi

--f403045fff247167d4055215a62b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>&gt; I note that the `trace-is-traced&#39; function d=
oes not follow the usual</div><div>&gt; naming convention for predicates.=
=C2=A0 Should this be renamed to</div><div>&gt; `trace-is-traced-p&#39;</di=
v><div><br></div>Based on current examples[1], it is more common to see pre=
dicate *functions* end in &quot;-p&quot;. So the &quot;-is-&quot; portion i=
s maybe redundant.<div><br></div><div>My suggestion would be something like=
 &quot;trace-traced-p&quot; or &quot;trace-fn-traced-p&quot;.</div><div><br=
></div><div>[1]:=C2=A0<a href=3D"https://debbugs.gnu.org/cgi/bugreport.cgi?=
att=3D0;bug=3D26564;msg=3D5">https://debbugs.gnu.org/cgi/bugreport.cgi?att=
=3D0;bug=3D26564;msg=3D5</a></div><div><br></div></div><div dir=3D"ltr">-- =
<br></div><div data-smartmail=3D"gmail_signature"><p dir=3D"ltr">Kaushal Mo=
di</p>
</div>

--f403045fff247167d4055215a62b--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.
Forcibly Merged 1343 6464 27397. Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 27397 <at> debbugs.gnu.org:


Received: (at 27397) by debbugs.gnu.org; 16 Jun 2017 14:58:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 16 10:58:11 2017
Received: from localhost ([127.0.0.1]:51493 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dLshP-0001Ks-Kb
	for submit <at> debbugs.gnu.org; Fri, 16 Jun 2017 10:58:11 -0400
Received: from mail-wr0-f179.google.com ([209.85.128.179]:34486)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1dLshO-0001Ke-Ch
 for 27397 <at> debbugs.gnu.org; Fri, 16 Jun 2017 10:58:10 -0400
Received: by mail-wr0-f179.google.com with SMTP id 77so39915872wrb.1
 for <27397 <at> debbugs.gnu.org>; Fri, 16 Jun 2017 07:58:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=REpf8yDhxRou52eIcUVKn60gxBQQTpRGbMx8ts8/7vc=;
 b=Wadkt7HazS7ZA3MuBpV5PrO7lB+MfNIcrN/rkvIZboDjOWFMvGKB9DoYqEWRaIGnnS
 wC6YZMqyqeGy2S+pZRcgy3lhYi7ClcYPx/o+9/7ReaAnUAsgzCmk4P7x1wy4fgBdVbh/
 KX/0Pc7ChF9Ef7p10evUXVY7s+Q9ftLGAJ3T4KsJ+clH5mAhGJRUSw0JoxCwEi+Z1ioH
 HHcpETxLr4hrmrbYOGoWLcvrM4Awy2dXYhNXrc0PPxG66TARFuJAhHVc5ulAv/erUTGA
 MdiItGDjcpkAN7yIbRjT6r+lnc/5t53m1udnPMDSLtFJOqkJbQ3cbJEUjon4Oc3w4ZCR
 CCMw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language
 :content-transfer-encoding;
 bh=REpf8yDhxRou52eIcUVKn60gxBQQTpRGbMx8ts8/7vc=;
 b=EvoCKCnJ7stN4i8RI1EvJs0qXgH2zJ21zgGL28gmXUe9QrY3xhg3mDkr2SofENlcoX
 JtN9KtuGJs5mnw3TXFsb9qm82qbquDTpsyW9hz5pDzij0GMvVwxlFdBwLs0EWXvQC0xe
 thN2PNNwBZXrUfh5VngeIWrnqFSX7eZnWMHMTOWXeiLdD81tE+kpCqCOp6VUGQLJ6aKH
 vnVabg7DFrzyIZa+qkZAy0EnRJES3/kVmEZvY8e66tNn5lANkYxkX+CxrjcVkuJ0Agdd
 m6UeZIb9NabUxX4z3rBjFgNedX8clL41T2BIJECSrF/F+Mr1//8HY1/O1AZWlzxY9F3X
 ogeQ==
X-Gm-Message-State: AKS2vOx9/G5vj735h8GpDbsICv7bMG+V0NE4Vc3itERK+PGjqiDlFMy7
 eNqVBdaXYrrFP6VC3II=
X-Received: by 10.223.145.78 with SMTP id j72mr7419309wrj.7.1497625084006;
 Fri, 16 Jun 2017 07:58:04 -0700 (PDT)
Received: from [192.168.1.3] ([185.105.174.193])
 by smtp.googlemail.com with ESMTPSA id 29sm3692637wrv.23.2017.06.16.07.58.02
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 16 Jun 2017 07:58:03 -0700 (PDT)
Subject: Re: bug#27397: [PATCH] New commands for bulk tracing of elisp
 functions
To: Phil Sainty <psainty@HIDDEN>, 27397 <at> debbugs.gnu.org
References: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <34fcc090-6a8b-42de-b6c8-df182f8de938@HIDDEN>
Date: Fri, 16 Jun 2017 17:58:01 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101
 Thunderbird/54.0
MIME-Version: 1.0
In-Reply-To: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 27397
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

On 6/16/17 4:32 PM, Phil Sainty wrote:

> This patch adds commands for tracing and untracing functions in bulk,
> either by function name prefix (`trace-package' and `untrace-package')
> or by regexp (`trace-regexp' and `untrace-regexp').

Looking good. And I've wanted these commands both times I've had a need 
to use trace.el.

This patch could probably use a NEWS entry, though.

> (I note that the `trace-is-traced' function does not follow the usual
> naming convention for predicates.  Should this be renamed to
> `trace-is-traced-p' ?)

I'm not 100% sure about the protocol here, but including both "-is-" and 
"-p" in a function name seems too much.

So maybe you should do the opposite and rename trace-is-traceable-p to 
trace-is-traceable.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 16 Jun 2017 13:33:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 16 09:33:20 2017
Received: from localhost ([127.0.0.1]:50487 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dLrNH-0007Vo-OE
	for submit <at> debbugs.gnu.org; Fri, 16 Jun 2017 09:33:20 -0400
Received: from eggs.gnu.org ([208.118.235.92]:32915)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1dLrNG-0007VZ-30
 for submit <at> debbugs.gnu.org; Fri, 16 Jun 2017 09:33:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1dLrN8-0005Ez-RR
 for submit <at> debbugs.gnu.org; Fri, 16 Jun 2017 09:33:12 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:37893)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <psainty@HIDDEN>)
 id 1dLrN8-0005Ev-Nh
 for submit <at> debbugs.gnu.org; Fri, 16 Jun 2017 09:33:10 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52109)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1dLrN6-0003QN-Tc
 for bug-gnu-emacs@HIDDEN; Fri, 16 Jun 2017 09:33:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1dLrN1-00059g-Re
 for bug-gnu-emacs@HIDDEN; Fri, 16 Jun 2017 09:33:08 -0400
Received: from smtp-1.orcon.net.nz ([60.234.4.34]:37750)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <psainty@HIDDEN>)
 id 1dLrN1-00057D-AQ
 for bug-gnu-emacs@HIDDEN; Fri, 16 Jun 2017 09:33:03 -0400
Received: from [150.107.172.84] (port=41275 helo=[192.168.20.102])
 by smtp-1.orcon.net.nz with esmtpa (Exim 4.86_2)
 (envelope-from <psainty@HIDDEN>) id 1dLrMm-0001x5-6z
 for bug-gnu-emacs@HIDDEN; Sat, 17 Jun 2017 01:32:58 +1200
To: bug-gnu-emacs@HIDDEN
From: Phil Sainty <psainty@HIDDEN>
Subject: [PATCH] New commands for bulk tracing of elisp functions
Message-ID: <1348823a-7623-8146-8cc0-8c0eff13e458@HIDDEN>
Date: Sat, 17 Jun 2017 01:32:47 +1200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.1.1
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------5E3E67DFA1FB0FE1DB2D8CCE"
Content-Language: en-US
X-GeoIP: NZ
X-Spam_score: -1.0
X-Spam_score_int: -9
X-Spam_bar: -
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -2.7 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.7 (--)

This is a multi-part message in MIME format.
--------------5E3E67DFA1FB0FE1DB2D8CCE
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

trace.el currently only has commands for adding a trace to a single
function, and for untracing either a single function or ALL traced
functions.

This patch adds commands for tracing and untracing functions in bulk,
either by function name prefix (`trace-package' and `untrace-package')
or by regexp (`trace-regexp' and `untrace-regexp').

The use of the term "package" for the prefix-based commands was chosen
for consistency with `elp-instrument-package', from which this code is
partly derived, and from which I have also maintained a warning and
basic protection against attempts to trace too many functions at once
(which can indeed render Emacs unusable).  It it still possible to do
this, but I feel the checks which are currently in place are probably
sufficient to protect against accidents.

`trace-is-traceable-p' is using Stefan's suggestion in his comment on
my initial implementation at https://stackoverflow.com/a/44241058 and
I have changed the completing-read filter predicate in
`trace--read-args' to also use this (instead of `fboundp'), on the
assumption that this makes more sense.

(I note that the `trace-is-traced' function does not follow the usual
naming convention for predicates.  Should this be renamed to
`trace-is-traced-p' ?)

This patch also removes some outdated docstring comments for
`untrace-function' which were clearly remnants of the earlier
implementation using advice.el (whereas the current library is based
on nadvice.el).


-Phil

--------------5E3E67DFA1FB0FE1DB2D8CCE
Content-Type: text/x-patch;
 name="0001-New-commands-for-bulk-tracing-of-elisp-functions.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0001-New-commands-for-bulk-tracing-of-elisp-functions.patch"

From c7262056db33722bc84dd94fbadaa71ed8fbf5fc Mon Sep 17 00:00:00 2001
From: Phil Sainty <psainty@HIDDEN>
Date: Sun, 11 Jun 2017 17:29:53 +1200
Subject: [PATCH] New commands for bulk tracing of elisp functions

* lisp/emacs-lisp/trace.el (trace-package, untrace-package)
(trace-regexp, untrace-regexp, trace-is-traceable-p): New functions.
(trace--read-args): Use new trace-is-traceable-p predicate.
(trace-is-traced, untrace-function, untrace-all): Doc updates/fixes.
---
 lisp/emacs-lisp/trace.el | 98 +++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 92 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el
index 1c57d73..5dba151 100644
--- a/lisp/emacs-lisp/trace.el
+++ b/lisp/emacs-lisp/trace.el
@@ -257,7 +257,12 @@ trace-function-internal
                       (or context (lambda () "")))
    `((name . ,trace-advice-name) (depth . -100))))
 
+(defun trace-is-traceable-p (sym)
+  "Whether the given symbol is a traceable function."
+  (or (functionp sym) (macrop sym)))
+
 (defun trace-is-traced (function)
+  "Whether FUNCTION is currently traced."
   (advice-member-p trace-advice-name function))
 
 (defun trace--read-args (prompt)
@@ -274,7 +279,7 @@ trace--read-args
                                    default
                                    (if beg (substring prompt beg) ": "))
                                 prompt)
-                              obarray 'fboundp t nil nil
+                              obarray 'trace-is-traceable-p t nil nil
                               (if default (symbol-name default)))))
    (when current-prefix-arg
      (list
@@ -321,17 +326,98 @@ trace-function-background
 (defalias 'trace-function 'trace-function-foreground)
 
 (defun untrace-function (function)
-  "Untraces FUNCTION and possibly activates all remaining advice.
-Activation is performed with `ad-update', hence remaining advice will get
-activated only if the advice of FUNCTION is currently active.  If FUNCTION
-was not traced this is a noop."
+  "Remove trace from FUNCTION.  If FUNCTION was not traced this is a noop."
   (interactive
    (list (intern (completing-read "Untrace function: "
                                   obarray #'trace-is-traced t))))
   (advice-remove function trace-advice-name))
 
+;;;###autoload
+(defun trace-package (prefix)
+  "Trace all functions with names starting with PREFIX.
+For example, to trace all diff functions, do the following:
+
+\\[trace-package] RET diff- RET
+
+Background tracing is used.  Switch to the trace output buffer to
+view the results.
+
+See also `untrace-package'."
+  (interactive ;; derived from `elp-instrument-package'.
+   (list (completing-read "Prefix of package to trace: "
+                          obarray #'trace-is-traceable-p)))
+  (when (zerop (length prefix))
+    (error "Tracing all Emacs functions would render Emacs unusable"))
+  (mapc (lambda (name)
+          (trace-function-background (intern name)))
+        (all-completions prefix obarray #'trace-is-traceable-p))
+  (message
+   "Tracing to %s.  Use %s to untrace a package, or %s to remove all traces."
+   trace-buffer
+   (substitute-command-keys "\\[untrace-package]")
+   (substitute-command-keys "\\[untrace-all]")))
+
+(defun untrace-package (prefix)
+  "Remove traces from all functions with names starting with PREFIX.
+
+See also `trace-package'."
+  (interactive
+   (list (completing-read "Prefix of package to untrace: "
+                          obarray #'trace-is-traced)))
+  (if (and (zerop (length prefix))
+           (y-or-n-p "Remove all function traces?"))
+      (untrace-all)
+    (mapc (lambda (name)
+            (untrace-function (intern name)))
+          (all-completions prefix obarray #'trace-is-traceable-p))))
+
+;;;###autoload
+(defun trace-regexp (regexp)
+  "Trace all functions with names matching REGEXP.
+For example, to trace indentation-related functions, you could try:
+
+\\[trace-regexp] RET indent\\|offset RET
+
+Warning: Do not attempt to trace all functions.  Tracing too many
+functions at one time will render Emacs unusable.
+
+Background tracing is used.  Switch to the trace output buffer to
+view the results.
+
+See also `untrace-regexp'."
+  (interactive
+   (list (read-regexp "Regexp matching functions to trace: ")))
+  (when (member regexp '("" "." ".+" ".*"))
+    ;; Not comprehensive, but it catches the most likely attempts.
+    (error "Tracing all Emacs functions would render Emacs unusable"))
+  (mapatoms
+   (lambda (sym)
+     (and (trace-is-traceable-p sym)
+          (string-match-p regexp (symbol-name sym))
+          (trace-function-background sym))))
+  (message
+   "Tracing to %s.  Use %s to untrace by regexp, or %s to remove all traces."
+   trace-buffer
+   (substitute-command-keys "\\[untrace-regexp]")
+   (substitute-command-keys "\\[untrace-all]")))
+
+(defun untrace-regexp (regexp)
+  "Remove traces from all functions with names matching REGEXP.
+
+See also `trace-regexp'."
+  (interactive
+   (list (read-regexp "Regexp matching functions to untrace: ")))
+  (if (and (zerop (length regexp))
+           (y-or-n-p "Remove all function traces?"))
+      (untrace-all)
+    (mapatoms
+     (lambda (sym)
+       (and (trace-is-traceable-p sym)
+            (string-match-p regexp (symbol-name sym))
+            (untrace-function sym))))))
+
 (defun untrace-all ()
-  "Untraces all currently traced functions."
+  "Remove traces from all currently traced functions."
   (interactive)
   (mapatoms #'untrace-function))
 
-- 
2.8.3


--------------5E3E67DFA1FB0FE1DB2D8CCE--




Acknowledgement sent to Phil Sainty <psainty@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#27397; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 13 Sep 2022 11:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.