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
2afd421b
Commit
2afd421b
authored
Jun 16, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more grwl experiments
parent
87202332
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
42 additions
and
12 deletions
+42
-12
.gitignore
.gitignore
+3
-0
src/Makefile
src/Makefile
+8
-5
src/core/stats.cpp
src/core/stats.cpp
+8
-0
src/core/stats.h
src/core/stats.h
+11
-0
src/core/thread_utils.h
src/core/thread_utils.h
+4
-0
src/core/threading.cpp
src/core/threading.cpp
+1
-1
src/gc/collector.cpp
src/gc/collector.cpp
+6
-5
tools/cumulate.sh
tools/cumulate.sh
+1
-1
No files found.
.gitignore
View file @
2afd421b
...
...
@@ -4,6 +4,7 @@ tools/mcjitcache
tools/mcjitcache_release
tools/publicize
tools/publicize_release
pyston
pyston_opt
pyston_noasserts
...
...
@@ -16,6 +17,8 @@ pyston_prof
pyston_profile
pyston_release
pyston_grwl
pyston_nosync
*.cache
tests/t.py
tests/t2.py
...
...
src/Makefile
View file @
2afd421b
...
...
@@ -333,10 +333,10 @@ check:
$(MAKE)
lint
$(MAKE)
ext pyston_dbg
#
$(MAKE)
run_unittests
$(MAKE)
test
_dbg
$(MAKE)
test
_release
$(MAKE)
check
_dbg
$(MAKE)
check
_release
@
# jit_prof forces the use of GCC as the compiler, which can expose other errors, so just build it and see what happens:
#
$(MAKE)
test
_prof
#
$(MAKE)
check
_prof
$(MAKE)
pyston_prof
$(
call
checksha,./pyston_prof
-cq
$(TESTS_DIR)
/raytrace_small.py,0544f4621dd45fe94205219488a2576b84dc044d
)
$(
call
checksha,./pyston_prof
-cqn
$(TESTS_DIR)
/raytrace_small.py,0544f4621dd45fe94205219488a2576b84dc044d
)
...
...
@@ -585,6 +585,7 @@ PASS_OBJS := $(PASS_SRCS:.cpp=.standalone.o)
$(call
make_compile_config,,$(CXXFLAGS_DBG))
$(call
make_compile_config,.release,$(CXXFLAGS_RELEASE))
$(call
make_compile_config,.grwl,$(CXXFLAGS_RELEASE)
-DTHREADING_USE_GRWL
=
1
-DTHREADING_USE_GIL
=
0
-UBINARY_SUFFIX
-DBINARY_SUFFIX
=
_grwl
)
$(call
make_compile_config,.nosync,$(CXXFLAGS_RELEASE)
-DTHREADING_USE_GRWL
=
0
-DTHREADING_USE_GIL
=
0
-UBINARY_SUFFIX
-DBINARY_SUFFIX
=
_nosync
)
$(UNITTEST_SRCS
:
.cpp=.o): CXXFLAGS += -isystem $(GTEST_DIR)/include
...
...
@@ -657,6 +658,7 @@ $(call link,_dbg,$(OBJS),$(LDFLAGS),$(LLVM_DEPS))
$(call
link,_debug,$(OBJS),$(LDFLAGS_DEBUG),$(LLVM_DEBUG_DEPS))
$(call
link,_release,$(OPT_OBJS),$(LDFLAGS_RELEASE),$(LLVM_RELEASE_DEPS))
$(call link,_grwl,stdlib.grwl.bc.o $(SRCS
:
.cpp=.grwl.o)
,
$(LDFLAGS_RELEASE)
,
$(LLVM_RELEASE_DEPS))
$(call link,_nosync,stdlib.nosync.bc.o $(SRCS
:
.cpp=.nosync.o)
,
$(LDFLAGS_RELEASE)
,
$(LLVM_RELEASE_DEPS))
pyston_oprof
:
$(OPT_OBJS) codegen/profiling/oprofile.o $(LLVM_DEPS)
$(ECHO)
Linking
$@
$(VERB)
$(CXX)
$(OPT_OBJS)
codegen/profiling/oprofile.o
$(LDFLAGS_RELEASE)
-lopagent
-o
$@
...
...
@@ -695,8 +697,8 @@ RUN_DEPS := ext
define
make_target
$(eval
\
.PHONY
:
test$1
test$1
:
pyston$1 ext
.PHONY
:
test$1
check$1
check$1
test$1
:
pyston$1 ext
python ../tools/tester.py
-R
pyston
$1
-j
$(TEST_THREADS)
-k
$(TESTS_DIR)
$(ARGS)
python ../tools/tester.py
-R
pyston
$1
-j
$(TEST_THREADS)
-a
-n
-k
$(TESTS_DIR)
$(ARGS)
python ../tools/tester.py
-R
pyston
$1
-j
$(TEST_THREADS)
-a
-O
-k
$(TESTS_DIR)
$(ARGS)
...
...
@@ -757,6 +759,7 @@ perf_%: perf_release_%
$(call
make_target,_dbg)
$(call
make_target,_release)
$(call
make_target,_grwl)
$(call
make_target,_nosync)
# "kill valgrind":
kv
:
...
...
src/core/stats.cpp
View file @
2afd421b
...
...
@@ -16,6 +16,8 @@
#include <algorithm>
#include "core/thread_utils.h"
namespace
pyston
{
std
::
vector
<
long
>*
Stats
::
counts
;
...
...
@@ -23,6 +25,12 @@ std::unordered_map<int, std::string>* Stats::names;
StatCounter
::
StatCounter
(
const
std
::
string
&
name
)
:
id
(
Stats
::
getStatId
(
name
))
{
}
StatPerThreadCounter
::
StatPerThreadCounter
(
const
std
::
string
&
name
)
{
char
buf
[
80
];
snprintf
(
buf
,
80
,
"%s_t%d"
,
name
.
c_str
(),
threading
::
gettid
());
id
=
Stats
::
getStatId
(
buf
);
}
int
Stats
::
getStatId
(
const
std
::
string
&
name
)
{
// hacky but easy way of getting around static constructor ordering issues for now:
static
std
::
unordered_map
<
int
,
std
::
string
>
names
;
...
...
src/core/stats.h
View file @
2afd421b
...
...
@@ -46,6 +46,17 @@ public:
void
log
(
int
count
=
1
)
{
Stats
::
log
(
id
,
count
);
}
};
struct
StatPerThreadCounter
{
private:
int
id
=
0
;
public:
StatPerThreadCounter
(
const
std
::
string
&
name
);
void
log
(
int
count
=
1
)
{
Stats
::
log
(
id
,
count
);
}
};
}
#endif
src/core/thread_utils.h
View file @
2afd421b
...
...
@@ -18,9 +18,13 @@
#include <pthread.h>
#include <unordered_map>
#include "core/common.h"
namespace
pyston
{
namespace
threading
{
pid_t
gettid
();
template
<
typename
T
>
class
_LockedRegion
{
private:
T
*
const
mutex
;
...
...
src/core/threading.cpp
View file @
2afd421b
...
...
@@ -427,7 +427,7 @@ void allowGLReadPreemption() {
assert
(
grwl_state
==
GRWLHeldState
::
R
);
gl_check_count
++
;
if
(
gl_check_count
<
10
00
)
if
(
gl_check_count
<
10
)
return
;
gl_check_count
=
0
;
...
...
src/gc/collector.cpp
View file @
2afd421b
...
...
@@ -160,14 +160,15 @@ void runCollection() {
if
(
VERBOSITY
(
"gc"
)
>=
2
)
printf
(
"Collection #%d
\n
"
,
++
ncollections
);
threading
::
GLPromoteRegion
_lock
;
//Timer _t2("promoting", /*min_usec=*/10000)
;
Timer
_t
(
"collecting"
,
/*min_usec=*/
10000
)
;
threading
::
GLPromoteRegion
_lock
;
//long promote_us = _t2.end();
//static thread_local StatPerThreadCounter sc_promoting_us("gc_promoting_us");
//sc_promoting_us.log(promote_us);
// if (ncollections == 754) {
// raise(SIGTRAP);
//}
Timer
_t
(
"collecting"
,
/*min_usec=*/
10000
);
markPhase
();
sweepPhase
();
...
...
tools/cumulate.sh
View file @
2afd421b
awk
'{if ($0 ~ /%/) { s += $1;
print s
, "\t", $0 } }'
awk
'{if ($0 ~ /%/) { s += $1;
n += $2; _s = $1; $1=""; print s, "\t", _s, " \t", n
, "\t", $0 } }'
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