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 09:13:58 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a11c13aa843a1d105265e8e45 X-Trace: ger.gmane.org 1449562516 29928 80.91.229.3 (8 Dec 2015 08:15:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Dec 2015 08:15:16 +0000 (UTC) To: 22114@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 08 09:15:09 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 1a6DQS-0006jY-6P for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Dec 2015 09:15:08 +0100 Original-Received: from localhost ([::1]:58435 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6DQR-0006oX-Er for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Dec 2015 03:15:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6DQN-0006nv-Vl for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 03:15:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6DQM-00035Y-L4 for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 03:15:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6DQM-00035O-Hd for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 03:15:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a6DQM-0000DH-7h for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 03:15: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 08:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22114 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1449562446725 (code B ref -1); Tue, 08 Dec 2015 08:15:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 8 Dec 2015 08:14:06 +0000 Original-Received: from localhost ([127.0.0.1]:42298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a6DPS-0000Bd-00 for submit@debbugs.gnu.org; Tue, 08 Dec 2015 03:14:06 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60756) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a6DPP-0000BV-UB for submit@debbugs.gnu.org; Tue, 08 Dec 2015 03:14:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6DPO-0002vU-FU for submit@debbugs.gnu.org; Tue, 08 Dec 2015 03:14:03 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39840) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6DPO-0002vQ-D6 for submit@debbugs.gnu.org; Tue, 08 Dec 2015 03:14:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6DPN-0006ft-0w for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 03:14:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6DPL-0002v6-Qu for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 03:14:00 -0500 Original-Received: from mail-qg0-x22f.google.com ([2607:f8b0:400d:c04::22f]:33071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6DPL-0002v2-LZ for bug-gnu-emacs@gnu.org; Tue, 08 Dec 2015 03:13:59 -0500 Original-Received: by qgea14 with SMTP id a14so10032891qge.0 for ; Tue, 08 Dec 2015 00:13:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=RQpIBLmgRBsfx5XDFb6Rkkat5V1kU6pRKG1XhBgB90c=; b=F2If4zv804002kvbjPBJpx1FixqHYfE4P3BHdWwIlkVzOkXA3D4mvwLeHJHntz6jTq qA2uLvRy50XPAnuH3Bwyp1gzurI2KGJUXcIK6u42GtumN/b+4rG/gYmW6hbVyHGCSQAq 3Pv4PNeWruGEcXn2tjd5T07s3JnRSrNR4psgKhDGSeBJcyOqskqnfMXtn2JBrjRH8y06 AzbM7zpOMC/uLm78VSRNcdlqezl6bLK/qSdTOgNLwcmxnnH7KVYPxhU6pgC6vnYMzoyd sPuIf3SEdFVVS/tKrBl9GUOJYmMHADo1bafv8S6/d19ZSo+FA8gOZ/puPy/S7VvJkjlP 48HQ== X-Received: by 10.140.27.228 with SMTP id 91mr2876346qgx.78.1449562439117; Tue, 08 Dec 2015 00:13:59 -0800 (PST) Original-Received: by 10.55.42.34 with HTTP; Tue, 8 Dec 2015 00:13:58 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:109751 Archived-At: --001a11c13aa843a1d105265e8e45 Content-Type: multipart/alternative; boundary=001a11c13aa843a1cc05265e8e43 --001a11c13aa843a1cc05265e8e43 Content-Type: text/plain; charset=UTF-8 I've worked with a few other profilers than profiler.el so far and one striking difference is that they allowed you to start a profiling run, stop it and then retrieve the profiling log between these two points in time. profiler.el on the other hand flatout refuses to display a report after stopping which is especially puzzling given the `profiler-stop` docstring: "Stop started profilers. Profiler logs will be kept." If the logs are kept after all, why can't I take a look at them? I've attached a patch that solves this by caching the last accessable profiler log. This allows both workflows to work, be it displaying a report while the profiler is still running or displaying it after stopping the profiler. --001a11c13aa843a1cc05265e8e43 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I've worked with a few other profilers than profiler.e= l so far and one
striking difference is that they allowed you to start a= profiling run,
stop it and then retrieve the profiling log between thes= e two points in
time. =C2=A0profiler.el on the other hand flatout refuse= s to display a report
after stopping which is especially puzzling given = the `profiler-stop`
docstring: "Stop started profilers.=C2=A0 Profi= ler logs will be kept." =C2=A0If
the logs are kept after all, why c= an't I take a look at them?

I've attached a patch that solve= s this by caching the last accessable
profiler log.=C2=A0 This allows bo= th workflows to work, be it displaying a
report while the profiler is st= ill running or displaying it after
stopping the profiler.
--001a11c13aa843a1cc05265e8e43-- --001a11c13aa843a1d105265e8e45 Content-Type: text/x-diff; charset=US-ASCII; name="0001-Allow-for-retrieving-profiler-logs-after-stopping.patch" Content-Disposition: attachment; filename="0001-Allow-for-retrieving-profiler-logs-after-stopping.patch" Content-Transf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