[Python-checkins] python/dist/src/Lib/test test_profilehooks.py, 1.10, 1.11

mondragon at users.sourceforge.net mondragon at users.sourceforge.net
Wed Mar 24 16:57:11 EST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8622/Lib/test

Modified Files:
	test_profilehooks.py 
Log Message:
Enable the profiling of C functions (builtins and extensions)


Index: test_profilehooks.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_profilehooks.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** test_profilehooks.py	1 May 2003 17:45:46 -0000	1.10
--- test_profilehooks.py	24 Mar 2004 21:57:08 -0000	1.11
***************
*** 12,16 ****
  
      def callback(self, frame, event, arg):
!         self.add_event(event, frame)
  
      def add_event(self, event, frame=None):
--- 12,19 ----
  
      def callback(self, frame, event, arg):
!         if (event == "call"
!             or event == "return"
!             or event == "exception"):
!             self.add_event(event, frame)
  
      def add_event(self, event, frame=None):
***************
*** 57,64 ****
--- 60,73 ----
              "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,
          }
  




More information about the Python-checkins mailing list