comparison Python/sysmodule.c @ 31796:1c117dbb2def legacy-trunk

Enable the profiling of C functions (builtins and extensions)
author Nicholas Bastin <nick.bastin@gmail.com>
date Wed, 24 Mar 2004 21:57:10 +0000
parents a88e6dfbfd6d
children 846b3ee7e106
comparison
equal deleted inserted replaced
31795:bf37429f6d9f 31796:1c117dbb2def
270 270
271 /* 271 /*
272 * Cached interned string objects used for calling the profile and 272 * Cached interned string objects used for calling the profile and
273 * trace functions. Initialized by trace_init(). 273 * trace functions. Initialized by trace_init().
274 */ 274 */
275 static PyObject *whatstrings[4] = {NULL, NULL, NULL, NULL}; 275 static PyObject *whatstrings[7] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL};
276 276
277 static int 277 static int
278 trace_init(void) 278 trace_init(void)
279 { 279 {
280 static char *whatnames[4] = {"call", "exception", "line", "return"}; 280 static char *whatnames[7] = {"call", "exception", "line", "return",
281 "c_call", "c_exception", "c_return"};
281 PyObject *name; 282 PyObject *name;
282 int i; 283 int i;
283 for (i = 0; i < 4; ++i) { 284 for (i = 0; i < 7; ++i) {
284 if (whatstrings[i] == NULL) { 285 if (whatstrings[i] == NULL) {
285 name = PyString_InternFromString(whatnames[i]); 286 name = PyString_InternFromString(whatnames[i]);
286 if (name == NULL) 287 if (name == NULL)
287 return -1; 288 return -1;
288 whatstrings[i] = name; 289 whatstrings[i] = name;