Documentation/Source/eric5.DebugClients.Python3.PyProfile.html

changeset 58
37f0444c3479
parent 21
b88a0e6268bd
child 409
0ea528e80202
--- a/Documentation/Source/eric5.DebugClients.Python3.PyProfile.html	Thu Jan 14 17:27:31 2010 +0000
+++ b/Documentation/Source/eric5.DebugClients.Python3.PyProfile.html	Thu Jan 14 18:35:52 2010 +0000
@@ -22,7 +22,7 @@
 <body><a NAME="top" ID="top"></a>
 <h1>eric5.DebugClients.Python3.PyProfile</h1>
 <p>
-&#77;&#111;&#100;&#117;&#108;&#101; &#100;&#101;&#102;&#105;&#110;&#105;&#110;&#103; &#97;&#100;&#100;&#105;&#116;&#105;&#111;&#110;&#115; &#116;&#111; &#116;&#104;&#101; &#115;&#116;&#97;&#110;&#100;&#97;&#114;&#100; &#80;y&#116;&#104;&#111;&#110; &#112;&#114;&#111;&#102;&#105;&#108;&#101;.&#112;y.
+Module defining additions to the standard Python profile.py.
 </p>
 <h3>Global Attributes</h3>
 <table>
@@ -32,7 +32,7 @@
 <table>
 <tr>
 <td><a href="#PyProfile">PyProfile</a></td>
-<td>&#67;&#108;&#97;&#115;&#115; &#101;x&#116;&#101;&#110;&#100;&#105;&#110;&#103; &#116;&#104;&#101; &#115;&#116;&#97;&#110;&#100;&#97;&#114;&#100; &#80;y&#116;&#104;&#111;&#110; &#112;&#114;&#111;&#102;&#105;&#108;&#101;&#114; w&#105;&#116;&#104; &#97;&#100;&#100;&#105;&#116;&#105;&#111;&#110;&#97;&#108; &#109;&#101;&#116;&#104;&#111;&#100;&#115;.</td>
+<td>Class extending the standard Python profiler with additional methods.</td>
 </tr>
 </table>
 <h3>Functions</h3>
@@ -43,12 +43,12 @@
 <a NAME="PyProfile" ID="PyProfile"></a>
 <h2>PyProfile</h2>
 <p>
-    &#67;&#108;&#97;&#115;&#115; &#101;x&#116;&#101;&#110;&#100;&#105;&#110;&#103; &#116;&#104;&#101; &#115;&#116;&#97;&#110;&#100;&#97;&#114;&#100; &#80;y&#116;&#104;&#111;&#110; &#112;&#114;&#111;&#102;&#105;&#108;&#101;&#114; w&#105;&#116;&#104; &#97;&#100;&#100;&#105;&#116;&#105;&#111;&#110;&#97;&#108; &#109;&#101;&#116;&#104;&#111;&#100;&#115;.
+    Class extending the standard Python profiler with additional methods.
 </p><p>
-    &#84;&#104;&#105;&#115; &#99;&#108;&#97;&#115;&#115; &#101;x&#116;&#101;&#110;&#100;&#115; &#116;&#104;&#101; &#115;&#116;&#97;&#110;&#100;&#97;&#114;&#100; &#80;y&#116;&#104;&#111;&#110; &#112;&#114;&#111;&#102;&#105;&#108;&#101;&#114; &#98;y &#116;&#104;&#101; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110;&#97;&#108;&#105;&#116;y &#116;&#111;
-    &#115;&#97;v&#101; &#116;&#104;&#101; &#99;&#111;&#108;&#108;&#101;&#99;&#116;&#101;&#100; &#116;&#105;&#109;&#105;&#110;&#103; &#100;&#97;&#116;&#97; &#105;&#110; &#97; &#116;&#105;&#109;&#105;&#110;&#103; &#99;&#97;&#99;&#104;&#101;, &#116;&#111; &#114;&#101;&#115;&#116;&#111;&#114;&#101; &#116;&#104;&#101;&#115;&#101; &#100;&#97;&#116;&#97;
-    &#111;&#110; &#115;&#117;&#98;&#115;&#101;&#113;&#117;&#101;&#110;&#116; &#99;&#97;&#108;&#108;&#115;, &#116;&#111; &#115;&#116;&#111;&#114;&#101; &#97; &#112;&#114;&#111;&#102;&#105;&#108;&#101; &#100;&#117;&#109;&#112; &#116;&#111; &#97; &#115;&#116;&#97;&#110;&#100;&#97;&#114;&#100; &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; &#97;&#110;&#100; 
-    &#116;&#111; &#101;&#114;&#97;&#115;&#101; &#116;&#104;&#101;&#115;&#101; &#99;&#97;&#99;&#104;&#101;&#115;.
+    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 
+    to erase these caches.
 </p>
 <h3>Derived from</h3>
 profile.Profile
