summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatt Wagantall <mattw@codeaurora.org>2014-09-23 23:45:33 -0700
committerRohit Vaswani <rvaswani@codeaurora.org>2016-03-01 12:22:25 -0800
commit6a0fccbd29ff07dca1a25d5ff1ee15be0e221bd2 (patch)
tree7c896f2ad1baca6a37041a24397341de58bfc4b0 /include
parentf973afee85ad998191bfbaeece2610788648f981 (diff)
trace: rtb: add msm_rtb register tracing feature snapshot
This snapshot is taken as of msm-3.10 commit: 78c36fa0ef (Merge "msm: mdss: Prevent backlight update during continuous splash") RTB support captures system events such as register writes to a small uncached region. This is designed to aid in debugging, where it may be useful to know the last events that occurred prior to a device reset. Change-Id: Idc51e618380f58a6803f40c47f2b3d29033b3196 Signed-off-by: Matt Wagantall <mattw@codeaurora.org> [spjoshi@codeaurora.org: fix merge conflict] Signed-off-by: Sarangdhar Joshi <spjoshi@codeaurora.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/msm_rtb.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/include/linux/msm_rtb.h b/include/linux/msm_rtb.h
new file mode 100644
index 000000000000..228094294b31
--- /dev/null
+++ b/include/linux/msm_rtb.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+#ifndef __MSM_RTB_H__
+#define __MSM_RTB_H__
+
+/*
+ * These numbers are used from the kernel command line and sysfs
+ * to control filtering. Remove items from here with extreme caution.
+ */
+enum logk_event_type {
+ LOGK_NONE = 0,
+ LOGK_READL = 1,
+ LOGK_WRITEL = 2,
+ LOGK_LOGBUF = 3,
+ LOGK_HOTPLUG = 4,
+ LOGK_CTXID = 5,
+ LOGK_TIMESTAMP = 6,
+ LOGK_L2CPREAD = 7,
+ LOGK_L2CPWRITE = 8,
+ LOGK_IRQ = 9,
+};
+
+#define LOGTYPE_NOPC 0x80
+
+struct msm_rtb_platform_data {
+ unsigned int size;
+};
+
+#if defined(CONFIG_QCOM_RTB)
+/*
+ * returns 1 if data was logged, 0 otherwise
+ */
+int uncached_logk_pc(enum logk_event_type log_type, void *caller,
+ void *data);
+
+/*
+ * returns 1 if data was logged, 0 otherwise
+ */
+int uncached_logk(enum logk_event_type log_type, void *data);
+
+#define ETB_WAYPOINT do { \
+ BRANCH_TO_NEXT_ISTR; \
+ nop(); \
+ BRANCH_TO_NEXT_ISTR; \
+ nop(); \
+ } while (0)
+
+#define BRANCH_TO_NEXT_ISTR asm volatile("b .+4\n" : : : "memory")
+/*
+ * both the mb and the isb are needed to ensure enough waypoints for
+ * etb tracing
+ */
+#define LOG_BARRIER do { \
+ mb(); \
+ isb();\
+ } while (0)
+#else
+
+static inline int uncached_logk_pc(enum logk_event_type log_type,
+ void *caller,
+ void *data) { return 0; }
+
+static inline int uncached_logk(enum logk_event_type log_type,
+ void *data) { return 0; }
+
+#define ETB_WAYPOINT
+#define BRANCH_TO_NEXT_ISTR
+/*
+ * Due to a GCC bug, we need to have a nop here in order to prevent an extra
+ * read from being generated after the write.
+ */
+#define LOG_BARRIER nop()
+#endif
+#endif