From: Marcel Holtmann Date: Tue, 30 Dec 2014 08:11:20 +0000 (-0800) Subject: Bluetooth: Add timing information to SMP test case runs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=255047b0dca31e6b8ce254481a0b65d559d2ebb8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Bluetooth: Add timing information to SMP test case runs After successful completion of the SMP test cases, print the time it took to run them. Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg --- diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 3a4333b5801a..358264c0e785 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -3259,8 +3259,12 @@ static int __init test_h6(struct crypto_hash *tfm_cmac) static int __init run_selftests(struct crypto_blkcipher *tfm_aes, struct crypto_hash *tfm_cmac) { + ktime_t calltime, delta, rettime; + unsigned long long duration; int err; + calltime = ktime_get(); + err = test_ah(tfm_aes); if (err) { BT_ERR("smp_ah test failed"); @@ -3309,7 +3313,11 @@ static int __init run_selftests(struct crypto_blkcipher *tfm_aes, return err; } - BT_INFO("SMP test passed"); + rettime = ktime_get(); + delta = ktime_sub(rettime, calltime); + duration = (unsigned long long) ktime_to_ns(delta) >> 10; + + BT_INFO("SMP test passed in %lld usecs", duration); return 0; }