summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_profilehooks.py
diff options
context:
space:
mode:
authorNicholas Bastin <nick.bastin@gmail.com>2004-03-24 21:57:10 (GMT)
committerNicholas Bastin <nick.bastin@gmail.com>2004-03-24 21:57:10 (GMT)
commitc69ebe8d50529eae281275c841428eb9b375a442 (patch)
treeb8150da59983ca89c192b45311eeee050a0b4a16 /Lib/test/test_profilehooks.py
parenta1dde13389cf47ac626394796740925504e3e272 (diff)
downloadcpython-c69ebe8d50529eae281275c841428eb9b375a442.zip
cpython-c69ebe8d50529eae281275c841428eb9b375a442.tar.gz
cpython-c69ebe8d50529eae281275c841428eb9b375a442.tar.bz2
Enable the profiling of C functions (builtins and extensions)
Diffstat (limited to 'Lib/test/test_profilehooks.py')
-rw-r--r--Lib/test/test_profilehooks.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/test/test_profilehooks.py b/Lib/test/test_profilehooks.py
index ac8ebd8..53f882a 100644
--- a/Lib/test/test_profilehooks.py
+++ b/Lib/test/test_profilehooks.py
@@ -11,7 +11,10 @@ class HookWatcher:
self.events = []
def callback(self, frame, event, arg):
- self.add_event(event, frame)
+ if (event == "call"
+ or event == "return"
+ or event == "exception"):
+ self.add_event(event, frame)
def add_event(self, event, frame=None):
"""Add an event to the log."""
@@ -56,10 +59,16 @@ class ProfileSimulator(HookWatcher):
self.testcase.fail(
"the profiler should never receive exception events")
+ def trace_pass(self, frame):
+ pass
+
dispatch = {
'call': trace_call,
'exception': trace_exception,
'return': trace_return,
+ 'c_call': trace_pass,
+ 'c_return': trace_pass,
+ 'c_exception': trace_pass,
}