]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] swsusp: add read-speed instrumentation
authorAndrew Morton <akpm@osdl.org>
Tue, 26 Sep 2006 06:32:43 +0000 (23:32 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 26 Sep 2006 15:48:58 +0000 (08:48 -0700)
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>
kernel/power/swap.c

index 2dc883d361d520419ea3e638634b2cb9b783572b..9ab9895721647382b6b6c492a0debf9967e3ea73 100644 (file)
@@ -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;
 }