aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-09-26 02:32:43 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 11:48:58 -0400
commit8c002494b55119a3fd1dddee83b4fb75cfda47e5 (patch)
tree11e68d48b80d729a492b0f43401798a366ad94b3 /kernel
parentab954160350c91c77ae03740ef90458c3ad5412c (diff)
[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')
-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,
522 unsigned int m; 522 unsigned int m;
523 int ret; 523 int ret;
524 int error = 0; 524 int error = 0;
525 struct timeval start;
526 struct timeval stop;
525 527
526 printk("Loading image data pages (%u pages) ... ", nr_pages); 528 printk("Loading image data pages (%u pages) ... ", nr_pages);
527 m = nr_pages / 100; 529 m = nr_pages / 100;
528 if (!m) 530 if (!m)
529 m = 1; 531 m = 1;
530 nr_pages = 0; 532 nr_pages = 0;
533 do_gettimeofday(&start);
531 do { 534 do {
532 ret = snapshot_write_next(snapshot, PAGE_SIZE); 535 ret = snapshot_write_next(snapshot, PAGE_SIZE);
533 if (ret > 0) { 536 if (ret > 0) {
@@ -539,11 +542,13 @@ static int load_image(struct swap_map_handle *handle,
539 nr_pages++; 542 nr_pages++;
540 } 543 }
541 } while (ret > 0); 544 } while (ret > 0);
545 do_gettimeofday(&stop);
542 if (!error) { 546 if (!error) {
543 printk("\b\b\b\bdone\n"); 547 printk("\b\b\b\bdone\n");
544 if (!snapshot_image_loaded(snapshot)) 548 if (!snapshot_image_loaded(snapshot))
545 error = -ENODATA; 549 error = -ENODATA;
546 } 550 }
551 show_speed(&start, &stop, nr_pages, "Read");
547 return error; 552 return error;
548} 553}
549 554