Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
1b0a6ccd
Commit
1b0a6ccd
authored
Feb 23, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some arg parsing
parent
c12f8723
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
tools/annotate.py
tools/annotate.py
+22
-3
No files found.
tools/annotate.py
View file @
1b0a6ccd
import
argparse
import
commands
import
os
import
re
...
...
@@ -39,7 +40,6 @@ def lookupAsSymbol(n):
_heap_proc
=
None
heapmap_args
=
None
# heapmap_args = ["./pyston_release", "-i", "minibenchmarks/fasta.py"]
def
lookupAsHeapAddr
(
n
):
global
_heap_proc
if
_heap_proc
is
None
:
...
...
@@ -93,7 +93,26 @@ if __name__ == "__main__":
# first function in the profile (the one in which the plurality of
# the time is spent)?
func
=
sys
.
argv
[
1
]
parser
=
argparse
.
ArgumentParser
(
formatter_class
=
argparse
.
RawTextHelpFormatter
)
parser
.
add_argument
(
"func_name"
,
metavar
=
"FUNC_NAME"
)
parser
.
add_argument
(
"--collapse-nops"
,
dest
=
"collapse_nops"
,
action
=
"store_true"
,
default
=
True
)
parser
.
add_argument
(
"--no-collapse-nops"
,
dest
=
"collapse_nops"
,
action
=
"store_false"
)
parser
.
add_argument
(
"--heap-map-args"
,
nargs
=
'+'
,
help
=
"""
Command to run that will provide heap map information.
This will typically look like:
--heap-map-args ./pyston_release -i BENCHMARK
"""
.
strip
())
parser
.
add_argument
(
"--heap-map-target"
,
help
=
"""
Benchmark that was run. '--heap-map-target BENCHMARK' is
equivalent to '--heap-map-args ./pyston_release -i BENCHMARK'.
"""
.
strip
())
args
=
parser
.
parse_args
()
func
=
args
.
func_name
if
args
.
heap_map_args
:
heapmap_args
=
args
.
heap_map_args
elif
args
.
heap_map_target
:
heapmap_args
=
[
"./pyston_release"
,
"-i"
,
args
.
heap_map_target
]
objdump
=
get_objdump
(
func
)
...
...
@@ -124,7 +143,7 @@ if __name__ == "__main__":
extra
=
lookupConstant
(
n
)
if
l
.
endswith
(
"
\
t
nop"
):
if
args
.
collapse_nops
and
l
.
endswith
(
"
\
t
nop"
):
addr
=
l
.
split
()[
0
][:
-
1
]
if
not
nops
:
nops
=
(
count
,
1
,
addr
,
addr
)
...
...
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