Skip to contentSkip to conversation

pm: cpupower: Add missing residency header changes in cpuidle.h to SWIG

PATCH Applied John B. Wyatt IV 2 participants 5 messages Jan 8, 2025 – Jan 14, 2025 CPU power monitoring

lore
Share & tools
lore

John B. Wyatt IV

author maintainer
#0 lore raw

PATCH 1/1 pm: cpupower: Add missing residency header changes in cpuidle.h to SWIG

"tools/cpupower: display residency value in idle-info" added a new function to cpuidle.h. This patch adds them to the bindings.

Tested by compiling both libcpupower and the headers; running the test script that does not use the functions as a basic sanity test.

---
 tools/power/cpupower/bindings/python/raw_pylibcpupower.swg | 2 ++
 1 file changed, 2 insertions(+)
tools/power/cpupower/bindings/python/raw_pylibcpupower.swg +2 -0
index a8226c79cfea..d82af6fa93c3 100644
@@ -163,6 +163,8 @@ int cpuidle_state_disable(unsigned int cpu, unsigned int idlestate,
 				   unsigned int disable);
 unsigned long cpuidle_state_latency(unsigned int cpu,
 						unsigned int idlestate);
+unsigned long cpuidle_state_residency(unsigned int cpu,
+						unsigned int idlestate);
 unsigned long cpuidle_state_usage(unsigned int cpu,
 					unsigned int idlestate);
 unsigned long long cpuidle_state_time(unsigned int cpu,
Signature · 1 line
2.47.1
author maintainer
#1 lore raw

Hello Shuah,

Did you have a chance to look at this? This is the second header change that was missing from the bindings.

Quoted 30 lines · John B. Wyatt IV

"tools/cpupower: display residency value in idle-info" added a new function to cpuidle.h. This patch adds them to the bindings.

Tested by compiling both libcpupower and the headers; running the test script that does not use the functions as a basic sanity test.

---
 tools/power/cpupower/bindings/python/raw_pylibcpupower.swg | 2 ++
 1 file changed, 2 insertions(+)
tools/power/cpupower/bindings/python/raw_pylibcpupower.swg +2 -0
index a8226c79cfea..d82af6fa93c3 100644
@@ -163,6 +163,8 @@ int cpuidle_state_disable(unsigned int cpu, unsigned int idlestate,
 				   unsigned int disable);
 unsigned long cpuidle_state_latency(unsigned int cpu,
 						unsigned int idlestate);
+unsigned long cpuidle_state_residency(unsigned int cpu,
+						unsigned int idlestate);
 unsigned long cpuidle_state_usage(unsigned int cpu,
 					unsigned int idlestate);
 unsigned long long cpuidle_state_time(unsigned int cpu,
Signature · 1 line
2.47.1
Signature · 4 lines
Sincerely,
John Wyatt
Software Engineer, Core Kernel
Red Hat
maintainer
#2 lore raw
Quoted 17 lines · John B. Wyatt IV

Hello Shuah,

Did you have a chance to look at this? This is the second header change that was missing from the bindings.

Quoted 11 lines · John B. Wyatt IV

"tools/cpupower: display residency value in idle-info" added a new function to cpuidle.h. This patch adds them to the bindings.

Tested by compiling both libcpupower and the headers; running the test script that does not use the functions as a basic sanity test.

---

Yes I did. Looks good to me. I am waiting for Rafael to pull my PR to apply the patch.

thanks,
-- Shuah

maintainer Applied
#3 lore raw
Quoted 19 lines · Shuah Khan
Quoted 17 lines · John B. Wyatt IV

Hello Shuah,

Did you have a chance to look at this? This is the second header change that was missing from the bindings.

Quoted 11 lines · John B. Wyatt IV

"tools/cpupower: display residency value in idle-info" added a new function to cpuidle.h. This patch adds them to the bindings.

Tested by compiling both libcpupower and the headers; running the test script that does not use the functions as a basic sanity test.

---

Quoted 5 lines

Yes I did. Looks good to me. I am waiting for Rafael to pull my PR to apply the patch.

thanks,
-- Shuah

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git/log/?h=cpupower

Will send another pr to Rafael later this week.

thanks,
-- Shuah