Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pm: cpupower: bindings: Add test to confirm cpu state is disabled

Add a simple test to confirm and print out the cpu state.

Signed-off-by: "John B. Wyatt IV" <jwyatt@redhat.com>
Signed-off-by: "John B. Wyatt IV" <sageofredondo@gmail.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

John B. Wyatt IV and committed by
Shuah Khan
b6a2dbf8 2314dca1

+16
+16
tools/power/cpupower/bindings/python/test_raw_pylibcpupower.py
··· 31 31 case _: 32 32 print(f"Not documented: {cstate_disabled}") 33 33 34 + """ 35 + Test cstate is disabled 36 + """ 37 + is_cstate_disabled = p.cpuidle_is_state_disabled(0, 0) 38 + 39 + match is_cstate_disabled: 40 + case 1: 41 + print(f"CPU is disabled") 42 + case 0: 43 + print(f"CPU is enabled") 44 + case -1: 45 + print(f"Idlestate not available") 46 + case -2: 47 + print(f"Disabling is not supported by kernel") 48 + case _: 49 + print(f"Not documented: {is_cstate_disabled}") 34 50 35 51 # Pointer example 36 52