[Python-checkins] CVS: python/dist/src/Modules _hotshot.c,NONE,1.1
Fred L. Drake
fdrake@users.sourceforge.net
2001年10月12日 13:57:57 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv16403/Modules
Added Files:
_hotshot.c
Log Message:
The HotShot core: look, ma, no hands!
--- NEW FILE: _hotshot.c ---
/*
* This is the High Performance Python Profiler portion of HotShot.
*/
#include <Python.h>
#include <compile.h>
#include <eval.h>
#include <frameobject.h>
#include <structmember.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
/*
* Which timer to use should be made more configurable, but that should not
* be difficult. This will do fo now.
*/
#ifdef MS_WIN32
[...1329 lines suppressed...]
Py_INCREF(&ProfilerType);
PyModule_AddObject(module, "ProfilerType",
(PyObject *)&ProfilerType);
if (ProfilerError == NULL)
ProfilerError = PyErr_NewException("hotshot.ProfilerError",
NULL, NULL);
if (ProfilerError != NULL) {
Py_INCREF(ProfilerError);
PyModule_AddObject(module, "ProfilerError", ProfilerError);
}
PyModule_AddIntConstant(module, "WHAT_ENTER", WHAT_ENTER);
PyModule_AddIntConstant(module, "WHAT_EXIT", WHAT_EXIT);
PyModule_AddIntConstant(module, "WHAT_LINENO", WHAT_LINENO);
PyModule_AddIntConstant(module, "WHAT_OTHER", WHAT_OTHER);
PyModule_AddIntConstant(module, "WHAT_ADD_INFO", WHAT_ADD_INFO);
PyModule_AddIntConstant(module, "WHAT_DEFINE_FILE", WHAT_DEFINE_FILE);
PyModule_AddIntConstant(module, "WHAT_LINE_TIMES", WHAT_LINE_TIMES);
}
}