WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 06/10] blktap: Drop the ring message timestamp.

To: Xen <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 06/10] blktap: Drop the ring message timestamp.
From: Daniel Stodden <daniel.stodden@xxxxxxxxxx>
Date: Tue, 8 Mar 2011 16:42:53 -0800
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, Daniel Stodden <daniel.stodden@xxxxxxxxxx>
Delivery-date: Tue, 08 Mar 2011 16:49:34 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1299631377-7853-1-git-send-email-daniel.stodden@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1299631377-7853-1-git-send-email-daniel.stodden@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Using gettimeofday() seems overkill. The debug node now just dumps
struct request age at jiffy resolution, not time of ring
submission. Looks ok because we never really differentiated from block
request time anyway.

Signed-off-by: Daniel Stodden <daniel.stodden@xxxxxxxxxx>
---
 drivers/block/blktap/blktap.h |    1 -
 drivers/block/blktap/ring.c   |    8 +++-----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/block/blktap/blktap.h b/drivers/block/blktap/blktap.h
index 1318cad..05cfd1f 100644
--- a/drivers/block/blktap/blktap.h
+++ b/drivers/block/blktap/blktap.h
@@ -78,7 +78,6 @@ struct blktap_request {
        int                            usr_idx;
 
        int                            operation;
-       struct timeval                 time;
 
        struct scatterlist             sg_table[BLKTAP_SEGMENT_MAX];
        struct page                   *pages[BLKTAP_SEGMENT_MAX];
diff --git a/drivers/block/blktap/ring.c b/drivers/block/blktap/ring.c
index bae6f82..e667d2d 100644
--- a/drivers/block/blktap/ring.c
+++ b/drivers/block/blktap/ring.c
@@ -304,8 +304,6 @@ blktap_ring_submit_request(struct blktap *tap,
        }
 
        ring->ring.req_prod_pvt++;
-
-       do_gettimeofday(&request->time);
 }
 
 static int
@@ -547,20 +545,20 @@ blktap_ring_debug(struct blktap *tap, char *buf, size_t 
size)
 
        for (usr_idx = 0; usr_idx < BLKTAP_RING_SIZE; usr_idx++) {
                struct blktap_request *request;
-               struct timeval *time;
+               struct timeval t;
 
                request = ring->pending[usr_idx];
                if (!request)
                        continue;
 
-               time  = &request->time;
+               jiffies_to_timeval(jiffies - request->rq->start_time, &t);
 
                s += snprintf(s, end - s,
                              "%02d: usr_idx:%02d "
                              "op:%x nr_pages:%02d time:%lu.%09lu\n",
                              usr_idx, request->usr_idx,
                              request->operation, request->nr_pages,
-                             time->tv_sec, time->tv_usec);
+                             t.tv_sec, t.tv_usec);
        }
 
        s += snprintf(s, end - s, "end pending\n");
-- 
1.7.0.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>