bugGNU Octave - Bugs: bug #65595, profile on does not clear old...

 
 

bug #65595: profile on does not clear old profiling data

Submitter:  Lars Kindermann <larskindermann>
Submitted:  Mon 15 Apr 2024 05:07:23 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * stable Operating System:  * GNU/Linux
Fixed Release:  9.2.0 (current stable) Planned Release:  9.2.0 (current stable)
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 19 Apr 2024 01:53:21 AM UTC, comment #1: 

I checked in the change on the stable branch where it will be part of the 9.2.0 release.  See https://hg.savannah.gnu.org/hgweb/octave/rev/25faa5446214.

Marking as Fixed and closing report.

Rik <rik5>
Group administrator
Mon 15 Apr 2024 05:07:23 AM UTC, original submission:  

"profile on" does not clear old profiling data as described in the docs.
You currently have to use "profile clear" in addition as a workaround:

>> profile clear;

>> profile on; log(1:100000000); profile off; profshow (1)
   # Function Attr     Time (s)   Time (%)        Calls
-------------------------------------------------------
   1      log             3.940     100.00            1

>> profile on; log(1:100000000); profile off; profshow (1)
   # Function Attr     Time (s)   Time (%)        Calls
-------------------------------------------------------
   1      log             7.133     100.00            2

>> profile on; log(1:100000000); profile off; profshow (1)
   # Function Attr     Time (s)   Time (%)        Calls
-------------------------------------------------------
   1      log            10.478     100.00            3

>> profile clear;

>> profile on; log(1:100000000); profile off; profshow (1)
   # Function Attr     Time (s)   Time (%)        Calls
-------------------------------------------------------
   1      log             3.124     100.00            1


Reason: In profile.m both cases for "on" and "resume" are handled identically:

switch (arg)
    case "on"
      __profiler_enable__ (true);

    case "off"
      __profiler_enable__ (false);

    case "clear"
      __profiler_reset__ ();

    case "resume"
      __profiler_enable__ (true);


Fix: Simply change the "on" case in profile.m if you don't want to touch the C code:

    case "on"
      if __profiler_enable__ ()
        __profiler_enable__ (false);
      endif
      __profiler_reset__ ();
      __profiler_enable__ (true);


Lars Kindermann <larskindermann>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by larskindermann (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-04-19 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
        Releasedev stable
        Fixed ReleaseNone 9.2.0 (current stable)
        Planned ReleaseNone 9.2.0 (current stable)

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code