summaryrefslogtreecommitdiff
path: root/include/stack_trace.h
diff options
context:
space:
mode:
authorVic (Chun-Ju) Yang <victoryang@chromium.org>2014-01-21 17:18:33 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-01-22 04:52:49 +0000
commit7c686dd68ba382a01040f5cf23c5e416ee39e65e (patch)
treeefc0e15822d4ba10ff7520e16098b44dc8168c75 /include/stack_trace.h
parenta02d7fa1480380ef402118395870d742b3910fd9 (diff)
downloadchrome-ec-7c686dd68ba382a01040f5cf23c5e416ee39e65e.tar.gz
emulator: Move trace dump to a separate module
The implementation of trace dump has little to do with task scheduling, so we should move it to a separate module for cleaner code. This requires exposing some emulator-specific task info, as defined in host_task.h. BUG=chrome-os-partner:19235 TEST=Pass all tests BRANCH=None Change-Id: Iba9bc0794a4e1dd4ddb92b98345162b398fa6a8d Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/183238
Diffstat (limited to 'include/stack_trace.h')
-rw-r--r--include/stack_trace.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/stack_trace.h b/include/stack_trace.h
new file mode 100644
index 0000000000..e8b37d1811
--- /dev/null
+++ b/include/stack_trace.h
@@ -0,0 +1,25 @@
+/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* Trace dump module */
+
+#ifndef __CROS_EC_TRACE_H
+#define __CROS_EC_TRACE_H
+
+#ifdef EMU_BUILD
+/*
+ * Register trace dump handler for emulator. Trace dump is printed to stderr
+ * when SIGUSR2 is received.
+ */
+void task_register_tracedump(void);
+
+/* Dump current stack trace */
+void task_dump_trace(void);
+#else
+static inline void task_register_tracedump(void) { }
+static inline void task_dump_trace(void) { }
+#endif
+
+#endif /* __CROS_EC_TRACE_H */