msm: qdss: provide an api to force disable qdss sink
Introduce a new api (qdss_disable_sink) that can be called from atomic
or non-atomic context to force disable the current qdss sink(s).
This api will be used as a way to force stop the sink (eg. etb) from
accepting any more trace data and hence avoid being polluted with trace
data that is uninteresting after an event of interest (eg. userspace
process crash) has occured.
Change-Id: I2a474ba9f51275aa3fa77ee35c39149663dfb03c
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
diff --git a/arch/arm/mach-msm/qdss.c b/arch/arm/mach-msm/qdss.c
index cfe65ad..0cc3ca5 100644
--- a/arch/arm/mach-msm/qdss.c
+++ b/arch/arm/mach-msm/qdss.c
@@ -175,6 +175,26 @@
EXPORT_SYMBOL(qdss_disable);
/**
+ * qdss_disable_sink - force disable the current qdss sink(s)
+ *
+ * Force disable the current qdss sink(s) to stop the sink from accepting any
+ * trace generated subsequent to this call. This function should only be used
+ * as a way to stop the sink from getting polluted with trace data that is
+ * uninteresting after an event of interest has occured.
+ *
+ * CONTEXT:
+ * Can be called from atomic or non-atomic context.
+ */
+void qdss_disable_sink(void)
+{
+ if ((qdss.pdata)->afamily) {
+ etb_dump();
+ etb_disable();
+ }
+}
+EXPORT_SYMBOL(qdss_disable_sink);
+
+/**
* qdss_clk_enable - enable qdss clocks
*
* Enables qdss clocks via RPM if they aren't already enabled, otherwise