summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2013-08-30 09:56:12 +0300
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-27 12:51:53 -0700
commit1bd0aa6cecd018f251fe28b0e1fb7871f276c8e9 (patch)
tree1827c3dd815f20d031bb8b66f35e12b1efc81ee6 /include/trace
parent3db0818748a209a39ce7064f397c7adf0824a9a7 (diff)
dma-debug: Use ftrace in {map,unmap}_*() calls
Log the map/unmap/alloc/free calls. This ftrace is enabled by default. Bug 1173494 Change-Id: I01fe24e570346413644368a6bff1578814f05f5a Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Reviewed-on: http://git-master/r/268383 GVS: Gerrit_Virtual_Submit Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/dmadebug.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/include/trace/events/dmadebug.h b/include/trace/events/dmadebug.h
new file mode 100644
index 000000000000..c0929b969188
--- /dev/null
+++ b/include/trace/events/dmadebug.h
@@ -0,0 +1,79 @@
+/*
+ * include/trace/events/dmadebug.h
+ *
+ * DMA debugging event logging to ftrace.
+ *
+ * Copyright (c) 2013, NVIDIA Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM dmadebug
+
+#if !defined(_TRACE_DMADEBUG_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_DMADEBUG_H
+
+#include <linux/ktime.h>
+#include <linux/tracepoint.h>
+#include <linux/types.h>
+#include <linux/device.h>
+
+/* get architecture specific interesting data */
+char *debug_dma_platformdata(struct device *dev);
+
+DECLARE_EVENT_CLASS(dmadebug,
+ TP_PROTO(struct device *dev, dma_addr_t dma_addr, size_t size, \
+ struct page *page),
+
+ TP_ARGS(dev, dma_addr, size, page),
+
+ TP_STRUCT__entry(
+ __field(struct device *, dev)
+ __field(dma_addr_t, dma_addr)
+ __field(size_t, size)
+ __field(struct page *, page)
+ ),
+
+ TP_fast_assign(
+ __entry->dev = dev;
+ __entry->dma_addr = dma_addr;
+ __entry->size = size;
+ __entry->page = page;
+ ),
+
+ TP_printk("device=%s, addr=0x%08x, size=%d page=%p platformdata=%s",
+ dev_name(__entry->dev), __entry->dma_addr,
+ __entry->size, __entry->page,
+ debug_dma_platformdata(__entry->dev))
+);
+
+#define DMADEBUGEVENT(ev) DEFINE_EVENT(dmadebug, ev, \
+ TP_PROTO(struct device *dev, dma_addr_t dma_addr, size_t size, \
+ struct page *page), \
+ TP_ARGS(dev, dma_addr, size, page) \
+)
+
+DMADEBUGEVENT(dmadebug_map_page);
+DMADEBUGEVENT(dmadebug_unmap_page);
+DMADEBUGEVENT(dmadebug_map_sg);
+DMADEBUGEVENT(dmadebug_unmap_sg);
+
+#undef DMADEBUGEVENT
+
+#endif /* _TRACE_DMADEBUG_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>