+/**
+ * @brief Walk the stack backwards to generate stack trace
+ *
+ * @param tb_buffer
+ * @param fp
+ * @param limit
+ * @param last_fp
+ * @return int
+ */
+int
+trace_walkback(struct trace_record* tb_buffer,
+ ptr_t fp,
+ int limit,
+ ptr_t* last_fp);
+
+/**
+ * @brief Print the stack trace starting from the given frame pointer
+ *
+ * @param fp
+ */
+void
+trace_printstack_of(ptr_t fp);
+
+/**
+ * @brief Print the stack trace given the current interrupt context. In addition
+ * to the stacktrace, this will also print all context switches happened
+ * beforehand, and all stack trace in each context. Recommended for verbose
+ * debugging.
+ *
+ * @param isrm
+ */
+void
+trace_printstack_isr(const isr_param* isrm);
+
+/**
+ * @brief Print the stack trace starting from caller's frame pointer.
+ *
+ */