Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions src/vmp_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ int vmp_walk_and_record_stack(PY_STACK_FRAME_T *frame, void ** result,
}

int depth = 0;
PY_STACK_FRAME_T * top_most_frame = frame;
//PY_STACK_FRAME_T * top_most_frame = frame;
while ((depth + _per_loop()) <= max_depth) {
unw_get_proc_info(&cursor, &pip);

Expand Down Expand Up @@ -400,7 +400,7 @@ int vmp_read_vmaps(const char * fname) {
if (fd == NULL) {
return 0;
}
char * saveptr;
char * saveptr = NULL;
char * line = NULL;
char * he = NULL;
char * name;
Expand Down
5 changes: 4 additions & 1 deletion src/vmprof_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#include <errno.h>

#ifdef RPYTHON_VMPROF

int get_stack_trace(PY_THREAD_STATE_T * current, void** result, int max_depth, intptr_t pc);

#ifdef RPYTHON_LL2CTYPES
/* only for testing: ll2ctypes sets RPY_EXTERN from the command-line */

Expand Down Expand Up @@ -193,7 +196,7 @@ PY_STACK_FRAME_T *get_vmprof_stack(void)
#endif

intptr_t vmprof_get_traceback(void *stack, void *ucontext,
intptr_t *result_p, intptr_t result_length)
void **result_p, intptr_t result_length)
{
int n;
int enabled;
Expand Down
2 changes: 1 addition & 1 deletion src/vmprof_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ PY_STACK_FRAME_T *get_vmprof_stack(void);
#endif
RPY_EXTERN
intptr_t vmprof_get_traceback(void *stack, void *ucontext,
intptr_t *result_p, intptr_t result_length);
void **result_p, intptr_t result_length);
#endif

int vmprof_get_signal_type(void);
Expand Down
4 changes: 2 additions & 2 deletions vmprof/test/test_c_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TestStack(object):
def setup_class(cls):
stack_ffi = FFI()
stack_ffi.cdef("""
typedef uint64_t ptr_t;
typedef intptr_t ptr_t;
int vmp_binary_search_ranges(ptr_t ip, ptr_t * l, int count);
int vmp_ignore_ip(ptr_t ip);
int vmp_ignore_symbol_count(void);
Expand All @@ -28,7 +28,7 @@ def setup_class(cls):
stack_ffi.set_source("vmprof.test._test_stack", source, include_dirs=['src'],
define_macros=[('_CFFI_USE_EMBEDDING',1), ('PY_TEST',1),
('VMP_SUPPORTS_NATIVE_PROFILING',1)],
libraries=libs, extra_compile_args=['-g'])
libraries=libs, extra_compile_args=['-Werror', '-g'])

stack_ffi.compile(verbose=True)
from vmprof.test import _test_stack as clib
Expand Down
10 changes: 5 additions & 5 deletions vmprof/test/test_c_symboltable.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
{
*name = gname;
*src = gsrc;
gname[0] = '\x00';
gsrc[0] = '\x00';
gname[0] = 0;
gsrc[0] = 0;
return vmp_resolve_addr(&vmp_resolve_addr, gname, 64,
lineno, gsrc, 128);
}
int test_extract_sofile(char ** name, int * lineno, char ** src)
{
*name = gname;
*src = gsrc;
gname[0] = '\x00';
gsrc[0] = '\x00';
gname[0] = 0;
gsrc[0] = 0;
return vmp_resolve_addr(&abs, gname, 64,
lineno, gsrc, 128);
}
Expand All @@ -57,7 +57,7 @@

extra_compile = []
if sys.platform.startswith("linux"):
extra_compile = ['-DVMPROF_LINUX', '-DVMPROF_UNIX']
extra_compile = ['-DVMPROF_LINUX', '-DVMPROF_UNIX', '-Werror', '-g']

# trick: compile with _CFFI_USE_EMBEDDING=1 which will not define Py_LIMITED_API
ffi.set_source("vmprof.test._test_symboltable", source, include_dirs=includes,
Expand Down
6 changes: 3 additions & 3 deletions vmprof/test/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,13 @@ class TestNative(object):
def setup_class(cls):
ffi = FFI()
ffi.cdef("""
void native_gzipgzipgzip();
void native_gzipgzipgzip(void);
""")
source = """
#include "zlib.h"
unsigned char input[100];
unsigned char output[100];
void native_gzipgzipgzip() {
void native_gzipgzipgzip(void) {
z_stream defstream;
defstream.zalloc = Z_NULL;
defstream.zfree = Z_NULL;
Expand All @@ -429,7 +429,7 @@ def setup_class(cls):
# trick: compile with _CFFI_USE_EMBEDDING=1 which will not define Py_LIMITED_API
ffi.set_source("vmprof.test._test_native_gzip", source, include_dirs=['src'],
define_macros=[('_CFFI_USE_EMBEDDING',1),('_PY_TEST',1)], libraries=libs,
extra_compile_args=['-g', '-O0'])
extra_compile_args=['-Werror', '-g', '-O0'])

ffi.compile(verbose=True)
from vmprof.test import _test_native_gzip as clib
Expand Down