@@ -60,97 +60,97 @@
 <table>
 <tr>
 <td><a href="#PyProfile.__init__">PyProfile</a></td>
-<td>&#67;&#111;&#110;&#115;&#116;&#114;&#117;&#99;&#116;&#111;&#114;</td>
+<td>Constructor</td>
 </tr><tr>
 <td><a href="#PyProfile.__restore">__restore</a></td>
-<td>&#80;&#114;&#105;v&#97;&#116;&#101; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#114;&#101;&#115;&#116;&#111;&#114;&#101; &#116;&#104;&#101; &#116;&#105;&#109;&#105;&#110;&#103; &#100;&#97;&#116;&#97; &#102;&#114;&#111;&#109; &#116;&#104;&#101; &#116;&#105;&#109;&#105;&#110;&#103; &#99;&#97;&#99;&#104;&#101;.</td>
+<td>Private method to restore the timing data from the timing cache.</td>
 </tr><tr>
 <td><a href="#PyProfile.dump_stats">dump_stats</a></td>
-<td>&#80;&#117;&#98;&#108;&#105;&#99; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#100;&#117;&#109;&#112; &#116;&#104;&#101; &#115;&#116;&#97;&#116;&#105;&#115;&#116;&#105;&#99;&#115; &#100;&#97;&#116;&#97;.</td>
+<td>Public method to dump the statistics data.</td>
 </tr><tr>
 <td><a href="#PyProfile.erase">erase</a></td>
-<td>&#80;&#117;&#98;&#108;&#105;&#99; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#101;&#114;&#97;&#115;&#101; &#116;&#104;&#101; &#99;&#111;&#108;&#108;&#101;&#99;&#116;&#101;&#100; &#116;&#105;&#109;&#105;&#110;&#103; &#100;&#97;&#116;&#97;.</td>
+<td>Public method to erase the collected timing data.</td>
 </tr><tr>
 <td><a href="#PyProfile.fix_frame_filename">fix_frame_filename</a></td>
-<td>&#80;&#117;&#98;&#108;&#105;&#99; &#109;&#101;&#116;&#104;&#111;&#100; &#117;&#115;&#101;&#100; &#116;&#111; &#102;&#105;x&#117;&#112; &#116;&#104;&#101; &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; &#102;&#111;&#114; &#97; &#103;&#105;v&#101;&#110; &#102;&#114;&#97;&#109;&#101;.</td>
+<td>Public method used to fixup the filename for a given frame.</td>
 </tr><tr>
 <td><a href="#PyProfile.save">save</a></td>
-<td>&#80;&#117;&#98;&#108;&#105;&#99; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#115;&#116;&#111;&#114;&#101; &#116;&#104;&#101; &#99;&#111;&#108;&#108;&#101;&#99;&#116;&#101;&#100; &#112;&#114;&#111;&#102;&#105;&#108;&#101; &#100;&#97;&#116;&#97;.</td>
+<td>Public method to store the collected profile data.</td>
 </tr><tr>
 <td><a href="#PyProfile.trace_dispatch_call">trace_dispatch_call</a></td>
-<td>&#80;&#114;&#105;v&#97;&#116;&#101; &#109;&#101;&#116;&#104;&#111;&#100; &#117;&#115;&#101;&#100; &#116;&#111; &#116;&#114;&#97;&#99;&#101; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110;&#115; &#99;&#97;&#108;&#108;&#115;.</td>
+<td>Private method used to trace functions calls.</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>
-        &#67;&#111;&#110;&#115;&#116;&#114;&#117;&#99;&#116;&#111;&#114;
+        Constructor
 </p><dl>
 <dt><i>basename</i></dt>
 <dd>
-&#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#115;&#99;&#114;&#105;&#112;&#116; &#116;&#111; &#98;&#101; &#112;&#114;&#111;&#102;&#105;&#108;&#101;&#100; (&#115;&#116;&#114;&#105;&#110;&#103;)
+name of the script to be profiled (string)
 </dd><dt><i>timer</i></dt>
 <dd>
-&#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110; &#100;&#101;&#102;&#105;&#110;&#105;&#110;&#103; &#116;&#104;&#101; &#116;&#105;&#109;&#105;&#110;&#103; &#99;&#97;&#108;&#99;&#117;&#108;&#97;&#116;&#105;&#111;&#110;
+function defining the timing calculation
 </dd><dt><i>bias</i></dt>
 <dd>
-&#99;&#97;&#108;&#105;&#98;&#114;&#97;&#116;&#105;&#111;&#110; v&#97;&#108;&#117;&#101; (&#102;&#108;&#111;&#97;&#116;)
+calibration value (float)
 </dd>
 </dl><a NAME="PyProfile.__restore" ID="PyProfile.__restore"></a>
 <h4>PyProfile.__restore</h4>
 <b>__restore</b>(<i></i>)
 <p>
