aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-12-30 03:11:20 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2014-12-30 03:32:08 -0500
commit255047b0dca31e6b8ce254481a0b65d559d2ebb8 (patch)
tree96fdd54449eaca43ee4b32bd4cd1b38f85363860 /net/bluetooth
parentfb2969a3a9a66a93f4c39e0c9f96e8bbb18e37a1 (diff)
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.c10
1 files changed, 9 insertions, 1 deletions
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)
3259static int __init run_selftests(struct crypto_blkcipher *tfm_aes, 3259static int __init run_selftests(struct crypto_blkcipher *tfm_aes,
3260 struct crypto_hash *tfm_cmac) 3260 struct crypto_hash *tfm_cmac)
3261{ 3261{
3262 ktime_t calltime, delta, rettime;
3263 unsigned long long duration;
3262 int err; 3264 int err;
3263 3265
3266 calltime = ktime_get();
3267
3264 err = test_ah(tfm_aes); 3268 err = test_ah(tfm_aes);
3265 if (err) { 3269 if (err) {
3266 BT_ERR("smp_ah test failed"); 3270 BT_ERR("smp_ah test failed");
@@ -3309,7 +3313,11 @@ static int __init run_selftests(struct crypto_blkcipher *tfm_aes,
3309 return err; 3313 return err;
3310 } 3314 }
3311 3315
3312 BT_INFO("SMP test passed"); 3316 rettime = ktime_get();
3317 delta = ktime_sub(rettime, calltime);
3318 duration = (unsigned long long) ktime_to_ns(delta) >> 10;
3319
3320 BT_INFO("SMP test passed in %lld usecs", duration);
3313 3321
3314 return 0; 3322 return 0;
3315} 3323}