Skip to content

Commit

Permalink
more warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
planrich committed Apr 26, 2017
1 parent b7f9577 commit b004d12
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/vmp_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ int vmp_walk_and_record_stack(PY_STACK_FRAME_T *frame, void ** result,
while (signal < 0) {
int err = unw_step(&cursor);
if (err <= 0) {
fprintf("WARNING: did not find signal frame, skipping sample\n");
return 0;
}
signal++;
Expand All @@ -243,6 +244,7 @@ int vmp_walk_and_record_stack(PY_STACK_FRAME_T *frame, void ** result,
}
int err = unw_step(&cursor);
if (err <= 0) {
fprintf("WARNING: did not find signal frame, skipping sample\n");
return 0;
}
}
Expand Down Expand Up @@ -310,14 +312,14 @@ int vmp_walk_and_record_stack(PY_STACK_FRAME_T *frame, void ** result,
if (err == 0) {
break;
} else if (err < 0) {
return 0; // this sample is broken, cannot walk it fully
// this sample is broken, cannot walk native level... record python level (at least)
return vmp_walk_and_record_python_stack_only(frame, result, max_depth, 0, pc);
}
}

return 0; // kill this sample, no python level was found
#else
return vmp_walk_and_record_python_stack_only(frame, result, max_depth, 0, pc);
// if we come here, the found stack trace is removed and only python stacks are recorded
#endif
return vmp_walk_and_record_python_stack_only(frame, result, max_depth, 0, pc);
}

int vmp_native_enabled(void) {
Expand Down
3 changes: 3 additions & 0 deletions src/vmprof_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,13 @@ int get_stack_trace(PY_THREAD_STATE_T * current, void** result, int max_depth, i
frame = (PY_STACK_FRAME_T*)current;
#else
if (!current) {
fprintf(stderr, "WARNING: get_stack_trace, current is NULL\n");
return 0;
}
frame = current->frame;
#endif
if (frame == NULL) {
fprintf(stderr, "WARNING: get_stack_trace, frame is NULL\n");
return 0;
}
return vmp_walk_and_record_stack(frame, result, max_depth, 1, pc);
Expand Down Expand Up @@ -230,6 +232,7 @@ static void sigprof_handler(int sig_nr, siginfo_t* info, void *ucontext)
if (commit) {
commit_buffer(fd, p);
} else {
fprintf("WARNING: canceled buffer, no stack trace was written\n");
cancel_buffer(p);
}
}
Expand Down

0 comments on commit b004d12

Please sign in to comment.