Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9c43910a
Commit
9c43910a
authored
May 14, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- add a dump_stats() method similar to that of the profile.Profile class
- don't use "file" as the name of local variables
parent
c868d16e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
Lib/pstats.py
Lib/pstats.py
+10
-2
No files found.
Lib/pstats.py
View file @
9c43910a
...
...
@@ -158,6 +158,14 @@ class Stats:
self
.
stats
[
func
]
=
add_func_stats
(
old_func_stat
,
stat
)
return
self
def
dump_stats
(
self
,
filename
):
"""Write the profile data to a file we know how to load back."""
f
=
file
(
filename
,
'wb'
)
try
:
marshal
.
dump
(
self
.
stats
,
f
)
finally
:
f
.
close
()
# list the tuple indices and directions for sorting,
# along with some printable description
sort_arg_dict_default
=
{
...
...
@@ -440,8 +448,8 @@ class TupleComp:
# func_name is a triple (file:string, line:int, name:string)
def
func_strip_path
(
func_name
):
file
,
line
,
name
=
func_name
return
os
.
path
.
basename
(
file
),
line
,
name
file
name
,
line
,
name
=
func_name
return
os
.
path
.
basename
(
file
name
),
line
,
name
def
func_get_function_name
(
func
):
return
func
[
2
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment