diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-12-30 08:11:20 (GMT) |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-12-30 08:32:08 (GMT) |
commit | 255047b0dca31e6b8ce254481a0b65d559d2ebb8 (patch) | |
tree | 96fdd54449eaca43ee4b32bd4cd1b38f85363860 /net/bluetooth | |
parent | fb2969a3a9a66a93f4c39e0c9f96e8bbb18e37a1 (diff) | |
download | linux-255047b0dca31e6b8ce254481a0b65d559d2ebb8.tar.xz |
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 <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/smp.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index 3a4333b..358264c 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; } |