提交 e64b4fb6 编写于 作者: M Marcel Holtmann 提交者: Johan Hedberg

Bluetooth: Add timing information to ECDH test case runs

After successful completion of the ECDH test cases, print the time it
took to run them.
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
上级 255047b0
......@@ -156,8 +156,12 @@ static int __init test_ecdh_sample(const u8 priv_a[32], const u8 priv_b[32],
static int __init test_ecdh(void)
{
ktime_t calltime, delta, rettime;
unsigned long long duration;
int err;
calltime = ktime_get();
err = test_ecdh_sample(priv_a_1, priv_b_1, pub_a_1, pub_b_1, dhkey_1);
if (err) {
BT_ERR("ECDH sample 1 failed");
......@@ -176,7 +180,11 @@ static int __init test_ecdh(void)
return err;
}
BT_INFO("ECDH test passed");
rettime = ktime_get();
delta = ktime_sub(rettime, calltime);
duration = (unsigned long long) ktime_to_ns(delta) >> 10;
BT_INFO("ECDH test passed in %lld usecs", duration);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册