diff options
author | Fred Drake <fdrake@acm.org> | 2001-07-03 23:39:52 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-07-03 23:39:52 (GMT) |
commit | 9e3ad7844425d96baf856d3da1975756504b2aa5 (patch) | |
tree | 60b7fd58e8c450f80f827e04240aba389b0421c6 /Include | |
parent | d89a2e7731f1c8e1dd39a2f93201fa8d93fdf0fb (diff) | |
download | cpython-9e3ad7844425d96baf856d3da1975756504b2aa5.zip cpython-9e3ad7844425d96baf856d3da1975756504b2aa5.tar.gz cpython-9e3ad7844425d96baf856d3da1975756504b2aa5.tar.bz2 |
This change adjusts the profiling/tracing support so that the common
path (with no profile/trace function) through eval_code2() and
eval_frame() avoids several checks.
In the common cases of calls, returns, and exception propogation,
eval_code2() and eval_frame() used to test two values in the
thread-state: the profiling function and the tracing function. With
this change, a flag is set in the thread-state if either of these is
active, allowing a single check to suffice when both are NULL. This
also simplifies the code needed when either function is in use but is
already active (to avoid profiling/tracing the profiler/tracer); the
flag is set to 0 when the profile/trace code is entered, allowing the
same check to suffice for "already in the tracer" for call/return/
exception events.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pystate.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Include/pystate.h b/Include/pystate.h index d5e2e1f..15a264c 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -49,6 +49,7 @@ typedef struct _ts { int recursion_depth; int ticker; int tracing; + int use_tracing; Py_tracefunc c_profilefunc; Py_tracefunc c_tracefunc; |