<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/power/cpupower, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-08-20T16:35:59Z</updated>
<entry>
<title>pm: cpupower: Fix the snapshot-order of tsc,mperf, clock in mperf_stop()</title>
<updated>2025-08-20T16:35:59Z</updated>
<author>
<name>Gautham R. Shenoy</name>
</author>
<published>2025-06-12T12:23:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=799f898875e6003098c3fff64dfe009e9001f407'/>
<id>urn:sha1:799f898875e6003098c3fff64dfe009e9001f407</id>
<content type='text'>
[ Upstream commit cda7ac8ce7de84cf32a3871ba5f318aa3b79381e ]

In the function mperf_start(), mperf_monitor snapshots the time, tsc
and finally the aperf,mperf MSRs. However, this order of snapshotting
in is reversed in mperf_stop(). As a result, the C0 residency (which
is computed as delta_mperf * 100 / delta_tsc) is under-reported on
CPUs that is 100% busy.

Fix this by snapshotting time, tsc and then aperf,mperf in
mperf_stop() in the same order as in mperf_start().

Link: https://lore.kernel.org/r/20250612122355.19629-2-gautham.shenoy@amd.com
Signed-off-by: Gautham R. Shenoy &lt;gautham.shenoy@amd.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>pm: cpupower: Fix printing of CORE, CPU fields in cpupower-monitor</title>
<updated>2025-08-15T10:16:16Z</updated>
<author>
<name>Gautham R. Shenoy</name>
</author>
<published>2025-06-12T12:23:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4f325ba60800540fc754dc02a6de1b8f543e283a'/>
<id>urn:sha1:4f325ba60800540fc754dc02a6de1b8f543e283a</id>
<content type='text'>
[ Upstream commit 14a3318b4ac8ae0ca2e1132a89de167e1030fbdb ]

