From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Newsgroups: gmane.emacs.bugs Subject: bug#40335: 27.0.90; elp-not-profilable not up to date Date: Mon, 13 Apr 2020 16:52:17 +0200 Message-ID: <87wo6ja15q.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="75014"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 40335@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 13 16:52:14 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jO0RZ-000JL0-5k for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Apr 2020 16:52:13 +0200 Original-Received: from localhost ([::1]:45122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO0RY-0005lh-8O for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Apr 2020 10:52:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51393) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO0RP-0005lZ-Ss for bug-gnu-emacs@gnu.org; Mon, 13 Apr 2020 10:52:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jO0RO-0004nm-Py for bug-gnu-emacs@gnu.org; Mon, 13 Apr 2020 10:52:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48955) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jO0RO-0004nh-Lz for bug-gnu-emacs@gnu.org; Mon, 13 Apr 2020 10:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jO0RO-0004ta-HA for bug-gnu-emacs@gnu.org; Mon, 13 Apr 2020 10:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Apr 2020 14:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40335 X-GNU-PR-Package: emacs Original-Received: via spool by 40335-submit@debbugs.gnu.org id=B40335.158678951118739 (code B ref 40335); Mon, 13 Apr 2020 14:52:02 +0000 Original-Received: (at 40335) by debbugs.gnu.org; 13 Apr 2020 14:51:51 +0000 Original-Received: from localhost ([127.0.0.1]:60501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jO0RC-0004s6-J3 for submit@debbugs.gnu.org; Mon, 13 Apr 2020 10:51:51 -0400 Original-Received: from mail-lf1-f52.google.com ([209.85.167.52]:39817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jO0RA-0004rN-9N for 40335@debbugs.gnu.org; Mon, 13 Apr 2020 10:51:49 -0400 Original-Received: by mail-lf1-f52.google.com with SMTP id m2so6729064lfo.6 for <40335@debbugs.gnu.org>; Mon, 13 Apr 2020 07:51:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=u35mqnIGmwU+ThYECjo507e+hNciffGGUsUROgO4QoY=; b=pBklvG29XDvDCBhHkl29Xm9gAqItLlWjlCcd0mOpCWRzg89Up7JgWwhm8va5dTxcr0 X1y6O2q/NQ6UG7d9+SlCn6xVrv+JKLlPgdX1xiL4p3xadCKn0mL5w4bhpolKXGAMDRBY bmL+ljjlmfIYkTEzbVfOfemTWaR3Z9OVvzi7B0JbsXSnqyzawuXOrrao6L9/w7t3R6Mi 0p40zcnXxqPy/IlBf2+dviru1UwY6DTgpm25DoL15RWXkcKs8GgKZzOff+dw785SPN1v Ti8nr+fSHaMD2Ky3XlumsVa3qPb+sDFaOeGzEdJjidI5ArQotjKcOSgPnH4oDHKaTSF/ V2Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=u35mqnIGmwU+ThYECjo507e+hNciffGGUsUROgO4QoY=; b=p8Y60b+aM6+vdAcoAiE3zNyHvr0Z0xeDCl+DxNAeavRNMWRvn8zn5EHGljcmbJX1tZ K5QcjX1tG9a/Ve/rIp0ci+S93noyoA5+0Pt4lNMzFKouzlOGTSF5u66pietKe9msodwG 2rqFBxSrIlUUj8VpuO0lCuU0080A+LY9q9CEnklWUv8JTz34sU8C76LZCdqPuRa9pUyW HkCCtihE95eRWbAEkXHVJ1qrrMM0jCaQvO7y9suSMClzGlPOM7VySL6B7SIQIsR5oigA 9v7K7tAtjknEndvZgPeRLTHKNAv/FdbZslb4yOQ+sfIGduaRHLRoxOn4GP+Tu7o29qPf S8Ig== X-Gm-Message-State: AGi0Puat5ZYk1hdgvxM8hVYJ1Y9GSqZVM8m/YzKN/McpF5FmMA68y9ZE uMq1eUWVIssVODKB6jaG47w= X-Google-Smtp-Source: APiQypJK///yMK//MlGVXI95rUJP2ThVVApFzr/ZXWrKHtfu7S0ahD6+D14m+d9P2wBZjTgKtdp23A== X-Received: by 2002:ac2:43c7:: with SMTP id u7mr6296052lfl.50.1586789502090; Mon, 13 Apr 2020 07:51:42 -0700 (PDT) Original-Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id f4sm2055623lfa.24.2020.04.13.07.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 07:51:41 -0700 (PDT) In-Reply-To: (Philipp Stephani's message of "Mon, 30 Mar 2020 23:25:01 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178309 Archived-At: --=-=-= Content-Type: text/plain 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: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=elp.diff 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.") --=-=-=--