<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/power/cpupower/lib/powercap.c, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-10-04T14:32:26Z</updated>
<entry>
<title>pm:cpupower: Add missing powercap_set_enabled() stub function</title>
<updated>2024-10-04T14:32:26Z</updated>
<author>
<name>John B. Wyatt IV</name>
<email>jwyatt@redhat.com</email>
</author>
<published>2024-09-05T02:19:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d3a1f2d375bd41bca16cf01bf1aba4092ea63186'/>
<id>urn:sha1:d3a1f2d375bd41bca16cf01bf1aba4092ea63186</id>
<content type='text'>
[ Upstream commit 4b80294fb53845dc5c98cca0c989da09150f2ca9 ]

There was a symbol listed in the powercap.h file that was not implemented.
Implement it with a stub return of 0.

Programs like SWIG require that functions that are defined in the
headers be implemented.

Fixes: c2294c1496b7 ("cpupower: Introduce powercap intel-rapl library and powercap-info command")
Suggested-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>cpupower:Fix resource leaks in sysfs_get_enabled()</title>
<updated>2023-05-08T14:11:24Z</updated>
<author>
<name>Hao Zeng</name>
<email>zenghao@kylinos.cn</email>
</author>
<published>2023-04-18T01:30:56Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e652be0f59d4ba4d5c636b1f7f4dcb73aae049fa'/>
<id>urn:sha1:e652be0f59d4ba4d5c636b1f7f4dcb73aae049fa</id>
<content type='text'>
The sysfs_get_enabled() opened file processor not closed,
may cause a file handle leak.
Putting error handling and resource cleanup code together
makes the code easy to maintain and read.
Removed the unnecessary else if branch from the original
function, as it should return an error in cases other than '0'.

Signed-off-by: Hao Zeng &lt;zenghao@kylinos.cn&gt;
Suggested-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>cpupower: Introduce powercap intel-rapl library and powercap-info command</title>
<updated>2022-11-30T23:48:28Z</updated>
<author>
<name>Thomas Renninger</name>
<email>trenn@suse.de</email>
</author>
<published>2022-11-23T11:18:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c2294c1496b7169d5b14c2fa27526ba35da9f5ac'/>
<id>urn:sha1:c2294c1496b7169d5b14c2fa27526ba35da9f5ac</id>
<content type='text'>
Read out powercap zone information via:
cpupower powercap-info
and show the zone hierarchy to the user:

./cpupower powercap-info
Driver: intel-rapl
Powercap domain hierarchy:

Zone: package-0 (enabled)
Power consumption can be monitored in micro Watts

        Zone: core (disabled)
        Power consumption can be monitored in micro Watts

        Zone: uncore (disabled)
        Power consumption can be monitored in micro Watts

        Zone: dram (disabled)
        Power consumption can be monitored in micro Watts

There is a dummy -a option for powercap-info which can/should be used to
show more detailed info later. Like that other args can be added easily
later as well.

A enable/disable option via powercap-set subcommand is also an enhancement
for later.

Also not all RAPL domains are shown. The func walking through RAPL
subdomains is restricted and hardcoded to: "intel-rapl/intel-rapl:0"
On my system above powercap domains map to:
intel-rapl/intel-rapl:0
-&gt; pack (age-0)
intel-rapl/intel-rapl:0/intel-rapl:0:0
-&gt; core
intel-rapl/intel-rapl:0/intel-rapl:0:1
-&gt; uncore

Missing ones on my system are:
intel-rapl-mmio/intel-rapl-mmio:0
-&gt; pack (age-0)

intel-rapl/intel-rapl:1
-&gt; psys

This could get enhanced in:
struct powercap_zone *powercap_init_zones()
and adopted to walk through all intel-rapl zones, but
also to other powercap drivers like dtpm
(Dynamic Thermal Power Management framework),
cmp with: drivers/powercap/dtpm_*

Signed-off-by: Thomas Renninger &lt;trenn@suse.de&gt;
CC: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
</feed>
