From c7054aad538c18bc4c311e74a24cb2e205f02e04 Mon Sep 17 00:00:00 2001 From: Jon Medhurst Date: Sat, 27 Aug 2011 12:40:30 +0100 Subject: ARM: kprobes: Add Thumb instruction simulation test cases Signed-off-by: Jon Medhurst Acked-by: Nicolas Pitre --- arch/arm/kernel/kprobes-test.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'arch/arm/kernel/kprobes-test.c') diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c index e22c3f2aff1..1cef0fa996e 100644 --- a/arch/arm/kernel/kprobes-test.c +++ b/arch/arm/kernel/kprobes-test.c @@ -1117,6 +1117,15 @@ end: * Top level test functions */ +static int run_test_cases(void (*tests)(void)) +{ + pr_info(" Run test cases\n"); + tests(); + + return 0; +} + + static int __init run_all_tests(void) { int ret = 0; @@ -1147,8 +1156,24 @@ static int __init run_all_tests(void) if (ret) goto out; + pr_info("16-bit Thumb instruction simulation\n"); + ret = run_test_cases(kprobe_thumb16_test_cases); + if (ret) + goto out; + + pr_info("32-bit Thumb instruction simulation\n"); + ret = run_test_cases(kprobe_thumb32_test_cases); + if (ret) + goto out; #endif + pr_info("Total instruction simulation tests=%d, pass=%d fail=%d\n", + test_try_count, test_pass_count, test_fail_count); + if (test_fail_count) { + ret = -EINVAL; + goto out; + } + out: if (ret == 0) pr_info("Finished kprobe tests OK\n"); -- cgit v1.2.3