aboutsummaryrefslogtreecommitdiff
path: root/py/profile.h
diff options
context:
space:
mode:
authorMilan Rossa <rossa.milan@gmail.com>2019-08-14 16:12:54 +0200
committerDamien George <damien.p.george@gmail.com>2019-08-30 16:48:47 +1000
commitb295df4b081dbe6f8aee2e54d1bea019a1b97236 (patch)
tree5c57736727c188a2557031e5731bdb84e9bc7895 /py/profile.h
parent498e35219e1f54243ff6d650781c525e20cad9b1 (diff)
py/profile: Add debugging for sys.settrace feature.
Diffstat (limited to 'py/profile.h')
-rw-r--r--py/profile.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/py/profile.h b/py/profile.h
index 227634b56..0293e262f 100644
--- a/py/profile.h
+++ b/py/profile.h
@@ -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