Skip to contentSkip to conversation

Bluetooth: Add timing information to SMP test case runs

PATCH In review Marcel Holtmann 2 participants 2 messages Dec 30, 2014

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/2 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.

---
 net/bluetooth/smp.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
net/bluetooth/smp.c +9 -1
index 3a4333b5801a..358264c0e785 100644
@@ -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;
 }
Signature · 1 line
2.1.0
#1 lore raw

Hi Marcel,

Quoted 7 lines · Marcel Holtmann

After successful completion of the SMP test cases, print the time it took to run them.

---
 net/bluetooth/smp.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Both of these patches have been applied to bluetooth-next. Thanks.

Johan