[PATCH] fuse: add tracepoints for request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Change-Id: I361d582f30a04040969f1774064d5d1a4b646389
Signed-off-by: Lianjun Huang <hljhnu@xxxxxxxxx>
---
 fs/fuse/dev.c               |  4 ++++
 include/trace/events/fuse.h | 27 +++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 include/trace/events/fuse.h

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 9d2d321bd60b..83f20799683d 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -23,6 +23,8 @@
 #include <linux/splice.h>
 #include <linux/sched.h>
 #include <linux/freezer.h>
+#define CREATE_TRACE_POINTS
+#include <trace/events/fuse.h>
 
 MODULE_ALIAS_MISCDEV(FUSE_MINOR);
 MODULE_ALIAS("devname:fuse");
@@ -323,6 +325,7 @@ static u64 fuse_get_unique(struct fuse_iqueue *fiq)
 
 static void queue_request(struct fuse_iqueue *fiq, struct fuse_req *req)
 {
+	trace_fuse_info(req->in.h.opcode, req->in.h.unique, req->in.h.nodeid, "queue request");
 	req->in.h.len = sizeof(struct fuse_in_header) +
 		len_args(req->in.numargs, (struct fuse_arg *) req->in.args);
 	list_add_tail(&req->list, &fiq->pending);
@@ -417,6 +420,7 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
 	if (req->end)
 		req->end(fc, req);
 put_request:
+	trace_fuse_info(req->in.h.opcode, req->in.h.unique, req->in.h.nodeid, "request end");
 	fuse_put_request(fc, req);
 }
 
diff --git a/include/trace/events/fuse.h b/include/trace/events/fuse.h
new file mode 100644
index 000000000000..da471c0db9b6
--- /dev/null
+++ b/include/trace/events/fuse.h
@@ -0,0 +1,27 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM fuse
+#if !defined(_TRACE_FUSE_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_FUSE_H
+#include <linux/tracepoint.h>
+
+TRACE_EVENT(fuse_info,
+		TP_PROTO(uint32_t opcode, uint64_t unique, uint64_t nodeid, const char *info),
+		TP_ARGS(opcode, unique, nodeid, info),
+		TP_STRUCT__entry(
+			__field(uint32_t, opcode)
+			__field(uint64_t, unique)
+			__field(uint64_t, nodeid)
+			__string(info, info)
+			),
+		TP_fast_assign(
+			__entry->opcode	= opcode;
+			__entry->unique = unique;
+			__entry->nodeid = nodeid;
+			__assign_str(info, info);
+			),
+		TP_printk("fuse: opcode %u, unique %lu, nodeid %lu %s\n",
+			__entry->opcode, __entry->unique, __entry->nodeid, __get_str(info))
+	   );
+#endif
+
+#include <trace/define_trace.h>
-- 
2.17.1




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux