All of lore.kernel.org
 help / color / mirror / Atom feed
From: Venky Shankar <vshankar@redhat.com>
To: jlayton@redhat.com, pdonnell@redhat.com, xiubli@redhat.com
Cc: ceph-devel@vger.kernel.org, Venky Shankar <vshankar@redhat.com>
Subject: [PATCH v1 1/4] ceph: use "struct ceph_timespec" for r/w/m latencies
Date: Mon, 13 Sep 2021 18:43:08 +0530	[thread overview]
Message-ID: <20210913131311.1347903-2-vshankar@redhat.com> (raw)
In-Reply-To: <20210913131311.1347903-1-vshankar@redhat.com>

Signed-off-by: Venky Shankar <vshankar@redhat.com>
---
 fs/ceph/metric.c | 12 ++++++------
 fs/ceph/metric.h | 17 +++++++----------
 2 files changed, 13 insertions(+), 16 deletions(-)

diff --git a/fs/ceph/metric.c b/fs/ceph/metric.c
index 5ec94bd4c1de..19bca20cf7e1 100644
--- a/fs/ceph/metric.c
+++ b/fs/ceph/metric.c
@@ -56,8 +56,8 @@ static bool ceph_mdsc_send_metrics(struct ceph_mds_client *mdsc,
 	read->data_len = cpu_to_le32(sizeof(*read) - 10);
 	sum = m->read_latency_sum;
 	jiffies_to_timespec64(sum, &ts);
-	read->sec = cpu_to_le32(ts.tv_sec);
-	read->nsec = cpu_to_le32(ts.tv_nsec);
+	read->lat.tv_sec = cpu_to_le32(ts.tv_sec);
+	read->lat.tv_nsec = cpu_to_le32(ts.tv_nsec);
 	items++;
 
 	/* encode the write latency metric */
@@ -68,8 +68,8 @@ static bool ceph_mdsc_send_metrics(struct ceph_mds_client *mdsc,
 	write->data_len = cpu_to_le32(sizeof(*write) - 10);
 	sum = m->write_latency_sum;
 	jiffies_to_timespec64(sum, &ts);
-	write->sec = cpu_to_le32(ts.tv_sec);
-	write->nsec = cpu_to_le32(ts.tv_nsec);
+	write->lat.tv_sec = cpu_to_le32(ts.tv_sec);
+	write->lat.tv_nsec = cpu_to_le32(ts.tv_nsec);
 	items++;
 
 	/* encode the metadata latency metric */
@@ -80,8 +80,8 @@ static bool ceph_mdsc_send_metrics(struct ceph_mds_client *mdsc,
 	meta->data_len = cpu_to_le32(sizeof(*meta) - 10);
 	sum = m->metadata_latency_sum;
 	jiffies_to_timespec64(sum, &ts);
-	meta->sec = cpu_to_le32(ts.tv_sec);
-	meta->nsec = cpu_to_le32(ts.tv_nsec);
+	meta->lat.tv_sec = cpu_to_le32(ts.tv_sec);
+	meta->lat.tv_nsec = cpu_to_le32(ts.tv_nsec);
 	items++;
 
 	/* encode the dentry lease metric */
diff --git a/fs/ceph/metric.h b/fs/ceph/metric.h
index af6038ff39d4..1151d64dbcbc 100644
--- a/fs/ceph/metric.h
+++ b/fs/ceph/metric.h
@@ -2,7 +2,7 @@
 #ifndef _FS_CEPH_MDS_METRIC_H
 #define _FS_CEPH_MDS_METRIC_H
 
-#include <linux/types.h>
+#include <linux/ceph/types.h>
 #include <linux/percpu_counter.h>
 #include <linux/ktime.h>
 
@@ -52,9 +52,8 @@ struct ceph_metric_read_latency {
 	__u8  ver;
 	__u8  compat;
 
-	__le32 data_len; /* length of sizeof(sec + nsec) */
-	__le32 sec;
-	__le32 nsec;
+	__le32 data_len; /* length of sizeof(lat) */
+	struct ceph_timespec lat;
 } __packed;
 
 /* metric write latency header */
@@ -64,9 +63,8 @@ struct ceph_metric_write_latency {
 	__u8  ver;
 	__u8  compat;
 
-	__le32 data_len; /* length of sizeof(sec + nsec) */
-	__le32 sec;
-	__le32 nsec;
+	__le32 data_len; /* length of sizeof(lat) */
+	struct ceph_timespec lat;
 } __packed;
 
 /* metric metadata latency header */
@@ -76,9 +74,8 @@ struct ceph_metric_metadata_latency {
 	__u8  ver;
 	__u8  compat;
 
-	__le32 data_len; /* length of sizeof(sec + nsec) */
-	__le32 sec;
-	__le32 nsec;
+	__le32 data_len; /* length of sizeof(lat) */
+	struct ceph_timespec lat;
 } __packed;
 
 /* metric dentry lease header */
-- 
2.27.0


  reply	other threads:[~2021-09-13 13:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 13:13 [PATCH v1 0/4] ceph: forward average read/write/metadata latency Venky Shankar
2021-09-13 13:13 ` Venky Shankar [this message]
2021-09-13 13:13 ` [PATCH v1 2/4] ceph: track average/stdev r/w/m latency Venky Shankar
2021-09-13 13:13 ` [PATCH v1 3/4] ceph: include average/stddev r/w/m latency in mds metrics Venky Shankar
2021-09-13 13:13 ` [PATCH v1 4/4] ceph: use tracked average r/w/m latencies to display metrics in debugfs Venky Shankar
2021-09-13 15:13 ` [PATCH v1 0/4] ceph: forward average read/write/metadata latency Jeff Layton
2021-09-13 15:21   ` Jeff Layton
2021-09-13 15:41     ` Venky Shankar
2021-09-14 12:53   ` Xiubo Li

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=20210913131311.1347903-2-vshankar@redhat.com \
    --to=vshankar@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=jlayton@redhat.com \
    --cc=pdonnell@redhat.com \
    --cc=xiubli@redhat.com \
    /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.