linux/tools/power/cpupower/bindings/python
John B. Wyatt IV b6a2dbf88a 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>
2024-10-02 14:50:23 -06:00
..
.gitignore pm: cpupower: Clean up bindings gitignore 2024-09-23 09:06:03 -06:00
Makefile pm: cpupower: rename raw_pylibcpupower.i 2024-09-13 14:24:16 -06:00
raw_pylibcpupower.swg pm: cpupower: rename raw_pylibcpupower.i 2024-09-13 14:24:16 -06:00
README pm:cpupower: Add SWIG bindings files for libcpupower 2024-09-05 18:50:07 -06:00
test_raw_pylibcpupower.py pm: cpupower: bindings: Add test to confirm cpu state is disabled 2024-10-02 14:50:23 -06:00

This folder contains the necessary files to build the Python bindings for
libcpupower (aside from the libcpupower object files).


requirements
------------

* You need the object files in the libcpupower directory compiled by
cpupower's makefile.
* The SWIG program must be installed.
* The Python's development libraries installed.

Please check that your version of SWIG is compatible with the version of Python
installed on your machine by checking the SWIG changelog on their website.
https://swig.org/

Note that while SWIG itself is GPL v3+ licensed; the resulting output,
the bindings code: is permissively licensed + the license of libcpupower's .o
files. For these bindings that means GPL v2.

Please see https://swig.org/legal.html and the discussion [1] for more details.

[1]
https://lore.kernel.org/linux-pm/Zqv9BOjxLAgyNP5B@hatbackup/


build
-----

Install SWIG and the Python development files provided by your distribution.

Build the object files for libcpupower by running make in the cpupower
directory.

Return to the directory this README is in to run:

$ make


testing
-------

Please verify the _raw_pylibcpupower.so and raw_pylibcpupower.py files have
been created.

To run the test script:

$ python test_raw_pylibcpupower.py


credits
-------

Original Bindings Author:
John B. Wyatt IV
jwyatt@redhat.com
sageofredondo@gmail.com

Copyright (C) 2024 Red Hat