Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Support Python 3.11
  • Loading branch information
matthiasdiener committed Jan 21, 2023
commit 8872dd59a1d9cf028ba9d0d03ca8eee24f7c1242
4 changes: 2 additions & 2 deletions src/_vmprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static int _look_for_code_object(PyObject *o, void * param)
/* as a special case, recursively look for and add code
objects found in the co_consts. The problem is that code
objects are not created as GC-aware in CPython, so we need
to hack like this to hope to find most of them.
to hack like this to hope to find most of them.
*/
i = PyTuple_Size(co->co_consts);
while (i > 0) {
Expand Down Expand Up @@ -298,7 +298,7 @@ sample_stack_now(PyObject *module, PyObject * args)
vmprof_ignore_signals(0);
return NULL;
}
entry_count = vmp_walk_and_record_stack(tstate->frame, m, SINGLE_BUF_SIZE/sizeof(void*)-1, (int)skip, 0);
entry_count = vmp_walk_and_record_stack(tstate->cframe, m, SINGLE_BUF_SIZE/sizeof(void*)-1, (int)skip, 0);

for (i = 0; i < entry_count; i++) {
routine_ip = m[i];
Expand Down
2 changes: 2 additions & 0 deletions src/vmp_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "vmprof.h"
#include "compat.h"

#include "internal/pycore_frame.h"

#ifdef VMP_SUPPORTS_NATIVE_PROFILING

#if defined(VMPROF_LINUX) || defined(VMPROF_BSD)
Expand Down
2 changes: 1 addition & 1 deletion src/vmprof.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int IS_VMPROF_EVAL(void * ptr);
#define PY_EVAL_RETURN_T PyObject
#define PY_THREAD_STATE_T PyThreadState
#define FRAME_STEP(f) f->f_back
#define FRAME_CODE(f) f->f_code
#define FRAME_CODE(f) f->f_frame->f_code

#if CPYTHON_HAS_FRAME_EVALUATION
#define IS_VMPROF_EVAL(PTR) PTR == (void*)_PyEval_EvalFrameDefault
Expand Down
2 changes: 1 addition & 1 deletion src/vmprof_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ int get_stack_trace(PY_THREAD_STATE_T * current, void** result, int max_depth, i
#endif
return 0;
}
frame = current->frame;
frame = current->cframe;
#endif
if (frame == NULL) {
#if DEBUG
Expand Down