All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Brandenburg <martin@omnibond.com>
To: hubcap@omnibond.com, linux-fsdevel@vger.kernel.org
Cc: Martin Brandenburg <martin@omnibond.com>
Subject: [PATCH 09/24] orangefs: tracepoints for orangefs_devreq_{read,write_iter,poll}
Date: Tue, 20 Mar 2018 17:02:19 +0000	[thread overview]
Message-ID: <20180320170234.1412-10-martin@omnibond.com> (raw)
In-Reply-To: <20180320170234.1412-1-martin@omnibond.com>

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
---
 fs/orangefs/devorangefs-req.c | 14 ++++++++++--
 fs/orangefs/orangefs-trace.h  | 50 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+), 2 deletions(-)

diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c
index f4a1eff35e59..e33bfeac92e8 100644
--- a/fs/orangefs/devorangefs-req.c
+++ b/fs/orangefs/devorangefs-req.c
@@ -11,6 +11,7 @@
 #include "orangefs-kernel.h"
 #include "orangefs-bufmap.h"
 #include "orangefs-debugfs.h"
+#include "orangefs-trace.h"
 
 #include <linux/debugfs.h>
 #include <linux/slab.h>
@@ -180,8 +181,10 @@ static ssize_t orangefs_devreq_read(struct file *file,
 	}
 
 	/* Check for an empty list before locking. */
-	if (list_empty(&orangefs_request_list))
+	if (list_empty(&orangefs_request_list)) {
+		trace_orangefs_devreq_read(0, 1, NULL);
 		return -EAGAIN;
+	}
 
 restart:
 	cur_op = NULL;
@@ -250,6 +253,7 @@ static ssize_t orangefs_devreq_read(struct file *file,
 	 */
 	if (!cur_op) {
 		spin_unlock(&orangefs_request_list_lock);
+		trace_orangefs_devreq_read(0, 0, NULL);
 		return -EAGAIN;
 	}
 
@@ -314,6 +318,7 @@ static ssize_t orangefs_devreq_read(struct file *file,
 	spin_unlock(&cur_op->lock);
 	spin_unlock(&orangefs_htable_ops_in_progress_lock);
 
+	trace_orangefs_devreq_read(1, 0, cur_op);
 	/* The client only asks to read one size buffer. */
 	return MAX_DEV_REQ_UPSIZE;
 error:
@@ -340,6 +345,7 @@ static ssize_t orangefs_devreq_read(struct file *file,
 		complete(&cur_op->waitq);
 	}
 	spin_unlock(&orangefs_request_list_lock);
+	trace_orangefs_devreq_read(0, 0, cur_op);
 	return -EFAULT;
 }
 
@@ -474,6 +480,7 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
 	}
 
 wakeup:
