summaryrefslogtreecommitdiffstats
path: root/kernel/power/swap.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-09-26 08:32:43 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 17:48:58 +0200
commit8c002494b55119a3fd1dddee83b4fb75cfda47e5 (patch)
tree11e68d48b80d729a492b0f43401798a366ad94b3 /kernel/power/swap.c
parent[PATCH] swsusp: write speedup (diff)
downloadlinux-8c002494b55119a3fd1dddee83b4fb75cfda47e5.tar.xz
linux-8c002494b55119a3fd1dddee83b4fb75cfda47e5.zip
[PATCH] swsusp: add read-speed instrumentation
Add some instrumentation to the swsusp readin code to show what bandwidth we're achieving. Cc: Pavel Machek <pavel@ucw.cz> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/power/swap.c')
-rw-r--r--kernel/power/swap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 2dc883d361d5..9ab989572164 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -522,12 +522,15 @@ static int load_image(struct swap_map_handle *handle,
unsigned int m;
int ret;
int error = 0;
+ struct timeval start;
+ struct timeval stop;
printk("Loading image data pages (%u pages) ... ", nr_pages);
m = nr_pages / 100;
if (!m)
m = 1;
nr_pages = 0;
+ do_gettimeofday(&start);
do {
ret = snapshot_write_next(snapshot, PAGE_SIZE);
if (ret > 0) {
@@ -539,11 +542,13 @@ static int load_image(struct swap_map_handle *handle,
nr_pages++;
}
} while (ret > 0);
+ do_gettimeofday(&stop);
if (!error) {
printk("\b\b\b\bdone\n");
if (!snapshot_image_loaded(snapshot))
error = -ENODATA;
}
+ show_speed(&start, &stop, nr_pages, "Read");
return error;
}