[Virtio-fs] [PATCH v2 2/3] virtio-fs: add ftrace events
Masayoshi Mizuma
msys.mizuma at gmail.com
Wed Aug 21 04:40:13 UTC 2019
From: Masayoshi Mizuma <m.mizuma at jp.fujitsu.com>
Introduce the following ftrace events.
- virtio_fs_request_dispatched
- virtio_fs_request_done
- virtio_fs_hiprio_request_dispatched
- virtio_fs_hiprio_request_done
Signed-off-by: Masayoshi Mizuma <m.mizuma at jp.fujitsu.com>
---
include/trace/events/virtio_fs.h | 131 +++++++++++++++++++++++++++++++
1 file changed, 131 insertions(+)
create mode 100644 include/trace/events/virtio_fs.h
diff --git a/include/trace/events/virtio_fs.h b/include/trace/events/virtio_fs.h
new file mode 100644
index 000000000..84ccfa7eb
--- /dev/null
+++ b/include/trace/events/virtio_fs.h
@@ -0,0 +1,131 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM virtio_fs
+
+#if !defined(_TRACE_VIRTIO_FS_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_VIRTIO_FS_H
+
+#include <linux/tracepoint.h>
+#include <trace/events/fuse_common.h>
+
+TRACE_EVENT(virtio_fs_request_dispatched,
+
+ TP_PROTO(uint32_t opcode, uint64_t unique, uint64_t nodeid,
+ uint32_t inlen, unsigned long flags, bool notify),
+
+ TP_ARGS(opcode, unique, nodeid, inlen, flags, notify),
+
+ TP_STRUCT__entry(
+ __field(uint32_t, opcode)
+ __field(uint64_t, unique)
+ __field(uint64_t, nodeid)
+ __field(uint32_t, inlen)
+ __field(unsigned long, flags)
+ __field(bool, notify)
+ ),
+
+ TP_fast_assign(
+ __entry->opcode = opcode;
+ __entry->unique = unique;
+ __entry->nodeid = nodeid;
+ __entry->inlen = inlen;
+ __entry->flags = flags;
+ __entry->notify = notify;
+ ),
+
+ TP_printk("opcode %s unique %#llx nodeid %#llx in.len %u flags %s notify %d\n",
+ show_opcode_name(__entry->opcode),
+ __entry->unique, __entry->nodeid,
+ __entry->inlen, show_req_flag(__entry->flags),
+ __entry->notify)
+);
+
+TRACE_EVENT(virtio_fs_request_done,
+
+ TP_PROTO(uint32_t opcode, uint64_t unique, uint64_t nodeid,
+ uint32_t inlen, unsigned long flags),
+
+ TP_ARGS(opcode, unique, nodeid, inlen, flags),
+
+ TP_STRUCT__entry(
+ __field(uint32_t, opcode)
+ __field(uint64_t, unique)
+ __field(uint64_t, nodeid)
+ __field(uint32_t, inlen)
+ __field(unsigned long, flags)
+ ),
+
+ TP_fast_assign(
+ __entry->opcode = opcode;
+ __entry->unique = unique;
+ __entry->nodeid = nodeid;
+ __entry->inlen = inlen;
+ __entry->flags = flags;
+ ),
+
+ TP_printk("opcode %s unique %#llx nodeid %#llx in.len %u flags %s\n",
+ show_opcode_name(__entry->opcode),
+ __entry->unique, __entry->nodeid,
+ __entry->inlen, show_req_flag(__entry->flags))
+);
+
+TRACE_EVENT(virtio_fs_hiprio_request_dispatched,
+
+ TP_PROTO(uint32_t opcode, uint64_t unique, uint64_t nodeid,
+ uint32_t inlen, bool notify),
+
+ TP_ARGS(opcode, unique, nodeid, inlen, notify),
+
+ TP_STRUCT__entry(
+ __field(uint32_t, opcode)
+ __field(uint64_t, unique)
+ __field(uint64_t, nodeid)
+ __field(uint32_t, inlen)
+ __field(bool, notify)
+ ),
+
+ TP_fast_assign(
+ __entry->opcode = opcode;
+ __entry->unique = unique;
+ __entry->nodeid = nodeid;
+ __entry->inlen = inlen;
+ __entry->notify = notify;
+ ),
+
+ TP_printk("opcode %s unique %#llx nodeid %#llx in.len %u notify %d\n",
+ show_opcode_name(__entry->opcode),
+ __entry->unique, __entry->nodeid,
+ __entry->inlen, __entry->notify)
+);
+
+TRACE_EVENT(virtio_fs_hiprio_request_done,
+
+ TP_PROTO(uint32_t opcode, uint64_t unique, uint64_t nodeid,
+ uint32_t inlen),
+
+ TP_ARGS(opcode, unique, nodeid, inlen),
+
+ TP_STRUCT__entry(
+ __field(uint32_t, opcode)
+ __field(uint64_t, unique)
+ __field(uint64_t, nodeid)
+ __field(uint32_t, inlen)
+ ),
+
+ TP_fast_assign(
+ __entry->opcode = opcode;
+ __entry->unique = unique;
+ __entry->nodeid = nodeid;
+ __entry->inlen = inlen;
+ ),
+
+ TP_printk("opcode %s unique %#llx nodeid %#llx in.len %u\n",
+ show_opcode_name(__entry->opcode),
+ __entry->unique, __entry->nodeid,
+ __entry->inlen)
+);
+
+#endif /* _TRACE_VIRTIO_FS_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
--
2.18.1
More information about the Virtio-fs
mailing list