Commit b6a2dbf8 authored by John B. Wyatt IV's avatar John B. Wyatt IV Committed by Shuah Khan
Browse files

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: default avatar"John B. Wyatt IV" <jwyatt@redhat.com>
Signed-off-by: default avatar"John B. Wyatt IV" <sageofredondo@gmail.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 2314dca1
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -31,6 +31,22 @@ match cstate_disabled:
    case _:
        print(f"Not documented: {cstate_disabled}")

"""
Test cstate is disabled
"""
is_cstate_disabled = p.cpuidle_is_state_disabled(0, 0)

match is_cstate_disabled:
    case 1:
        print(f"CPU is disabled")
    case 0:
        print(f"CPU is enabled")
    case -1:
        print(f"Idlestate not available")
    case -2:
        print(f"Disabling is not supported by kernel")
    case _:
        print(f"Not documented: {is_cstate_disabled}")

# Pointer example