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
1eb99619
Commit
1eb99619
authored
Jun 02, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #574 from kmod/linkorder
Add a section-ordering script
parents
c4c58d0d
d8e5b7f6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
7 deletions
+33
-7
CMakeLists.txt
CMakeLists.txt
+7
-1
section_ordering.txt
section_ordering.txt
+20
-0
tools/annotate.py
tools/annotate.py
+2
-1
tools/perf_diff.py
tools/perf_diff.py
+4
-5
No files found.
CMakeLists.txt
View file @
1eb99619
...
...
@@ -45,9 +45,11 @@ if(ENABLE_GOLD)
message
(
STATUS
"found the gold linker
${
GOLD_LINKER
}
"
)
set
(
CMAKE_LINKER
"
${
GOLD_LINKER
}
"
)
set
(
CMAKE_CXX_LINK_FLAGS
"
${
CMAKE_CXX_LINK_FLAGS
}
-B
${
CMAKE_SOURCE_DIR
}
/tools/build_system"
)
set
(
CMAKE_CXX_LINK_FLAGS
"
${
CMAKE_CXX_LINK_FLAGS
}
-Wl,--section-ordering-file,
${
CMAKE_CURRENT_SOURCE_DIR
}
/section_ordering.txt"
)
endif
()
endif
()
# pyston self host mode
if
(
ENABLE_SELF_HOST
)
set
(
PYTHON_EXE
"pyston"
)
...
...
@@ -215,7 +217,11 @@ add_subdirectory(test/test_extension)
add_subdirectory
(
test/unittests
)
add_subdirectory
(
tools
)
add_executable
(
pyston $<TARGET_OBJECTS:PYSTON_MAIN_OBJECT> $<TARGET_OBJECTS:PYSTON_OBJECTS> $<TARGET_OBJECTS:FROM_CPYTHON>
)
# There are supposed to be better ways [1] to add link dependencies, but none of them worked for me.
# [1] http://www.cmake.org/pipermail/cmake/2010-May/037206.html
add_custom_command
(
OUTPUT
${
CMAKE_BINARY_DIR
}
/linkdeps_dummy.c COMMAND
${
CMAKE_COMMAND
}
-E touch
${
CMAKE_BINARY_DIR
}
/linkdeps_dummy.c DEPENDS
${
CMAKE_SOURCE_DIR
}
/section_ordering.txt
)
add_executable
(
pyston $<TARGET_OBJECTS:PYSTON_MAIN_OBJECT> $<TARGET_OBJECTS:PYSTON_OBJECTS> $<TARGET_OBJECTS:FROM_CPYTHON> linkdeps_dummy.c
)
# Wrap the stdlib in --whole-archive to force all the symbols to be included and eventually exported
target_link_libraries
(
pyston -Wl,--whole-archive stdlib -Wl,--no-whole-archive pthread m readline sqlite3 gmp ssl crypto unwind pypa liblz4 double-conversion
${
LLVM_LIBS
}
${
LIBLZMA_LIBRARIES
}
${
OPTIONAL_LIBRARIES
}
)
...
...
section_ordering.txt
0 → 100644
View file @
1eb99619
.text.div_i64_i64
.text.boxInt
.text.boxBool
.text._ZN6pyston2gc10SmallArena6_allocEmi
.text._ZNSt17_Function_handlerIFvPN6pyston2gc10SmallArena16ThreadBlockCacheEEZNS2_12freeUnmarkedERSt6vectorIPNS0_3BoxESaIS8_EEE3$_0E9_M_invokeERKSt9_Any_dataS4_
.text.memset
.text.gc_alloc
.text.gc_realloc
.text._ZN6pyston9BoxedList6ensureEi
.text.PyNumber_AsSsize_t
.text._ZN6pyston15objectNewNoArgsEPNS_10BoxedClassE
.text._PyIndex_Check
.text._ZN6pyston9threading21allowGLReadPreemptionEv
.text._ZN6pyston9getOpNameEi
.text._ZN6pyston8callFuncEPNS_17BoxedFunctionBaseEPNS_15CallRewriteArgsENS_11ArgPassSpecEPNS_3BoxES6_S6_PS6_PKSt6vectorIPKSsSaISA_EE
.text._ZN6pyston2gc9GCVisitor5visitEPv
.text.intLtInt
.text.intModInt
.text.intAddInt
.text.intMulInt
tools/annotate.py
View file @
1eb99619
...
...
@@ -106,6 +106,7 @@ This will typically look like:
Benchmark that was run. '--heap-map-target BENCHMARK' is
equivalent to '--heap-map-args ./pyston_release -i BENCHMARK'.
"""
.
strip
())
parser
.
add_argument
(
"--perf-data"
,
default
=
"perf.data"
)
args
=
parser
.
parse_args
()
func
=
args
.
func_name
...
...
@@ -116,7 +117,7 @@ equivalent to '--heap-map-args ./pyston_release -i BENCHMARK'.
objdump
=
get_objdump
(
func
)
p
=
subprocess
.
Popen
([
"perf"
,
"annotate"
,
"-v"
,
func
],
stdout
=
subprocess
.
PIPE
,
stderr
=
open
(
"/dev/null"
,
"w"
))
p
=
subprocess
.
Popen
([
"perf"
,
"annotate"
,
"-
i"
,
args
.
perf_data
,
"-
v"
,
func
],
stdout
=
subprocess
.
PIPE
,
stderr
=
open
(
"/dev/null"
,
"w"
))
annotate
=
p
.
communicate
()[
0
]
assert
p
.
wait
()
==
0
...
...
tools/perf_diff.py
View file @
1eb99619
...
...
@@ -5,7 +5,7 @@ def tally(fn):
for
l
in
open
(
fn
):
samples
=
int
(
l
.
split
()[
3
])
func
=
l
.
split
()[
-
1
]
func
=
l
.
rsplit
(
']'
,
1
)[
1
].
strip
()
counts
[
func
]
=
counts
.
get
(
func
,
0
)
+
samples
return
counts
...
...
@@ -23,11 +23,10 @@ def main():
diff_thresh
=
(
total1
+
total2
)
/
2
/
100
names
.
sort
(
key
=
lambda
n
:
counts1
.
get
(
n
,
0
)
+
counts2
.
get
(
n
,
0
),
reverse
=
True
)
for
n
in
names
:
names
.
sort
(
key
=
lambda
n
:
abs
(
counts1
.
get
(
n
,
0
)
-
counts2
.
get
(
n
,
0
)
),
reverse
=
True
)
for
n
in
names
[:
10
]
:
c1
=
counts1
.
get
(
n
,
0
)
c2
=
counts2
.
get
(
n
,
0
)
if
abs
(
c1
-
c2
)
>=
diff_thresh
:
print
n
,
counts1
.
get
(
n
,
0
),
counts2
.
get
(
n
,
0
)
if
__name__
==
"__main__"
:
...
...
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