-        &#80;&#114;&#105;v&#97;&#116;&#101; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#114;&#101;&#115;&#116;&#111;&#114;&#101; &#116;&#104;&#101; &#116;&#105;&#109;&#105;&#110;&#103; &#100;&#97;&#116;&#97; &#102;&#114;&#111;&#109; &#116;&#104;&#101; &#116;&#105;&#109;&#105;&#110;&#103; &#99;&#97;&#99;&#104;&#101;.
+        Private method to restore the timing data from the timing cache.
 </p><a NAME="PyProfile.dump_stats" ID="PyProfile.dump_stats"></a>
 <h4>PyProfile.dump_stats</h4>
 <b>dump_stats</b>(<i>file</i>)
 <p>
-        &#80;&#117;&#98;&#108;&#105;&#99; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#100;&#117;&#109;&#112; &#116;&#104;&#101; &#115;&#116;&#97;&#116;&#105;&#115;&#116;&#105;&#99;&#115; &#100;&#97;&#116;&#97;.
+        Public method to dump the statistics data.
 </p><dl>
 <dt><i>file</i></dt>
 <dd>
-&#110;&#97;&#109;&#101; &#111;&#102; &#116;&#104;&#101; &#102;&#105;&#108;&#101; &#116;&#111; w&#114;&#105;&#116;&#101; &#116;&#111; (&#115;&#116;&#114;&#105;&#110;&#103;)
+name of the file to write to (string)
 </dd>
 </dl><a NAME="PyProfile.erase" ID="PyProfile.erase"></a>
 <h4>PyProfile.erase</h4>
 <b>erase</b>(<i></i>)
 <p>
-        &#80;&#117;&#98;&#108;&#105;&#99; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#101;&#114;&#97;&#115;&#101; &#116;&#104;&#101; &#99;&#111;&#108;&#108;&#101;&#99;&#116;&#101;&#100; &#116;&#105;&#109;&#105;&#110;&#103; &#100;&#97;&#116;&#97;.
+        Public method to erase the collected timing data.
 </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>
-        &#80;&#117;&#98;&#108;&#105;&#99; &#109;&#101;&#116;&#104;&#111;&#100; &#117;&#115;&#101;&#100; &#116;&#111; &#102;&#105;x&#117;&#112; &#116;&#104;&#101; &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; &#102;&#111;&#114; &#97; &#103;&#105;v&#101;&#110; &#102;&#114;&#97;&#109;&#101;.
+        Public method used to fixup the filename for a given frame.
 </p><p>
