summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/test-iosched.c7
-rw-r--r--include/linux/test-iosched.h3
2 files changed, 9 insertions, 1 deletions
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;
};