Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

random: remove rand32_timestamp.c #22951

Merged
merged 1 commit into from
Mar 10, 2020

Conversation

andrewboie
Copy link
Contributor

This is a copy of rand32_timer.c that uses
z_do_read_cpu_timestamp32() instead of k_cycle_get_32(),
with some logic to ensure different values when called in
rapid succession missing.

Like the other driver, its reported values are not random,
it's a testing generator only.

This appears to have no advantages over rand32_timer.c,
just remove it. In QEMU emulation, the reported TSC values
tend to have the lowest five bits zeroed.

Signed-off-by: Andrew Boie andrew.p.boie@intel.com

@andrewboie
Copy link
Contributor Author

For illustration, here's some values reported by QEMU by this mechanism with icount enabled:

rand? bfe63a0
rand? bff84e0
rand? c00a680
rand? c01c8a0
rand? c02ea80
rand? c040c60
rand? c052e80
rand? c065060
rand? c077280
rand? c089460
rand? c09b640
rand? c0ad820
rand? c0bfa00
rand? c0d1c20
rand? c0e3e00
rand? c0f6020
rand? c108240
rand? c11a420
rand? c12c5c0
rand? c13e760
rand? c150900
rand? c162b20
rand? c174cc0
rand? c186e60
rand? c199000
rand? c1ab220
rand? c1bd3c0
rand? c1cf560
rand? c1e1700
rand? c1f38e0
rand? c205a80
rand? c217c60
rand? c229e00
rand? c23bfe0
rand? c24e180
rand? c260320
rand? c272500
rand? c2846e0
rand? c296880
rand? c2a8a20
rand? c2babc0
rand? c2ccd60
rand? c2def00
rand? c2f10e0
rand? c3032c0
rand? c3154a0
rand? c327640
rand? c3397e0
rand? c34b980
rand? c35db20
rand? c36fcc0
rand? c381e60
rand? c394000
rand? c3a6220
rand? c3b83c0
rand? c3ca560
rand? c3dc700
rand? c3ee8e0
rand? c400a80
rand? c412ca0
rand? c424e40
rand? c436fe0
rand? c449180
rand? c45b320

And when I switch to the rand32_timer.c, much better results:

rand? b2d13aa0
rand? 2a06ec6d
rand? a13c9e44
rand? 18725015
rand? 8fa801eb
rand? 6ddb3c2
rand? 7e13650f
rand? f54916e6
rand? 6c7ec8b7
rand? e3b47a87
rand? 5aea2c57
rand? d21fde28
rand? 49558ff8
rand? c08b41c9
rand? 37c0f39f
rand? aef6a576
rand? 262c5747
rand? 9d620917
rand? 1497baee
rand? 8bcd6cbe
rand? 3031e8f
rand? 7a38cfe2
rand? f16e81b3
rand? 68a43383
rand? dfd9e553
rand? 570f9724
rand? ce4548fb
rand? 457afacb
rand? bcb0ac9b
rand? 33e65e72
rand? ab1c1043
rand? 2251c219
rand? 998773ea
rand? 10bd25ba
rand? 87f2d791
rand? ff288961
rand? 765e3b32

I see no value in keeping this around.

@zephyrbot
Copy link
Collaborator

zephyrbot commented Feb 19, 2020

All checks are passing now.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

This is a copy of rand32_timer.c that uses
z_do_read_cpu_timestamp32() instead of k_cycle_get_32(),
with some logic to ensure different values when called in
rapid succession missing.

Like the other driver, its reported values are not random,
it's a testing generator only.

This appears to have no advantages over rand32_timer.c,
just remove it. In QEMU emulation, the reported TSC values
tend to have the lowest five bits zeroed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
@andrewboie andrewboie added this to the v2.3.0 milestone Feb 19, 2020
@nashif nashif merged commit 81cfb08 into zephyrproject-rtos:master Mar 10, 2020
@andrewboie andrewboie deleted the random-x86-fix branch September 24, 2020 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants