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

Add CPU and kernel checks to performance tests #213

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

fhunleth
Copy link
Contributor

@fhunleth fhunleth commented Oct 21, 2024

Dynamic CPU frequency scaling and Linux kernel differences cause
performance numbers to be quite different so include this in the report.

This also provides warnings when dynamic CPU frequency governors are in
use or when the CPU frequency is different between cores.

Here's what the report looks like now:

iex(4)> Circuits.GPIO.Diagnostics.report("GPIO16", "GPIO20")
Circuits.GPIO Diagnostics 2.1.2

Output GPIO: "GPIO16"
Input GPIO:  "GPIO20"

Output ids:  %{label: "GPIO16", location: {"gpiochip0", 16}, controller: "pinctrl-bcm2711"}
Input ids:   %{label: "GPIO20", location: {"gpiochip0", 20}, controller: "pinctrl-bcm2711"}
Backend: Circuits.GPIO.CDev

== Functionality ==

Simple writes and reads work: PASSED
Can set 0 on open: PASSED
Can set 1 on open: PASSED
Input interrupts sent: PASSED
Interrupt timing sane: PASSED
Internal pullup works: PASSED
Internal pulldown works: PASSED

== Performance ==

Kernel:      Linux version 6.6.31-v8 (buildroot@buildroot) (aarch64-nerves-linux-gnu-gcc (crosstool-NG UNKNOWN) 13.2.0, GNU ld (crosstool-NG UNKNOWN) 2.40) #1 SMP PREEMPT Fri Aug 30 21:01:41 UTC 2024
CPU count:   4
CPU speed:   600.0 MHz
Warnings?:   false

write/2:     2.396 µs/call
read/1:      2.353 µs/call
write_one/3: 326.518 µs/call
read_one/2:  327.227 µs/call

All tests passed

Dynamic CPU frequency scaling and Linux kernel differences cause
performance numbers to be quite different so include this in the report.

This also provides warnings when dynamic CPU frequency governors are in
use or when the CPU frequency is different between cores.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant