circuits_gpio
circuits_gpio copied to clipboard
Add CPU and kernel checks to performance tests
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