Skip to content

Commit 0f59a6c

Browse files
lenticularis39rostedt
authored andcommitted
tools/build: Add libcpupower dependency detection
Add the ability to detect the presence of libcpupower on a system to the Makefiles in tools/build. Link: https://lore.kernel.org/[email protected] Signed-off-by: Tomas Glozar <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 76b3102 commit 0f59a6c

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

tools/build/Makefile.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ FEATURE_TESTS_BASIC := \
5353
libslang-include-subdir \
5454
libtraceevent \
5555
libtracefs \
56+
libcpupower \
5657
libcrypto \
5758
libunwind \
5859
pthread-attr-setaffinity-np \

tools/build/feature/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ FILES= \
3838
test-libslang.bin \
3939
test-libslang-include-subdir.bin \
4040
test-libtraceevent.bin \
41+
test-libcpupower.bin \
4142
test-libtracefs.bin \
4243
test-libcrypto.bin \
4344
test-libunwind.bin \
@@ -245,6 +246,9 @@ $(OUTPUT)test-libslang-include-subdir.bin:
245246
$(OUTPUT)test-libtraceevent.bin:
246247
$(BUILD) -ltraceevent
247248

249+
$(OUTPUT)test-libcpupower.bin:
250+
$(BUILD) -lcpupower
251+
248252
$(OUTPUT)test-libtracefs.bin:
249253
$(BUILD) $(shell $(PKG_CONFIG) --cflags libtracefs 2>/dev/null) -ltracefs
250254

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <cpuidle.h>
3+
4+
int main(void)
5+
{
6+
int rv = cpuidle_state_count(0);
7+
return rv;
8+
}

0 commit comments

Comments
 (0)