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 Planned Release:  9.2.0
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

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.savann ... /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>

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

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

    Votes

    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.

     

    History

    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
        Planned ReleaseNone 9.2.0

    Back to the top

    Powered by Savane 3.16.
    Corresponding source code