--- a/eric6/Documentation/Source/eric6.DebugClients.Python.PyProfile.html Wed Sep 25 19:40:31 2019 +0200 +++ b/eric6/Documentation/Source/eric6.DebugClients.Python.PyProfile.html Wed Sep 25 19:42:44 2019 +0200 @@ -18,32 +18,41 @@ </style> </head> -<body><a NAME="top" ID="top"></a> +<body> +<a NAME="top" ID="top"></a> <h1>eric6.DebugClients.Python.PyProfile</h1> + <p> Module defining additions to the standard Python profile.py. </p> <h3>Global Attributes</h3> + <table> <tr><td>None</td></tr> </table> <h3>Classes</h3> + <table> + <tr> <td><a href="#PyProfile">PyProfile</a></td> <td>Class extending the standard Python profiler with additional methods.</td> </tr> </table> <h3>Functions</h3> + <table> <tr><td>None</td></tr> </table> -<hr /><hr /> +<hr /> +<hr /> <a NAME="PyProfile" ID="PyProfile"></a> <h2>PyProfile</h2> + <p> Class extending the standard Python profiler with additional methods. -</p><p> +</p> +<p> This class extends the standard Python profiler by the functionality to save the collected timing data in a timing cache, to restore these data on subsequent calls, to store a profile dump to a standard filename and @@ -52,84 +61,112 @@ <h3>Derived from</h3> profile.Profile <h3>Class Attributes</h3> + <table> <tr><td>dispatch</td></tr> </table> <h3>Class Methods</h3> + <table> <tr><td>None</td></tr> </table> <h3>Methods</h3> + <table> + <tr> <td><a href="#PyProfile.__init__">PyProfile</a></td> <td>Constructor</td> -</tr><tr> +</tr> +<tr> <td><a href="#PyProfile.__restore">__restore</a></td> <td>Private method to restore the timing data from the timing cache.</td> -</tr><tr> +</tr> +<tr> <td><a href="#PyProfile.dump_stats">dump_stats</a></td> <td>Public method to dump the statistics data.</td> -</tr><tr> +</tr> +<tr> <td><a href="#PyProfile.erase">erase</a></td> <td>Public method to erase the collected timing data.</td> -</tr><tr> +</tr> +<tr> <td><a href="#PyProfile.fix_frame_filename">fix_frame_filename</a></td> <td>Public method used to fixup the filename for a given frame.</td> -</tr><tr> +</tr> +<tr> <td><a href="#PyProfile.save">save</a></td> <td>Public method to store the collected profile data.</td> -</tr><tr> +</tr> +<tr> <td><a href="#PyProfile.trace_dispatch_call">trace_dispatch_call</a></td> <td>Public method used to trace functions calls.</td> </tr> </table> <h3>Static Methods</h3> + <table> <tr><td>None</td></tr> </table> + <a NAME="PyProfile.__init__" ID="PyProfile.__init__"></a> <h4>PyProfile (Constructor)</h4> <b>PyProfile</b>(<i>basename, timer=None, bias=None</i>) + <p> Constructor -</p><dl> +</p> +<dl> + <dt><i>basename</i></dt> <dd> name of the script to be profiled (string) -</dd><dt><i>timer</i></dt> +</dd> +<dt><i>timer</i></dt> <dd> function defining the timing calculation -</dd><dt><i>bias</i></dt> +</dd> +<dt><i>bias</i></dt> <dd> calibration value (float) </dd> -</dl><a NAME="PyProfile.__restore" ID="PyProfile.__restore"></a> +</dl> +<a NAME="PyProfile.__restore" ID="PyProfile.__restore"></a> <h4>PyProfile.__restore</h4> <b>__restore</b>(<i></i>) + <p> Private method to restore the timing data from the timing cache. -</p><a NAME="PyProfile.dump_stats" ID="PyProfile.dump_stats"></a> +</p> +<a NAME="PyProfile.dump_stats" ID="PyProfile.dump_stats"></a> <h4>PyProfile.dump_stats</h4> <b>dump_stats</b>(<i>file</i>) + <p> Public method to dump the statistics data. -</p><dl> +</p> +<dl> + <dt><i>file</i></dt> <dd> name of the file to write to (string) </dd> -</dl><a NAME="PyProfile.erase" ID="PyProfile.erase"></a> +</dl> +<a NAME="PyProfile.erase" ID="PyProfile.erase"></a> <h4>PyProfile.erase</h4> <b>erase</b>(<i></i>) + <p> Public method to erase the collected timing data. -</p><a NAME="PyProfile.fix_frame_filename" ID="PyProfile.fix_frame_filename"></a> +</p> +<a NAME="PyProfile.fix_frame_filename" ID="PyProfile.fix_frame_filename"></a> <h4>PyProfile.fix_frame_filename</h4> <b>fix_frame_filename</b>(<i>frame</i>) + <p> Public method used to fixup the filename for a given frame. -</p><p> +</p> +<p> The logic employed here is that if a module was loaded from a .pyc file, then the correct .py to operate with should be in the same path as the .pyc. The reason this @@ -140,38 +177,50 @@ this can break debugging as the .pyc will refer to the .py on the original machine. Another case might be sharing code over a network... This logic deals with that. -</p><dl> +</p> +<dl> + <dt><i>frame</i></dt> <dd> the frame object </dd> -</dl><dl> +</dl> +<dl> <dt>Returns:</dt> <dd> fixed up file name (string) </dd> -</dl><a NAME="PyProfile.save" ID="PyProfile.save"></a> +</dl> +<a NAME="PyProfile.save" ID="PyProfile.save"></a> <h4>PyProfile.save</h4> <b>save</b>(<i></i>) + <p> Public method to store the collected profile data. -</p><a NAME="PyProfile.trace_dispatch_call" ID="PyProfile.trace_dispatch_call"></a> +</p> +<a NAME="PyProfile.trace_dispatch_call" ID="PyProfile.trace_dispatch_call"></a> <h4>PyProfile.trace_dispatch_call</h4> <b>trace_dispatch_call</b>(<i>frame, t</i>) + <p> Public method used to trace functions calls. -</p><p> +</p> +<p> This is a variant of the one found in the standard Python profile.py calling fix_frame_filename above. -</p><dl> +</p> +<dl> + <dt><i>frame</i></dt> <dd> reference to the call frame -</dd><dt><i>t</i></dt> +</dd> +<dt><i>t</i></dt> <dd> arguments </dd> -</dl><dl> +</dl> +<dl> <dt>Returns:</dt> <dd> flag indicating a successful handling (boolean)