summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/block.h20
-rw-r--r--include/trace/events/nvhost.h421
-rw-r--r--include/trace/events/writeback.h10
3 files changed, 437 insertions, 14 deletions
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index bf366547da25..05c5e61f0a7c 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -8,6 +8,8 @@
#include <linux/blkdev.h>
#include <linux/tracepoint.h>
+#define RWBS_LEN 8
+
DECLARE_EVENT_CLASS(block_rq_with_error,
TP_PROTO(struct request_queue *q, struct request *rq),
@@ -19,7 +21,7 @@ DECLARE_EVENT_CLASS(block_rq_with_error,
__field( sector_t, sector )
__field( unsigned int, nr_sector )
__field( int, errors )
- __array( char, rwbs, 6 )
+ __array( char, rwbs, RWBS_LEN )
__dynamic_array( char, cmd, blk_cmd_buf_len(rq) )
),
@@ -104,7 +106,7 @@ DECLARE_EVENT_CLASS(block_rq,
__field( sector_t, sector )
__field( unsigned int, nr_sector )
__field( unsigned int, bytes )
- __array( char, rwbs, 6 )
+ __array( char, rwbs, RWBS_LEN )
__array( char, comm, TASK_COMM_LEN )
__dynamic_array( char, cmd, blk_cmd_buf_len(rq) )
),
@@ -183,7 +185,7 @@ TRACE_EVENT(block_bio_bounce,
__field( dev_t, dev )
__field( sector_t, sector )
__field( unsigned int, nr_sector )
- __array( char, rwbs, 6 )
+ __array( char, rwbs, RWBS_LEN )
__array( char, comm, TASK_COMM_LEN )
),
@@ -222,7 +224,7 @@ TRACE_EVENT(block_bio_complete,
__field( sector_t, sector )
__field( unsigned, nr_sector )
__field( int, error )
- __array( char, rwbs, 6 )
+ __array( char, rwbs, RWBS_LEN)
),
TP_fast_assign(
@@ -249,7 +251,7 @@ DECLARE_EVENT_CLASS(block_bio,
__field( dev_t, dev )
__field( sector_t, sector )
__field( unsigned int, nr_sector )
- __array( char, rwbs, 6 )
+ __array( char, rwbs, RWBS_LEN )
__array( char, comm, TASK_COMM_LEN )
),
@@ -321,7 +323,7 @@ DECLARE_EVENT_CLASS(block_get_rq,
__field( dev_t, dev )
__field( sector_t, sector )
__field( unsigned int, nr_sector )
- __array( char, rwbs, 6 )
+ __array( char, rwbs, RWBS_LEN )
__array( char, comm, TASK_COMM_LEN )
),
@@ -456,7 +458,7 @@ TRACE_EVENT(block_split,
__field( dev_t, dev )
__field( sector_t, sector )
__field( sector_t, new_sector )
- __array( char, rwbs, 6 )
+ __array( char, rwbs, RWBS_LEN )
__array( char, comm, TASK_COMM_LEN )
),
@@ -498,7 +500,7 @@ TRACE_EVENT(block_bio_remap,
__field( unsigned int, nr_sector )
__field( dev_t, old_dev )
__field( sector_t, old_sector )
- __array( char, rwbs, 6 )
+ __array( char, rwbs, RWBS_LEN)
),
TP_fast_assign(
@@ -542,7 +544,7 @@ TRACE_EVENT(block_rq_remap,
__field( unsigned int, nr_sector )
__field( dev_t, old_dev )
__field( sector_t, old_sector )
- __array( char, rwbs, 6 )
+ __array( char, rwbs, RWBS_LEN)
),
TP_fast_assign(
diff --git a/include/trace/events/nvhost.h b/include/trace/events/nvhost.h
new file mode 100644
index 000000000000..1e28559c9287
--- /dev/null
+++ b/include/trace/events/nvhost.h
@@ -0,0 +1,421 @@
+/*
+ * include/trace/events/nvhost.h
+ *
+ * Nvhost event logging to ftrace.
+ *
+ * Copyright (c) 2010-2012, 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 nvhost
+
+#if !defined(_TRACE_NVHOST_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_NVHOST_H
+
+#include <linux/ktime.h>
+#include <linux/tracepoint.h>
+
+DECLARE_EVENT_CLASS(nvhost,
+ TP_PROTO(const char *name),
+ TP_ARGS(name),
+ TP_STRUCT__entry(__field(const char *, name)),
+ TP_fast_assign(__entry->name = name;),
+ TP_printk("name=%s", __entry->name)
+);
+
+DEFINE_EVENT(nvhost, nvhost_channel_open,
+ TP_PROTO(const char *name),
+ TP_ARGS(name)
+);
+
+DEFINE_EVENT(nvhost, nvhost_channel_release,
+ TP_PROTO(const char *name),
+ TP_ARGS(name)
+);
+
+DEFINE_EVENT(nvhost, nvhost_ioctl_channel_flush,
+ TP_PROTO(const char *name),
+ TP_ARGS(name)
+);
+
+TRACE_EVENT(nvhost_channel_write_submit,
+ TP_PROTO(const char *name, ssize_t count, u32 cmdbufs, u32 relocs,
+ u32 syncpt_id, u32 syncpt_incrs),
+
+ TP_ARGS(name, count, cmdbufs, relocs, syncpt_id, syncpt_incrs),
+
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ __field(ssize_t, count)
+ __field(u32, cmdbufs)
+ __field(u32, relocs)
+ __field(u32, syncpt_id)
+ __field(u32, syncpt_incrs)
+ ),
+
+ TP_fast_assign(
+ __entry->name = name;
+ __entry->count = count;
+ __entry->cmdbufs = cmdbufs;
+ __entry->relocs = relocs;
+ __entry->syncpt_id = syncpt_id;
+ __entry->syncpt_incrs = syncpt_incrs;
+ ),
+
+ TP_printk("name=%s, count=%d, cmdbufs=%u, relocs=%u, syncpt_id=%u, syncpt_incrs=%u",
+ __entry->name, __entry->count, __entry->cmdbufs, __entry->relocs,
+ __entry->syncpt_id, __entry->syncpt_incrs)
+);
+
+TRACE_EVENT(nvhost_ioctl_channel_submit,
+ TP_PROTO(const char *name, u32 version, u32 cmdbufs, u32 relocs,
+ u32 waitchks, u32 syncpt_id, u32 syncpt_incrs),
+
+ TP_ARGS(name, version, cmdbufs, relocs, waitchks,
+ syncpt_id, syncpt_incrs),
+
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ __field(u32, version)
+ __field(u32, cmdbufs)
+ __field(u32, relocs)
+ __field(u32, waitchks)
+ __field(u32, syncpt_id)
+ __field(u32, syncpt_incrs)
+ ),
+
+ TP_fast_assign(
+ __entry->name = name;
+ __entry->version = version;
+ __entry->cmdbufs = cmdbufs;
+ __entry->relocs = relocs;
+ __entry->waitchks = waitchks;
+ __entry->syncpt_id = syncpt_id;
+ __entry->syncpt_incrs = syncpt_incrs;
+ ),
+
+ TP_printk("name=%s, version=%u, cmdbufs=%u, relocs=%u, waitchks=%u, syncpt_id=%u, syncpt_incrs=%u",
+ __entry->name, __entry->version, __entry->cmdbufs, __entry->relocs,
+ __entry->waitchks, __entry->syncpt_id, __entry->syncpt_incrs)
+);
+
+TRACE_EVENT(nvhost_channel_write_cmdbuf,
+ TP_PROTO(const char *name, u32 mem_id,
+ u32 words, u32 offset),
+
+ TP_ARGS(name, mem_id, words, offset),
+
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ __field(u32, mem_id)
+ __field(u32, words)
+ __field(u32, offset)
+ ),
+
+ TP_fast_assign(
+ __entry->name = name;
+ __entry->mem_id = mem_id;
+ __entry->words = words;
+ __entry->offset = offset;
+ ),
+
+ TP_printk("name=%s, mem_id=%08x, words=%u, offset=%d",
+ __entry->name, __entry->mem_id,
+ __entry->words, __entry->offset)
+);
+
+TRACE_EVENT(nvhost_channel_write_cmdbuf_data,
+ TP_PROTO(const char *name, u32 mem_id,
+ u32 words, u32 offset, void *cmdbuf),
+
+ TP_ARGS(name, mem_id, words, offset, cmdbuf),
+
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ __field(u32, mem_id)
+ __field(u32, words)
+ __field(u32, offset)
+ __field(bool, cmdbuf)
+ __dynamic_array(u32, cmdbuf, words)
+ ),
+
+ TP_fast_assign(
+ if (cmdbuf) {
+ memcpy(__get_dynamic_array(cmdbuf), cmdbuf+offset,
+ words * sizeof(u32));
+ }
+ __entry->cmdbuf = cmdbuf;
+ __entry->name = name;
+ __entry->mem_id = mem_id;
+ __entry->words = words;
+ __entry->offset = offset;
+ ),
+
+ TP_printk("name=%s, mem_id=%08x, words=%u, offset=%d, contents=[%s]",
+ __entry->name, __entry->mem_id,
+ __entry->words, __entry->offset,
+ __print_hex(__get_dynamic_array(cmdbuf),
+ __entry->cmdbuf ? __entry->words * 4 : 0))
+);
+
+TRACE_EVENT(nvhost_channel_write_reloc,
+ TP_PROTO(const char *name),
+
+ TP_ARGS(name),
+
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ ),
+
+ TP_fast_assign(
+ __entry->name = name;
+ ),
+
+ TP_printk("name=%s",
+ __entry->name)
+);
+
+TRACE_EVENT(nvhost_channel_write_waitchks,
+ TP_PROTO(const char *name, u32 waitchks, u32 waitmask),
+
+ TP_ARGS(name, waitchks, waitmask),
+
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ __field(u32, waitchks)
+ __field(u32, waitmask)
+ ),
+
+ TP_fast_assign(
+ __entry->name = name;
+ __entry->waitchks = waitchks;
+ __entry->waitmask = waitmask;
+ ),
+
+ TP_printk("name=%s, waitchks=%u, waitmask=%08x",
+ __entry->name, __entry->waitchks, __entry->waitmask)
+);
+
+TRACE_EVENT(nvhost_channel_context_switch,
+ TP_PROTO(const char *name, void *old_ctx, void *new_ctx),
+
+ TP_ARGS(name, old_ctx, new_ctx),
+
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ __field(void*, old_ctx)
+ __field(void*, new_ctx)
+ ),
+
+ TP_fast_assign(
+ __entry->name = name;
+ __entry->old_ctx = old_ctx;
+ __entry->new_ctx = new_ctx;
+ ),
+
+ TP_printk("name=%s, old=%p, new=%p",
+ __entry->name, __entry->old_ctx, __entry->new_ctx)
+);
+
+TRACE_EVENT(nvhost_ctrlopen,
+ TP_PROTO(const char *name),
+ TP_ARGS(name),
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ ),
+ TP_fast_assign(
+ __entry->name = name
+ ),
+ TP_printk("name=%s", __entry->name)
+);
+
+TRACE_EVENT(nvhost_ctrlrelease,
+ TP_PROTO(const char *name),
+ TP_ARGS(name),
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ ),
+ TP_fast_assign(
+ __entry->name = name
+ ),
+ TP_printk("name=%s", __entry->name)
+);
+
+TRACE_EVENT(nvhost_ioctl_ctrl_module_mutex,
+ TP_PROTO(u32 lock, u32 id),
+
+ TP_ARGS(lock, id),
+
+ TP_STRUCT__entry(
+ __field(u32, lock);
+ __field(u32, id);
+ ),
+
+ TP_fast_assign(
+ __entry->lock = lock;
+ __entry->id = id;
+ ),
+
+ TP_printk("lock=%u, id=%d",
+ __entry->lock, __entry->id)
+ );
+
+TRACE_EVENT(nvhost_ioctl_ctrl_syncpt_incr,
+ TP_PROTO(u32 id),
+
+ TP_ARGS(id),
+
+ TP_STRUCT__entry(
+ __field(u32, id);
+ ),
+
+ TP_fast_assign(
+ __entry->id = id;
+ ),
+
+ TP_printk("id=%d", __entry->id)
+);
+
+TRACE_EVENT(nvhost_ioctl_ctrl_syncpt_read,
+ TP_PROTO(u32 id, u32 value),
+
+ TP_ARGS(id, value),
+
+ TP_STRUCT__entry(
+ __field(u32, id);
+ __field(u32, value);
+ ),
+
+ TP_fast_assign(
+ __entry->id = id;
+ __entry->value = value;
+ ),
+
+ TP_printk("id=%d, value=%d", __entry->id, __entry->value)
+);
+
+TRACE_EVENT(nvhost_ioctl_ctrl_syncpt_wait,
+ TP_PROTO(u32 id, u32 threshold, s32 timeout, u32 value, int err),
+
+ TP_ARGS(id, threshold, timeout, value, err),
+
+ TP_STRUCT__entry(
+ __field(u32, id)
+ __field(u32, threshold)
+ __field(s32, timeout)
+ __field(u32, value)
+ __field(int, err)
+ ),
+
+ TP_fast_assign(
+ __entry->id = id;
+ __entry->threshold = threshold;
+ __entry->timeout = timeout;
+ __entry->value = value;
+ __entry->err = err;
+ ),
+
+ TP_printk("id=%u, threshold=%u, timeout=%d, value=%u, err=%d",
+ __entry->id, __entry->threshold, __entry->timeout,
+ __entry->value, __entry->err)
+);
+
+TRACE_EVENT(nvhost_ioctl_ctrl_module_regrdwr,
+ TP_PROTO(u32 id, u32 num_offsets, bool write),
+
+ TP_ARGS(id, num_offsets, write),
+
+ TP_STRUCT__entry(
+ __field(u32, id)
+ __field(u32, num_offsets)
+ __field(bool, write)
+ ),
+
+ TP_fast_assign(
+ __entry->id = id;
+ __entry->num_offsets = num_offsets;
+ __entry->write = write;
+ ),
+
+ TP_printk("id=%u, num_offsets=%u, write=%d",
+ __entry->id, __entry->num_offsets, __entry->write)
+);
+
+TRACE_EVENT(nvhost_channel_submitted,
+ TP_PROTO(const char *name, u32 syncpt_base, u32 syncpt_max),
+
+ TP_ARGS(name, syncpt_base, syncpt_max),
+
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ __field(u32, syncpt_base)
+ __field(u32, syncpt_max)
+ ),
+
+ TP_fast_assign(
+ __entry->name = name;
+ __entry->syncpt_base = syncpt_base;
+ __entry->syncpt_max = syncpt_max;
+ ),
+
+ TP_printk("name=%s, syncpt_base=%d, syncpt_max=%d",
+ __entry->name, __entry->syncpt_base, __entry->syncpt_max)
+);
+
+TRACE_EVENT(nvhost_channel_submit_complete,
+ TP_PROTO(const char *name, int count, u32 thresh),
+
+ TP_ARGS(name, count, thresh),
+
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ __field(int, count)
+ __field(u32, thresh)
+ ),
+
+ TP_fast_assign(
+ __entry->name = name;
+ __entry->count = count;
+ __entry->thresh = thresh;
+ ),
+
+ TP_printk("name=%s, count=%d, thresh=%d",
+ __entry->name, __entry->count, __entry->thresh)
+);
+
+TRACE_EVENT(nvhost_wait_cdma,
+ TP_PROTO(const char *name, u32 eventid),
+
+ TP_ARGS(name, eventid),
+
+ TP_STRUCT__entry(
+ __field(const char *, name)
+ __field(u32, eventid)
+ ),
+
+ TP_fast_assign(
+ __entry->name = name;
+ __entry->eventid = eventid;
+ ),
+
+ TP_printk("name=%s, event=%d", __entry->name, __entry->eventid)
+);
+
+#endif /* _TRACE_NVHOST_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index 6bca4cc0063c..5f172703eb4f 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -298,7 +298,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template,
__array(char, name, 32)
__field(unsigned long, ino)
__field(unsigned long, state)
- __field(unsigned long, age)
+ __field(unsigned long, dirtied_when)
__field(unsigned long, writeback_index)
__field(long, nr_to_write)
__field(unsigned long, wrote)
@@ -309,19 +309,19 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template,
dev_name(inode->i_mapping->backing_dev_info->dev), 32);
__entry->ino = inode->i_ino;
__entry->state = inode->i_state;
- __entry->age = (jiffies - inode->dirtied_when) *
- 1000 / HZ;
+ __entry->dirtied_when = inode->dirtied_when;
__entry->writeback_index = inode->i_mapping->writeback_index;
__entry->nr_to_write = nr_to_write;
__entry->wrote = nr_to_write - wbc->nr_to_write;
),
- TP_printk("bdi %s: ino=%lu state=%s age=%lu "
+ TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu "
"index=%lu to_write=%ld wrote=%lu",
__entry->name,
__entry->ino,
show_inode_state(__entry->state),
- __entry->age,
+ __entry->dirtied_when,
+ (jiffies - __entry->dirtied_when) / HZ,
__entry->writeback_index,
__entry->nr_to_write,
__entry->wrote