py/profile: Add debugging for sys.settrace feature.

This commit is contained in:
Milan Rossa
2019-08-14 16:12:54 +02:00
committed by Damien George
parent 498e35219e
commit b295df4b08
2 changed files with 553 additions and 0 deletions

View File

@@ -65,5 +65,15 @@ mp_obj_t mp_prof_frame_update(const mp_code_state_t *code_state);
// For every VM instruction tick this function deduces events from the state
mp_obj_t mp_prof_instr_tick(mp_code_state_t *code_state, bool is_exception);
// This section is for debugging the settrace feature itself, and is not intended
// to be included in production/release builds.
#define MICROPY_PROF_INSTR_DEBUG_PRINT_ENABLE 0
#if MICROPY_PROF_INSTR_DEBUG_PRINT_ENABLE
void mp_prof_print_instr(const byte* ip, mp_code_state_t *code_state);
#define MP_PROF_INSTR_DEBUG_PRINT(current_ip) mp_prof_print_instr((current_ip), code_state)
#else
#define MP_PROF_INSTR_DEBUG_PRINT(current_ip)
#endif
#endif // MICROPY_PY_SYS_SETTRACE
#endif // MICROPY_INCLUDED_PY_PROFILING_H