summaryrefslogtreecommitdiffstats
path: root/Modules/_hotshot.c
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-08-15 14:59:02 (GMT)
committerMichael W. Hudson <mwh@python.net>2002-08-15 14:59:02 (GMT)
commitdd32a91cc0c8ba178d7ee5e78c30b6920aff66f4 (patch)
tree1a2062b54d3445ca788fd63c2bc63984dd85f34a /Modules/_hotshot.c
parentadd88060c1d1a98c7970e35b326e6a65a17ddf04 (diff)
downloadcpython-dd32a91cc0c8ba178d7ee5e78c30b6920aff66f4.zip
cpython-dd32a91cc0c8ba178d7ee5e78c30b6920aff66f4.tar.gz
cpython-dd32a91cc0c8ba178d7ee5e78c30b6920aff66f4.tar.bz2
This is my patch
[ 587993 ] SET_LINENO killer Remove SET_LINENO. Tracing is now supported by inspecting co_lnotab. Many sundry changes to document and adapt to this change.
Diffstat (limited to 'Modules/_hotshot.c')
-rw-r--r--Modules/_hotshot.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c
index 1e8f4f9..2ca4486 100644
--- a/Modules/_hotshot.c
+++ b/Modules/_hotshot.c
@@ -152,7 +152,7 @@ logreader_tp_iter(LogReaderObject *self)
* Low bits: Opcode: Meaning:
* 0x00 ENTER enter a frame
* 0x01 EXIT exit a frame
- * 0x02 LINENO SET_LINENO instruction was executed
+ * 0x02 LINENO execution moved onto a different line
* 0x03 OTHER more bits are needed to deecode
*
* If the type is OTHER, the record is not packed so tightly, and the
@@ -888,9 +888,12 @@ tracer_callback(ProfilerObject *self, PyFrameObject *frame, int what,
case PyTrace_LINE:
if (self->linetimings)
- return pack_lineno_tdelta(self, frame->f_lineno, get_tdelta(self));
+ return pack_lineno_tdelta(self, PyCode_Addr2Line(frame->f_code,
+ frame->f_lasti),
+ get_tdelta(self));
else
- return pack_lineno(self, frame->f_lineno);
+ return pack_lineno(self, PyCode_Addr2Line(frame->f_code,
+ frame->f_lasti));
default:
/* ignore PyTrace_EXCEPTION */
@@ -1227,8 +1230,8 @@ PyDoc_STRVAR(profiler_object__doc__,
"\n"
"closed: True if the profiler has already been closed.\n"
"frametimings: True if ENTER/EXIT events collect timing information.\n"
-"lineevents: True if SET_LINENO events are reported to the profiler.\n"
-"linetimings: True if SET_LINENO events collect timing information.");
+"lineevents: True if line events are reported to the profiler.\n"
+"linetimings: True if line events collect timing information.");
static PyTypeObject ProfilerType = {
PyObject_HEAD_INIT(NULL)