After the commit 0014f65e3df0 ("pm: cpupower: remove hard-coded
topology depth values"), "cpupower monitor" output ceased to print the
CORE and the CPU fields on a multi-socket platform.

The reason for this is that the patch changed the behaviour to break
out of the switch-case after printing the PKG details, while prior to
the patch, the CORE and the CPU details would also get printed since
the "if" condition check would pass for any level whose topology depth
was lesser than that of a package.

Fix this ensuring all the details below a desired topology depth are
printed in the cpupower monitor output.

Link: https://lore.kernel.org/r/20250612122355.19629-3-gautham.shenoy@amd.com
Fixes: 0014f65e3df0 ("pm: cpupower: remove hard-coded topology depth values")
Signed-off-by: Gautham R. Shenoy &lt;gautham.shenoy@amd.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>cpupower: Make lib versioning scheme more obvious and fix version link</title>
<updated>2025-03-07T20:58:10Z</updated>
<author>
<name>Thomas Renninger</name>
</author>
<published>2025-03-07T09:43:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fffadbdd6b5acdb6390d6d0bc3ad6d3da5d2bd53'/>
<id>urn:sha1:fffadbdd6b5acdb6390d6d0bc3ad6d3da5d2bd53</id>
<content type='text'>
library versioning was broken:
libcpupower.so.0.0.1
libcpupower.so -&gt; libcpupower.so.0.0.1
libcpupower.so.1 -&gt; libcpupower.so.0.0.1

and is fixed by this patch to:
libcpupower.so.1.0.1
libcpupower.so -&gt; libcpupower.so.1.0.1
libcpupower.so.1 -&gt; libcpupower.so.1.0.1

Link: https://lore.kernel.org/r/20250307094334.39587-1-trenn@suse.de
Signed-off-by: Thomas Renninger &lt;trenn@suse.de&gt;
Signed-off-by: Shuah Khan &lt;shuah@kernel.org&gt;
</content>
</entry>
<entry>
<title>cpupower: Implement CPU physical core querying</title>
<updated>2025-03-06T20:27:57Z</updated>
<author>
<name>John B. Wyatt IV</name>
</author>
<published>2025-03-05T21:08:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f89cb9cba7a2557db676b507dd181d9751c7d11d'/>
<id>urn:sha1:f89cb9cba7a2557db676b507dd181d9751c7d11d</id>
<content type='text'>
This patch is also an issue report. get_cpu_topology will always save
into cpupower_topology a cores size of 0. The code to handle this looks
like it was commented out, and what is commented out is missing a curly
bracket.

https://elixir.bootlin.com/linux/v6.13.5/source/tools/power/cpupower/lib/cpupower.c#L206-L212

Inspiration was taken from psutil to implement this by querying
core_cpu_list. Instead of using a hashmap, I used a sorted array, and
counted the number of valid unique strings. The counting of this takes
place before the qsort for .pkg as the following code says it is
dependent on the order of that sort.

The previous code claimed Intel CPUs are not numbered correctly. I was
not able to reproduce that issue and removed that comment and the code.

This commit was tested with the libcpupower SWIG Python bindings and
performed correctly on 4 different setups. The most notable is the
Framework Intel laptop; a hybrid system of 4 P cores (8 threads) and 8 E
cores (8 threads).

The 4 setups: A 4 core virt-manager VM running Fedora 41 4c/4t (specs not
listed) was tested as a sanity test for VMs. A Lenovo Ryzen 7 Pro 7840HS
8c/16t. A Supermico Intel(R) Xeon(R) Gold 6330 CPU w/ 56c/112t with 2 CPU
sockets. A Framework 12th Gen Intel(R) Core(TM) i5-1240P with hybrid
cores.

CPU(s):                   16
  On-line CPU(s) list:    0-15
Vendor ID:                AuthenticAMD
  Model name:             AMD Ryzen 7 PRO 7840HS w/ Radeon 780M Graphics
    CPU family:           25
    Model:                116
    Thread(s) per core:   2
    Core(s) per socket:   8
    Socket(s):            1
    Stepping:             1

CPU(s):                   112
  On-line CPU(s) list:    0-111
Vendor ID:                GenuineIntel
  BIOS Vendor ID:         Intel(R) Corporation
  Model name:             Intel(R) Xeon(R) Gold 6330 CPU @ 2.00GHz
    BIOS Model name:      Intel(R) Xeon(R) Gold 6330 CPU @ 2.00GHz  CPU @ 2.0GHz
    BIOS CPU family:      179
    CPU family:           6
    Model:                106
    Thread(s) per core:   2
    Core(s) per socket:   28
    Socket(s):            2
    Stepping:             6

CPU(s):                   16
  On-line CPU(s) list:    0-15
Vendor ID:                GenuineIntel
  Model name:             12th Gen Intel(R) Core(TM) i5-1240P
    CPU family:           6
    Model:                154
    Thread(s) per core:   2
    Core(s) per socket:   12
    Socket(s):            1
    Stepping:             3

Link: https://lore.kernel.org/r/20250305210901.24177-1-jwyatt@redhat.com
Signed-off-by: "John B. Wyatt IV" &lt;jwyatt@redhat.com&gt;
Signed-off-by: "John B. Wyatt IV" &lt;sageofredondo@gmail.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pm: cpupower: remove hard-coded topology depth values</title>
<updated>2025-03-06T20:27:51Z</updated>
<author>
<name>Shuah Khan</name>
</author>
<published>2025-03-05T22:53:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0014f65e3df04ef15df3e8212be7b14fd26a2ef4'/>
<id>urn:sha1:0014f65e3df04ef15df3e8212be7b14fd26a2ef4</id>
<content type='text'>
Remove hard-coded topology depth values and replace them with
defines to improve code readability and maintainability in
cpupower-monitor code.

Link: https://lore.kernel.org/r/20250305225342.19447-3-skhan@linuxfoundation.org
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pm: cpupower: Fix cmd_monitor() error legs to free cpu_topology</title>
<updated>2025-03-06T20:27:38Z</updated>
<author>
<name>Shuah Khan</name>
</author>
<published>2025-03-05T22:53:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d52d2b311a5a251ddd723d1dac881dc46e8803ab'/>
<id>urn:sha1:d52d2b311a5a251ddd723d1dac881dc46e8803ab</id>
<content type='text'>
cmd_monitor() calls get_cpu_topology() to allocate memory for
cpu topology and fails to release in error legs.

Fix it to call cpu_topology_release() from error legs.

Link: https://lore.kernel.org/r/20250305225342.19447-2-skhan@linuxfoundation.org
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>cpupower: monitor: Exit with error status if execvp() fail</title>
<updated>2025-02-20T17:38:14Z</updated>
<author>
<name>Yiwei Lin</name>
</author>
<published>2025-02-20T16:38:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=80d3175a7e073fad281bdc5c7e881f46ab806d97'/>
<id>urn:sha1:80d3175a7e073fad281bdc5c7e881f46ab806d97</id>
<content type='text'>
In the case that we give a invalid command to idle_monitor for
monitoring, the execvp() will fail and thus go to the next line.
As a result, we'll see two differnt monitoring output. For
example, running `cpupower monitor -i 5 invalidcmd` which `invalidcmd`
is not executable.

Link: https://lore.kernel.org/r/20250220163846.2765-1-s921975628@gmail.com
Signed-off-by: Yiwei Lin &lt;s921975628@gmail.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pm: cpupower: bench: Prevent NULL dereference on malloc failure</title>
<updated>2025-02-19T20:48:08Z</updated>
<author>
<name>Zhongqiu Han</name>
</author>
<published>2025-02-19T12:27:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=208baa3ec9043a664d9acfb8174b332e6b17fb69'/>
<id>urn:sha1:208baa3ec9043a664d9acfb8174b332e6b17fb69</id>
<content type='text'>
If malloc returns NULL due to low memory, 'config' pointer can be NULL.
Add a check to prevent NULL dereference.

Link: https://lore.kernel.org/r/20250219122715.3892223-1-quic_zhonhan@quicinc.com
Signed-off-by: Zhongqiu Han &lt;quic_zhonhan@quicinc.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pm: cpupower: Add missing residency header changes in cpuidle.h to SWIG</title>
<updated>2025-01-13T23:13:49Z</updated>
<author>
<name>John B. Wyatt IV</name>
</author>
<published>2025-01-08T22:18:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3d6f25870d172e2b5f27dd829bbe567d5fe8ea31'/>
<id>urn:sha1:3d6f25870d172e2b5f27dd829bbe567d5fe8ea31</id>
<content type='text'>
"tools/cpupower: display residency value in idle-info" added a new
function to cpuidle.h. This patch adds them to the bindings.

Link: https://lore.kernel.org/linux-pm/20240809083728.266697-1-aboorvad@linux.ibm.com/

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

Link: https://lore.kernel.org/r/20250108221852.30771-1-jwyatt@redhat.com
Signed-off-by: "John B. Wyatt IV" &lt;jwyatt@redhat.com&gt;
Signed-off-by: "John B. Wyatt IV" &lt;sageofredondo@gmail.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pm: cpupower: Add header changes for cpufreq.h to SWIG bindings</title>
<updated>2024-12-27T15:11:51Z</updated>
<author>
<name>John B. Wyatt IV</name>
</author>
<published>2024-12-24T06:23:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8d097444982d7b23a5396169dc9d2923a59b5a79'/>
<id>urn:sha1:8d097444982d7b23a5396169dc9d2923a59b5a79</id>
<content type='text'>
"cpupower: Add support for showing energy performance preference" added
two new functions to cpufreq.h. This patch adds them to the bindings.

Link: https://lore.kernel.org/linux-pm/8dc731c3-6586-4265-ae6a-d93ed219a963@linuxfoundation.org/T/#t

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

Link: https://lore.kernel.org/r/20241224062329.39606-1-jwyatt@redhat.com
Signed-off-by: "John B. Wyatt IV" &lt;jwyatt@redhat.com&gt;
Signed-off-by: "John B. Wyatt IV" &lt;sageofredondo@gmail.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
</feed>
