1 |
commit: 4286520c0c83e2d01377ece54b4bb5f08459f692 |
2 |
Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
3 |
AuthorDate: Sat Jun 4 10:37:21 2022 +0000 |
4 |
Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
5 |
CommitDate: Sat Jun 4 13:13:47 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=4286520c |
7 |
|
8 |
sys-power/linux-tools-power-x86: new package, add 5.18 |
9 |
|
10 |
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com> |
11 |
|
12 |
sys-power/linux-tools-power-x86/Manifest | 1 + |
13 |
.../files/linux-tools-power-x86-5.18-cflags.patch | 33 ++++++++ |
14 |
.../linux-tools-power-x86-5.18.ebuild | 92 ++++++++++++++++++++++ |
15 |
sys-power/linux-tools-power-x86/metadata.xml | 11 +++ |
16 |
4 files changed, 137 insertions(+) |
17 |
|
18 |
diff --git a/sys-power/linux-tools-power-x86/Manifest b/sys-power/linux-tools-power-x86/Manifest |
19 |
new file mode 100644 |
20 |
index 000000000..907336dce |
21 |
--- /dev/null |
22 |
+++ b/sys-power/linux-tools-power-x86/Manifest |
23 |
@@ -0,0 +1 @@ |
24 |
+DIST linux-5.18.tar.xz 129790264 BLAKE2B e2745a69eb70169e90505a9318a3993046eab3020496eecde7d8352ecda0eb71a25b21becf7ce93fc593507dce7d1cd61b94ddcdf82b3094d79c0d3d48508eeb SHA512 dbbc9d1395898a498fa4947fceda1781344fa5d360240f753810daa4fa88e519833e2186c4e582a8f1836e6413e9e85f6563c7770523b704e8702d67622f98b5 |
25 |
|
26 |
diff --git a/sys-power/linux-tools-power-x86/files/linux-tools-power-x86-5.18-cflags.patch b/sys-power/linux-tools-power-x86/files/linux-tools-power-x86-5.18-cflags.patch |
27 |
new file mode 100644 |
28 |
index 000000000..700baa781 |
29 |
--- /dev/null |
30 |
+++ b/sys-power/linux-tools-power-x86/files/linux-tools-power-x86-5.18-cflags.patch |
31 |
@@ -0,0 +1,33 @@ |
32 |
+--- a/tools/power/x86/intel-speed-select/Makefile |
33 |
++++ b/tools/power/x86/intel-speed-select/Makefile |
34 |
+@@ -13,7 +13,7 @@ |
35 |
+ # Do not use make's built-in rules |
36 |
+ # (this improves performance and avoids hard-to-debug behaviour); |
37 |
+ MAKEFLAGS += -r |
38 |
+-override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -I/usr/include/libnl3 |
39 |
++override CFLAGS += -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -I/usr/include/libnl3 |
40 |
+ override LDFLAGS += -lnl-genl-3 -lnl-3 |
41 |
+ |
42 |
+ ALL_TARGETS := intel-speed-select |
43 |
+--- a/tools/power/x86/turbostat/Makefile |
44 |
++++ b/tools/power/x86/turbostat/Makefile |
45 |
+@@ -9,7 +9,7 @@ |
46 |
+ endif |
47 |
+ |
48 |
+ turbostat : turbostat.c |
49 |
+-override CFLAGS += -O2 -Wall -I../../../include |
50 |
++override CFLAGS += -Wall -I../../../include |
51 |
+ override CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' |
52 |
+ override CFLAGS += -DINTEL_FAMILY_HEADER='"../../../../arch/x86/include/asm/intel-family.h"' |
53 |
+ override CFLAGS += -D_FILE_OFFSET_BITS=64 |
54 |
+--- a/tools/power/x86/x86_energy_perf_policy/Makefile |
55 |
++++ b/tools/power/x86/x86_energy_perf_policy/Makefile |
56 |
+@@ -9,7 +9,7 @@ |
57 |
+ endif |
58 |
+ |
59 |
+ x86_energy_perf_policy : x86_energy_perf_policy.c |
60 |
+-override CFLAGS += -O2 -Wall -I../../../include |
61 |
++override CFLAGS += -Wall -I../../../include |
62 |
+ override CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' |
63 |
+ override CFLAGS += -D_FORTIFY_SOURCE=2 |
64 |
+ |
65 |
|
66 |
diff --git a/sys-power/linux-tools-power-x86/linux-tools-power-x86-5.18.ebuild b/sys-power/linux-tools-power-x86/linux-tools-power-x86-5.18.ebuild |
67 |
new file mode 100644 |
68 |
index 000000000..65175d611 |
69 |
--- /dev/null |
70 |
+++ b/sys-power/linux-tools-power-x86/linux-tools-power-x86-5.18.ebuild |
71 |
@@ -0,0 +1,92 @@ |
72 |
+# Copyright 2013-2022 Gentoo Authors |
73 |
+# Distributed under the terms of the GNU General Public License v2 |
74 |
+ |
75 |
+EAPI=8 |
76 |
+ |
77 |
+PYTHON_COMPAT=( python3_{8..11} ) |
78 |
+ |
79 |
+inherit fcaps linux-info python-r1 toolchain-funcs |
80 |
+ |
81 |
+DESCRIPTION="Linux x86 CPU power tools" |
82 |
+HOMEPAGE="https://www.kernel.org/" |
83 |
+SRC_URI="https://cdn.kernel.org/pub/linux/kernel/v${PV%%.*}.x/linux-${PV}.tar.xz" |
84 |
+S="${WORKDIR}/linux-${PV}" |
85 |
+ |
86 |
+LICENSE="GPL-2" |
87 |
+SLOT="0/0" |
88 |
+KEYWORDS="~amd64" |
89 |
+IUSE="pstate-tracer" |
90 |
+ |
91 |
+CDEPEND="dev-libs/libnl:3" |
92 |
+RDEPEND=" |
93 |
+ pstate-tracer? ( |
94 |
+ ${PYTHON_DEPS} |
95 |
+ dev-python/gnuplot-py[${PYTHON_USEDEP}] |
96 |
+ dev-python/numpy[${PYTHON_USEDEP}] |
97 |
+ sci-visualization/gnuplot |
98 |
+ ) |
99 |
+" |
100 |
+DEPEND=" |
101 |
+ ${CDEPEND} |
102 |
+ virtual/os-headers |
103 |
+" |
104 |
+ |
105 |
+REQUIRED_USE="pstate-tracer? ( ${PYTHON_REQUIRED_USE} )" |
106 |
+ |
107 |
+PATCHES=( "${FILESDIR}/${P}-cflags.patch" ) |
108 |
+FILECAPS=( 'cap_sys_rawio=ep' usr/bin/turbostat ) |
109 |
+ |
110 |
+pkg_setup() { |
111 |
+ linux-info_pkg_setup |
112 |
+ if linux_config_exists; then |
113 |
+ CONFIG_CHECK_MODULES="CONFIG_X86_MSR" || ewarn "msr module is needed at runtime" |
114 |
+ fi |
115 |
+} |
116 |
+ |
117 |
+src_configure() { |
118 |
+ export bindir="${EPREFIX}/usr/bin" |
119 |
+ export sbindir="${EPREFIX}/usr/sbin" |
120 |
+ export mandir="${EPREFIX}/usr/share/man" |
121 |
+ export includedir="${EPREFIX}/usr/include" |
122 |
+ export libdir="${EPREFIX}/usr/$(get_libdir)" |
123 |
+ export localedir="${EPREFIX}/usr/share/locale" |
124 |
+ export docdir="${EPREFIX}/usr/share/doc/${PF}" |
125 |
+ export confdir="${EPREFIX}/etc" |
126 |
+ export bash_completion_dir="${EPREFIX}/usr/share/bash-completion/completions" |
127 |
+ export V=1 |
128 |
+} |
129 |
+ |
130 |
+src_compile() { |
131 |
+ myemakeargs=( |
132 |
+ AR="$(tc-getAR)" |
133 |
+ CC="$(tc-getCC)" |
134 |
+ LD="$(tc-getCC)" |
135 |
+ VERSION=${PV} |
136 |
+ ) |
137 |
+ emake -C tools/power/x86/intel-speed-select "${myemakeargs[@]}" |
138 |
+ emake -C tools/power/x86/turbostat "${myemakeargs[@]}" |
139 |
+ emake -C tools/power/x86/x86_energy_perf_policy "${myemakeargs[@]}" |
140 |
+} |
141 |
+ |
142 |
+src_install() { |
143 |
+ pushd "${S}/tools/power/x86/intel-speed-select" || die |
144 |
+ emake "${myemakeargs[@]}" DESTDIR="${D}" install |
145 |
+ popd || die |
146 |
+ pushd "${S}/tools/power/x86/turbostat" || die |
147 |
+ emake "${myemakeargs[@]}" DESTDIR="${D}" install |
148 |
+ popd || die |
149 |
+ pushd "${S}/tools/power/x86/x86_energy_perf_policy" || die |
150 |
+ emake "${myemakeargs[@]}" DESTDIR="${D}" install |
151 |
+ popd || die |
152 |
+ |
153 |
+ if use pstate-tracer; then |
154 |
+ python_foreach_impl python_doscript tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py |
155 |
+ python_foreach_impl python_doscript tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py |
156 |
+ fi |
157 |
+ |
158 |
+ einstalldocs |
159 |
+} |
160 |
+ |
161 |
+pkg_postinst() { |
162 |
+ fcaps_pkg_postinst |
163 |
+} |
164 |
|
165 |
diff --git a/sys-power/linux-tools-power-x86/metadata.xml b/sys-power/linux-tools-power-x86/metadata.xml |
166 |
new file mode 100644 |
167 |
index 000000000..a169f25fc |
168 |
--- /dev/null |
169 |
+++ b/sys-power/linux-tools-power-x86/metadata.xml |
170 |
@@ -0,0 +1,11 @@ |
171 |
+<?xml version="1.0" encoding="UTF-8"?> |
172 |
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> |
173 |
+<pkgmetadata> |
174 |
+ <maintainer type="person"> |
175 |
+ <email>lssndrbarbieri@×××××.com</email> |
176 |
+ <name>Alessandro Barbieri</name> |
177 |
+ </maintainer> |
178 |
+ <use> |
179 |
+ <flag name="pstate-tracer">Install utility to debug and tune the performance of the {amd,intel}_pstate drivers</flag> |
180 |
+ </use> |
181 |
+</pkgmetadata> |