GNU bug report logs -
#40335
27.0.90; elp-not-profilable not up to date
Previous Next
Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>
Date: Mon, 30 Mar 2020 21:26:01 UTC
Severity: normal
Tags: moreinfo
Found in version 27.0.90
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 40335 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Mon, 30 Mar 2020 23:25:01 +0200
Philipp Stephani wrote:
> emacs -Q -eval '(elp-instrument-list (quote (float-time eq)))'
>
> Then something like C-x d leads to infinite recursion. It looks like
> the list `elp-not-profilable' is outdated and should be regenerated.
The list (as well as the comment) is definitely out of date, given that
since its last modification elp has been updated to use nadvice.el, also
the `float-time' weren't originally being used, OTOH some of the
original functions listed aren't used by elp any more.
But I can't tell which functions should really be on it. The comment
says that functions directly or indirectly used by the wrapper should be
avoided, but from my anecdotal testing, the only of those that cause
problems are `apply', `error', `current-time' and `float-time'.
All the others can be removed AFAICT, and none of `eq', `get', `aref' or
`time-subtract', also called by the wrapper lambdas
(`elp--make-wrapper'), seemed to cause issues for me.
IIUC advice has no effect for calls from C functions to C functions, but
I don't understand what makes e.g. `float-time' (which breaks) different
from `aref' or `get' (which apparently don't) in that respect.
Here's what seems to work for me:
[elp.diff (text/x-patch, inline)]
diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el
index 7dd3cbd1a2..f357783256 100644
--- a/lisp/emacs-lisp/elp.el
+++ b/lisp/emacs-lisp/elp.el
@@ -202,16 +202,9 @@ elp-master
"Master function symbol.")
(defvar elp-not-profilable
- ;; First, the functions used inside each instrumented function:
- '(called-interactively-p
- ;; Then the functions used by the above functions. I used
- ;; (delq nil (mapcar (lambda (x) (and (symbolp x) (fboundp x) x))
- ;; (aref (symbol-function 'elp-wrapper) 2)))
- ;; to help me find this list.
- error call-interactively apply current-time
- ;; Andreas Politz reports problems profiling these (Bug#4233):
- + byte-code-function-p functionp byte-code subrp
- indirect-function fboundp)
+ ;; functions used inside each instrumented function cause infinite
+ ;; recursion:
+ '(apply current-time error float-time)
"List of functions that cannot be profiled.
Those functions are used internally by the profiling code and profiling
them would thus lead to infinite recursion.")
This bug report was last modified 3 years and 186 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.