diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-12-30 03:11:21 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-12-30 03:32:11 -0500 |
commit | e64b4fb66cc428cef0a62ea899b671c1aad05f3a (patch) | |
tree | ea82d8cd4ba86aa15a416d4ddbd110935bf2a158 /net/bluetooth/selftest.c | |
parent | 255047b0dca31e6b8ce254481a0b65d559d2ebb8 (diff) |
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: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/selftest.c')
-rw-r--r-- | net/bluetooth/selftest.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/bluetooth/selftest.c b/net/bluetooth/selftest.c index a7602b3d0b0d..9c67315172cf 100644 --- a/net/bluetooth/selftest.c +++ b/net/bluetooth/selftest.c | |||
@@ -156,8 +156,12 @@ static int __init test_ecdh_sample(const u8 priv_a[32], const u8 priv_b[32], | |||
156 | 156 | ||
157 | static int __init test_ecdh(void) | 157 | static int __init test_ecdh(void) |
158 | { | 158 | { |
159 | ktime_t calltime, delta, rettime; | ||
160 | unsigned long long duration; | ||
159 | int err; | 161 | int err; |
160 | 162 | ||
163 | calltime = ktime_get(); | ||
164 | |||
161 | err = test_ecdh_sample(priv_a_1, priv_b_1, pub_a_1, pub_b_1, dhkey_1); | 165 | err = test_ecdh_sample(priv_a_1, priv_b_1, pub_a_1, pub_b_1, dhkey_1); |
162 | if (err) { | 166 | if (err) { |
163 | BT_ERR("ECDH sample 1 failed"); | 167 | BT_ERR("ECDH sample 1 failed"); |
@@ -176,7 +180,11 @@ static int __init test_ecdh(void) | |||
176 | return err; | 180 | return err; |
177 | } | 181 | } |
178 | 182 | ||
179 | BT_INFO("ECDH test passed"); | 183 | rettime = ktime_get(); |
184 | delta = ktime_sub(rettime, calltime); | ||
185 | duration = (unsigned long long) ktime_to_ns(delta) >> 10; | ||
186 | |||
187 | BT_INFO("ECDH test passed in %lld usecs", duration); | ||
180 | 188 | ||
181 | return 0; | 189 | return 0; |
182 | } | 190 | } |