-        &#84;&#104;&#101; &#108;&#111;&#103;&#105;&#99; &#101;&#109;&#112;&#108;&#111;y&#101;&#100; &#104;&#101;&#114;&#101; &#105;&#115; &#116;&#104;&#97;&#116; &#105;&#102; &#97; &#109;&#111;&#100;&#117;&#108;&#101; w&#97;&#115; &#108;&#111;&#97;&#100;&#101;&#100;
-        &#102;&#114;&#111;&#109; &#97; .&#112;y&#99; &#102;&#105;&#108;&#101;, &#116;&#104;&#101;&#110; &#116;&#104;&#101; &#99;&#111;&#114;&#114;&#101;&#99;&#116; .&#112;y &#116;&#111; &#111;&#112;&#101;&#114;&#97;&#116;&#101; w&#105;&#116;&#104;
-        &#115;&#104;&#111;&#117;&#108;&#100; &#98;&#101; &#105;&#110; &#116;&#104;&#101; &#115;&#97;&#109;&#101; &#112;&#97;&#116;&#104; &#97;&#115; &#116;&#104;&#101; .&#112;y&#99;. &#84;&#104;&#101; &#114;&#101;&#97;&#115;&#111;&#110; &#116;&#104;&#105;&#115;
-        &#108;&#111;&#103;&#105;&#99; &#105;&#115; &#110;&#101;&#101;&#100;&#101;&#100; &#105;&#115; &#116;&#104;&#97;&#116; w&#104;&#101;&#110; &#97; .&#112;y&#99; &#102;&#105;&#108;&#101; &#105;&#115; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#101;&#100;, &#116;&#104;&#101;
-        &#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; &#101;&#109;&#98;&#101;&#100;&#100;&#101;&#100; &#97;&#110;&#100; &#116;&#104;&#117;&#115; w&#104;&#97;&#116; &#105;&#115; &#114;&#101;&#97;&#100;&#97;&#98;&#108;&#101; &#105;&#110; &#116;&#104;&#101; &#99;&#111;&#100;&#101; &#111;&#98;&#106;&#101;&#99;&#116;
-        &#111;&#102; &#116;&#104;&#101; &#102;&#114;&#97;&#109;&#101; &#111;&#98;&#106;&#101;&#99;&#116; &#105;&#115; &#116;&#104;&#101; &#102;&#117;&#108;&#108;y &#113;&#117;&#97;&#108;&#105;&#102;&#105;&#101;&#100; &#102;&#105;&#108;&#101;&#112;&#97;&#116;&#104; w&#104;&#101;&#110; &#116;&#104;&#101;
-        &#112;y&#99; &#105;&#115; &#103;&#101;&#110;&#101;&#114;&#97;&#116;&#101;&#100;. &#73;&#102; &#102;&#105;&#108;&#101;&#115; &#97;&#114;&#101; &#109;&#111;v&#101;&#100; &#102;&#114;&#111;&#109; &#109;&#97;&#99;&#104;&#105;&#110;&#101; &#116;&#111; &#109;&#97;&#99;&#104;&#105;&#110;&#101;
-        &#116;&#104;&#105;&#115; &#99;&#97;&#110; &#98;&#114;&#101;&#97;&#107; &#100;&#101;&#98;&#117;&#103;&#103;&#105;&#110;&#103; &#97;&#115; &#116;&#104;&#101; .&#112;y&#99; w&#105;&#108;&#108; &#114;&#101;&#102;&#101;&#114; &#116;&#111; &#116;&#104;&#101; .&#112;y
-        &#111;&#110; &#116;&#104;&#101; &#111;&#114;&#105;&#103;&#105;&#110;&#97;&#108; &#109;&#97;&#99;&#104;&#105;&#110;&#101;. &#65;&#110;&#111;&#116;&#104;&#101;&#114; &#99;&#97;&#115;&#101; &#109;&#105;&#103;&#104;&#116; &#98;&#101; &#115;&#104;&#97;&#114;&#105;&#110;&#103;
-        &#99;&#111;&#100;&#101; &#111;v&#101;&#114; &#97; &#110;&#101;&#116;w&#111;&#114;&#107;... &#84;&#104;&#105;&#115; &#108;&#111;&#103;&#105;&#99; &#100;&#101;&#97;&#108;&#115; w&#105;&#116;&#104; &#116;&#104;&#97;&#116;.
+        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
+        logic is needed is that when a .pyc file is generated, the
+        filename embedded and thus what is readable in the code object
+        of the frame object is the fully qualified filepath when the
+        pyc is generated. If files are moved from machine to machine
+        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>
 <dt><i>frame</i></dt>
 <dd>
-&#116;&#104;&#101; &#102;&#114;&#97;&#109;&#101; &#111;&#98;&#106;&#101;&#99;&#116;
+the frame object
 </dd>
 </dl><a NAME="PyProfile.save" ID="PyProfile.save"></a>
 <h4>PyProfile.save</h4>
 <b>save</b>(<i></i>)
 <p>
-        &#80;&#117;&#98;&#108;&#105;&#99; &#109;&#101;&#116;&#104;&#111;&#100; &#116;&#111; &#115;&#116;&#111;&#114;&#101; &#116;&#104;&#101; &#99;&#111;&#108;&#108;&#101;&#99;&#116;&#101;&#100; &#112;&#114;&#111;&#102;&#105;&#108;&#101; &#100;&#97;&#116;&#97;.
+        Public method to store the collected profile data.
 </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>
-        &#80;&#114;&#105;v&#97;&#116;&#101; &#109;&#101;&#116;&#104;&#111;&#100; &#117;&#115;&#101;&#100; &#116;&#111; &#116;&#114;&#97;&#99;&#101; &#102;&#117;&#110;&#99;&#116;&#105;&#111;&#110;&#115; &#99;&#97;&#108;&#108;&#115;.
+        Private method used to trace functions calls.
 </p><p>
-        &#84;&#104;&#105;&#115; &#105;&#115; &#97; v&#97;&#114;&#105;&#97;&#110;&#116; &#111;&#102; &#116;&#104;&#101; &#111;&#110;&#101; &#102;&#111;&#117;&#110;&#100; &#105;&#110; &#116;&#104;&#101; &#115;&#116;&#97;&#110;&#100;&#97;&#114;&#100; &#80;y&#116;&#104;&#111;&#110;
-        &#112;&#114;&#111;&#102;&#105;&#108;&#101;.&#112;y &#99;&#97;&#108;&#108;&#105;&#110;&#103; &#102;&#105;x&#95;&#102;&#114;&#97;&#109;&#101;&#95;&#102;&#105;&#108;&#101;&#110;&#97;&#109;&#101; &#97;&#98;&#111;v&#101;.
+        This is a variant of the one found in the standard Python
+        profile.py calling fix_frame_filename above.
 </p>
 <div align="right"><a href="#top">Up</a></div>
 <hr />

eric ide

mercurial