From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vasilij Schneidermann Newsgroups: gmane.emacs.bugs Subject: bug#22114: 24.5; [PATCH] Allow profiler.el to display reports after stopping Date: Tue, 8 Dec 2015 17:32:08 +0100 Message-ID: <20151208163208.GA1080@odonien.bevuta.com> References: <83bna0di5k.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: ger.gmane.org 1449592407 11535 80.91.229.3 (8 Dec 2015 16:33:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Dec 2015 16:33:27 +0000 (UTC) Cc: 22114@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 08 17:33:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a6LCR-0003Hp-KH for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Dec 2015 17:33:11 +0100 Original-Received: from localhost ([::1]:60631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6LCQ-00065d-V8 for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Dec 2015 11:33:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6LCN-00065J-O6 for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 11:33:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6LCI-0007bQ-94 for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 11:33:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6LCI-0007bM-5S for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 11:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a6LCI-000783-00 for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 11:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Vasilij Schneidermann Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Dec 2015 16:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22114 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 22114-submit@debbugs.gnu.org id=B22114.144959235327360 (code B ref 22114); Tue, 08 Dec 2015 16:33:01 +0000 Original-Received: (at 22114) by debbugs.gnu.org; 8 Dec 2015 16:32:33 +0000 Original-Received: from localhost ([127.0.0.1]:43413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a6LBo-00077D-Gv for submit@debbugs.gnu.org; Tue, 08 Dec 2015 11:32:32 -0500 Original-Received: from mail-wm0-f47.google.com ([74.125.82.47]:34998) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a6LBU-00076f-2f for 22114@debbugs.gnu.org; Tue, 08 Dec 2015 11:32:30 -0500 Original-Received: by wmuu63 with SMTP id u63so187886576wmu.0 for <22114@debbugs.gnu.org>; Tue, 08 Dec 2015 08:32:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=klBEmEqd8Dmj6pfcrgaYPMygLguTwmXnpDlhzxLYuTw=; b=xzELctHd5VhZfkFU6L4zidSRlpAjOXevHGLiBdExtO1oUMpiaFQ1jhZaOB7lerZ74g xySl7OqS9IpSryvCNFa9pwsYa5tuFP0BGVnsKW30+rvPKxF+5T/YN5FZerDx40vZAZG9 4PORot13p/0Ebvg6ntqXBZRTRwzcHyFeoRtzRaC/pyAKOMmy1DTIlt5yTxJzlaFAckQs 0xpiWRzE+rZfzafOQsqJNzWchYtp94g3h11vPLGGvLWfed+R5EQOI7MWYrUQ3sr6ath9 8G8yO+72WjiNBEPx+Dsv9E9YhXEhFZmQt0tyDtgWD5FNMMNe83E32lMXevyxfqP2BuMg fzFA== X-Received: by 10.28.21.204 with SMTP id 195mr5286707wmv.17.1449592330897; Tue, 08 Dec 2015 08:32:10 -0800 (PST) Original-Received: from localhost (port-92-204-65-240.dynamic.qsc.de. [92.204.65.240]) by smtp.gmail.com with ESMTPSA id 198sm4172611wmr.18.2015.12.08.08.32.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Dec 2015 08:32:10 -0800 (PST) Content-Disposition: inline In-Reply-To: <83bna0di5k.fsf@gnu.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:109764 Archived-At: > Thanks. But I don't see why we would need to keep a copy of the > profile around (and it looks weird to do that anyway, when we have a > function that reports it). When profiler-cpu-log is called, it > returns the profile before it resets it, so the data is available and > should simply be used. > > I don't really understand why profiler.el insists on having the > profiler running for providing the profile. The much simpler patch > below makes it possible for me to invoke profiler-report whether a > profile is running or not. Does it work for you? If not, can you > tell what I missed? This works only once. If the profiler has been stopped and you retrieve the log, it resets and subsequent access will yield an error. While your variant may be simpler, it is less user-friendly as viewing the report a second time will yield an incomprehensible error. Avoiding this either requires fixing the function retrieving the log (which is at the C level and out of my reach) or using a workaround like the two extra variables in my patch.