+	trace_orangefs_devreq_write_iter(op);
 	/*
 	 * Return to vfs waitqueue, and back to service_operation
 	 * through wait_for_matching_downcall. 
@@ -781,11 +788,14 @@ static __poll_t orangefs_devreq_poll(struct file *file,
 				      struct poll_table_struct *poll_table)
 {
 	__poll_t poll_revent_mask = 0;
+	int empty;
 
 	poll_wait(file, &orangefs_request_list_waitq, poll_table);
 
-	if (!list_empty(&orangefs_request_list))
+	empty = list_empty(&orangefs_request_list);
+	if (!empty)
 		poll_revent_mask |= EPOLLIN;
+	trace_orangefs_devreq_poll(empty);
 	return poll_revent_mask;
 }
 
diff --git a/fs/orangefs/orangefs-trace.h b/fs/orangefs/orangefs-trace.h
index 73feffc43d93..16e2b5a86071 100644
--- a/fs/orangefs/orangefs-trace.h
+++ b/fs/orangefs/orangefs-trace.h
@@ -13,6 +13,56 @@
 
 #define OP_NAME_LEN 64
 
+TRACE_EVENT(orangefs_devreq_poll,
+    TP_PROTO(int empty),
+    TP_ARGS(empty),
+    TP_STRUCT__entry(
+        __field(int, empty)
+    ),
+    TP_fast_assign(
+        __entry->empty = empty;
+    ),
+    TP_printk(
+        "empty=%d", __entry->empty
+    )
+);
+
+TRACE_EVENT(orangefs_devreq_read,
+    TP_PROTO(int success, int empty, struct orangefs_kernel_op_s *op),
+    TP_ARGS(success, empty, op),
+    TP_STRUCT__entry(
+        __field(int, success)
+        __field(int, empty)
+        __array(char, op_name, OP_NAME_LEN)
+    ),
+    TP_fast_assign(
+        __entry->success = success;
+        __entry->empty = empty;
+        if (op)
+            strlcpy(__entry->op_name, get_opname_string(op), OP_NAME_LEN);
+        else
+            __entry->op_name[0] = 0;
+    ),
+    TP_printk(
+        "success=%d empty=%d op_name=%s", __entry->success, __entry->empty,
+        __entry->op_name
+    )
+);
+
+TRACE_EVENT(orangefs_devreq_write_iter,
+    TP_PROTO(struct orangefs_kernel_op_s *op),
+    TP_ARGS(op),
+    TP_STRUCT__entry(
+        __array(char, op_name, OP_NAME_LEN)
+    ),
+    TP_fast_assign(
+        strlcpy(__entry->op_name, get_opname_string(op), OP_NAME_LEN);
+    ),
+    TP_printk(
+        "op_name=%s", __entry->op_name
+    )
+);
+
 TRACE_EVENT(orangefs_service_operation,
     TP_PROTO(struct orangefs_kernel_op_s *op, int flags),
     TP_ARGS(op, flags),
-- 
2.16.2

  parent reply	other threads:[~2018-03-20 17:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-20 17:02 [PATCH 00/24] orangefs: page cache Martin Brandenburg
2018-03-20 17:02 ` [PATCH 01/24] orangefs: make several *_operations structs static Martin Brandenburg
2018-03-20 17:02 ` [PATCH 02/24] orangefs: remove unused code Martin Brandenburg
2018-03-20 17:02 ` [PATCH 03/24] orangefs: create uapi interface Martin Brandenburg
2018-03-20 17:02 ` [PATCH 04/24] orangefs: open code short single-use functions Martin Brandenburg
2018-03-20 17:02 ` [PATCH 05/24] orangefs: implement vm_ops->fault Martin Brandenburg
2018-03-20 17:02 ` [PATCH 06/24] orangefs: implement xattr cache Martin Brandenburg
2018-03-20 17:02 ` [PATCH 07/24] orangefs: simpler installation documentation Martin Brandenburg
2018-03-20 17:02 ` [PATCH 08/24] orangefs: add tracepoint for service_operation Martin Brandenburg
2018-03-20 17:02 ` Martin Brandenburg [this message]
2018-03-20 17:02 ` [PATCH 10/24] orangefs: do not invalidate attributes on inode create Martin Brandenburg
2018-03-20 17:02 ` [PATCH 11/24] orangefs: simply orangefs_inode_getattr interface Martin Brandenburg
2018-03-20 17:02 ` [PATCH 12/24] orangefs: update attributes rather than relying on server Martin Brandenburg
2018-03-20 17:02 ` [PATCH 13/24] orangefs: hold i_lock during inode_getattr Martin Brandenburg
2018-03-20 17:02 ` [PATCH 14/24] orangefs: set up and use backing_dev_info Martin Brandenburg
2018-03-20 17:02 ` [PATCH 15/24] orangefs: let setattr write to cached inode Martin Brandenburg
2018-03-20 17:02 ` [PATCH 16/24] orangefs: reorganize setattr functions to track attribute changes Martin Brandenburg
2018-03-20 17:02 ` [PATCH 17/24] orangefs: remove orangefs_readpages Martin Brandenburg
2018-03-20 17:02 ` [PATCH 18/24] orangefs: service ops done for writeback are not killable Martin Brandenburg
2018-03-20 17:02 ` [PATCH 19/24] orangefs: migrate to generic_file_read_iter Martin Brandenburg
2018-03-20 17:02 ` [PATCH 20/24] orangefs: implement writepage Martin Brandenburg
2018-03-20 17:02 ` [PATCH 21/24] orangefs: skip inode writeout if nothing to write Martin Brandenburg
2018-03-20 17:02 ` [PATCH 22/24] orangefs: write range tracking Martin Brandenburg
2018-03-20 17:02 ` [PATCH 23/24] orangefs: tracepoints for readpage and writeback Martin Brandenburg
2018-03-20 17:02 ` [PATCH 24/24] orangefs: tracepoints for getattr, setattr, and write_inode Martin Brandenburg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180320170234.1412-10-martin@omnibond.com \
    --to=martin@omnibond.com \
    --cc=hubcap@omnibond.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.