[pypy-commit] pypy stmgc-c7: Use 'PYPYSTM=filename' to produce only 'filename' from the main process,
arigo
noreply at buildbot.pypy.org
Wed Jan 28 12:09:21 CET 2015
Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r75554:73111c36b1f9
Date: 2015-01-28 12:07 +0100
http://bitbucket.org/pypy/pypy/changeset/73111c36b1f9/
Log: Use 'PYPYSTM=filename' to produce only 'filename' from the main
process, and use 'PYPYSTM=filename+' to produce 'filename' in the
main process and 'filename.fork<PID>' in all forked subprocesses.
diff --git a/rpython/translator/stm/src_stm/extracode.h b/rpython/translator/stm/src_stm/extracode.h
--- a/rpython/translator/stm/src_stm/extracode.h
+++ b/rpython/translator/stm/src_stm/extracode.h
@@ -171,6 +171,17 @@
g_co_lnotab_ofs = co_lnotab_ofs;
char *filename = getenv("PYPYSTM");
- if (filename && filename[0])
- stm_set_timing_log(filename, &_stm_expand_marker_for_pypy);
+ if (filename && filename[0]) {
+ /* if PYPYSTM is set to a string ending in '+', we enable the
+ timing log also for forked subprocesses. */
+ size_t n = strlen(filename);
+ char filename_copy[n];
+ int fork_mode = (n > 1 && filename[n - 1] == '+');
+ if (fork_mode) {
+ memcpy(filename_copy, filename, n - 1);
+ filename_copy[n - 1] = 0;
+ filename = filename_copy;
+ }
+ stm_set_timing_log(filename, fork_mode, &_stm_expand_marker_for_pypy);
+ }
}
More information about the pypy-commit
mailing list