Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
hg-git
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
hg-git
Commits
93cf9931
Commit
93cf9931
authored
15 years ago
by
Abderrahim Kitouni
Browse files
Options
Downloads
Patches
Plain Diff
remove leftover lsprofcalltree.py (we can use hg --profile)
parent
e331d19f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lsprofcalltree.py
+0
-70
0 additions, 70 deletions
lsprofcalltree.py
with
0 additions
and
70 deletions
lsprofcalltree.py
deleted
100644 → 0
+
0
−
70
View file @
e331d19f
def
label
(
code
):
if
isinstance
(
code
,
str
):
return
(
'
~
'
,
0
,
code
)
# built-in functions ('~' sorts at the end)
else
:
return
'
%s %s:%d
'
%
(
code
.
co_name
,
code
.
co_filename
,
code
.
co_firstlineno
)
class
KCacheGrind
(
object
):
def
__init__
(
self
,
profiler
):
self
.
data
=
profiler
.
getstats
()
self
.
out_file
=
None
def
output
(
self
,
out_file
):
self
.
out_file
=
out_file
print
>>
out_file
,
'
events: Ticks
'
self
.
_print_summary
()
for
entry
in
self
.
data
:
self
.
_entry
(
entry
)
def
_print_summary
(
self
):
max_cost
=
0
for
entry
in
self
.
data
:
totaltime
=
int
(
entry
.
totaltime
*
1000
)
max_cost
=
max
(
max_cost
,
totaltime
)
print
>>
self
.
out_file
,
'
summary: %d
'
%
(
max_cost
,)
def
_entry
(
self
,
entry
):
out_file
=
self
.
out_file
code
=
entry
.
code
inlinetime
=
int
(
entry
.
inlinetime
*
1000
)
#print >> out_file, 'ob=%s' % (code.co_filename,)
if
isinstance
(
code
,
str
):
print
>>
out_file
,
'
fi=~
'
else
:
print
>>
out_file
,
'
fi=%s
'
%
(
code
.
co_filename
,)
print
>>
out_file
,
'
fn=%s
'
%
(
label
(
code
),)
if
isinstance
(
code
,
str
):
print
>>
out_file
,
'
0
'
,
inlinetime
else
:
print
>>
out_file
,
'
%d %d
'
%
(
code
.
co_firstlineno
,
inlinetime
)
# recursive calls are counted in entry.calls
if
entry
.
calls
:
calls
=
entry
.
calls
else
:
calls
=
[]
if
isinstance
(
code
,
str
):
lineno
=
0
else
:
lineno
=
code
.
co_firstlineno
for
subentry
in
calls
:
self
.
_subentry
(
lineno
,
subentry
)
print
>>
out_file
def
_subentry
(
self
,
lineno
,
subentry
):
out_file
=
self
.
out_file
code
=
subentry
.
code
totaltime
=
int
(
subentry
.
totaltime
*
1000
)
#print >> out_file, 'cob=%s' % (code.co_filename,)
print
>>
out_file
,
'
cfn=%s
'
%
(
label
(
code
),)
if
isinstance
(
code
,
str
):
print
>>
out_file
,
'
cfi=~
'
print
>>
out_file
,
'
calls=%d 0
'
%
(
subentry
.
callcount
,)
else
:
print
>>
out_file
,
'
cfi=%s
'
%
(
code
.
co_filename
,)
print
>>
out_file
,
'
calls=%d %d
'
%
(
subentry
.
callcount
,
code
.
co_firstlineno
)
print
>>
out_file
,
'
%d %d
'
%
(
lineno
,
totaltime
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment