From 0162f826f3746efe0aa23698db8009738c89f04e Mon Sep 17 00:00:00 2001 From: Lee Susman Date: Thu, 4 Dec 2014 00:11:56 +0200 Subject: [PATCH] mmc: card: Add long sequential read test to test-iosched Long sequential read test measures read throughput at the driver level by reading large requests sequentially. Change-Id: I3b6d685930e1d0faceabbc7d20489111734cc9d4 Signed-off-by: Lee Susman [merez@codeaurora.org: Fix conflicts as BKOPS tests were removed] Signed-off-by: Maya Erez [venkatg@codeaurora.org: Drop changes to mmc_block_test.c] Signed-off-by: Venkat Gopalakrishnan --- block/test-iosched.c | 7 ++++++- include/linux/test-iosched.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/block/test-iosched.c b/block/test-iosched.c index 7c5347773759..76178e819e6a 100644 --- a/block/test-iosched.c +++ b/block/test-iosched.c @@ -95,6 +95,9 @@ static void check_test_completion(void) return; } + ptd->test_info.test_duration = jiffies - + ptd->test_info.test_duration; + test_pr_info("%s: Test is completed", __func__); test_iosched_mark_test_completion(); @@ -124,7 +127,7 @@ static void end_test_req(struct request *rq, int err) test_rq = (struct test_request *)rq->elv.priv[0]; BUG_ON(!test_rq); - test_pr_info("%s: request %d completed, err=%d", + test_pr_debug("%s: request %d completed, err=%d", __func__, test_rq->req_id, err); test_rq->req_completed = true; @@ -671,6 +674,7 @@ int test_iosched_start_test(struct test_info *t_info) goto error; } + ptd->test_info.test_duration = jiffies; ret = run_test(ptd); if (ret) { test_pr_err("%s: failed to run the test\n", __func__); @@ -680,6 +684,7 @@ int test_iosched_start_test(struct test_info *t_info) test_pr_info("%s: Waiting for the test completion", __func__); wait_event(ptd->wait_q, ptd->test_state == TEST_COMPLETED); + t_info->test_duration = ptd->test_info.test_duration; del_timer_sync(&ptd->timeout_timer); ret = check_test_result(ptd); diff --git a/include/linux/test-iosched.h b/include/linux/test-iosched.h index c1d8056143a8..e8d1f740072f 100644 --- a/include/linux/test-iosched.h +++ b/include/linux/test-iosched.h @@ -128,6 +128,8 @@ struct test_request { * @check_test_result_fn: Test specific test result checking * callback * @get_test_case_str_fn: Test specific function to get the test name + * @test_duration: A jiffies value saved for timing + * calculations * @data: Test specific private data */ struct test_info { @@ -138,6 +140,7 @@ struct test_info { check_test_result_fn *check_test_result_fn; post_test_fn *post_test_fn; get_test_case_str_fn *get_test_case_str_fn; + unsigned long test_duration; void *data; };