diff options
author | Alessandro Barbieri <lssndrbarbieri@gmail.com> | 2022-06-04 12:37:21 +0200 |
---|---|---|
committer | Alessandro Barbieri <lssndrbarbieri@gmail.com> | 2022-06-04 15:13:47 +0200 |
commit | 4286520c0c83e2d01377ece54b4bb5f08459f692 (patch) | |
tree | cabf66c4b3f8fa02f1a003c0bf6fa238bba4b94c /sys-power | |
parent | dev-python/gnuplot-py: new package, add 1.8_p8 (diff) | |
download | guru-4286520c0c83e2d01377ece54b4bb5f08459f692.tar.gz guru-4286520c0c83e2d01377ece54b4bb5f08459f692.tar.bz2 guru-4286520c0c83e2d01377ece54b4bb5f08459f692.zip |
sys-power/linux-tools-power-x86: new package, add 5.18
Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
Diffstat (limited to 'sys-power')
4 files changed, 137 insertions, 0 deletions
diff --git a/sys-power/linux-tools-power-x86/Manifest b/sys-power/linux-tools-power-x86/Manifest new file mode 100644 index 000000000..907336dce --- /dev/null +++ b/sys-power/linux-tools-power-x86/Manifest @@ -0,0 +1 @@ +DIST linux-5.18.tar.xz 129790264 BLAKE2B e2745a69eb70169e90505a9318a3993046eab3020496eecde7d8352ecda0eb71a25b21becf7ce93fc593507dce7d1cd61b94ddcdf82b3094d79c0d3d48508eeb SHA512 dbbc9d1395898a498fa4947fceda1781344fa5d360240f753810daa4fa88e519833e2186c4e582a8f1836e6413e9e85f6563c7770523b704e8702d67622f98b5 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 new file mode 100644 index 000000000..700baa781 --- /dev/null +++ b/sys-power/linux-tools-power-x86/files/linux-tools-power-x86-5.18-cflags.patch @@ -0,0 +1,33 @@ +--- a/tools/power/x86/intel-speed-select/Makefile ++++ b/tools/power/x86/intel-speed-select/Makefile +@@ -13,7 +13,7 @@ + # Do not use make's built-in rules + # (this improves performance and avoids hard-to-debug behaviour); + MAKEFLAGS += -r +-override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -I/usr/include/libnl3 ++override CFLAGS += -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include -I/usr/include/libnl3 + override LDFLAGS += -lnl-genl-3 -lnl-3 + + ALL_TARGETS := intel-speed-select +--- a/tools/power/x86/turbostat/Makefile ++++ b/tools/power/x86/turbostat/Makefile +@@ -9,7 +9,7 @@ + endif + + turbostat : turbostat.c +-override CFLAGS += -O2 -Wall -I../../../include ++override CFLAGS += -Wall -I../../../include + override CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' + override CFLAGS += -DINTEL_FAMILY_HEADER='"../../../../arch/x86/include/asm/intel-family.h"' + override CFLAGS += -D_FILE_OFFSET_BITS=64 +--- a/tools/power/x86/x86_energy_perf_policy/Makefile ++++ b/tools/power/x86/x86_energy_perf_policy/Makefile +@@ -9,7 +9,7 @@ + endif + + x86_energy_perf_policy : x86_energy_perf_policy.c +-override CFLAGS += -O2 -Wall -I../../../include ++override CFLAGS += -Wall -I../../../include + override CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"' + override CFLAGS += -D_FORTIFY_SOURCE=2 + 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 new file mode 100644 index 000000000..65175d611 --- /dev/null +++ b/sys-power/linux-tools-power-x86/linux-tools-power-x86-5.18.ebuild @@ -0,0 +1,92 @@ +# Copyright 2013-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..11} ) + +inherit fcaps linux-info python-r1 toolchain-funcs + +DESCRIPTION="Linux x86 CPU power tools" +HOMEPAGE="https://www.kernel.org/" +SRC_URI="https://cdn.kernel.org/pub/linux/kernel/v${PV%%.*}.x/linux-${PV}.tar.xz" +S="${WORKDIR}/linux-${PV}" + +LICENSE="GPL-2" +SLOT="0/0" +KEYWORDS="~amd64" +IUSE="pstate-tracer" + +CDEPEND="dev-libs/libnl:3" +RDEPEND=" + pstate-tracer? ( + ${PYTHON_DEPS} + dev-python/gnuplot-py[${PYTHON_USEDEP}] + dev-python/numpy[${PYTHON_USEDEP}] + sci-visualization/gnuplot + ) +" +DEPEND=" + ${CDEPEND} + virtual/os-headers +" + +REQUIRED_USE="pstate-tracer? ( ${PYTHON_REQUIRED_USE} )" + +PATCHES=( "${FILESDIR}/${P}-cflags.patch" ) +FILECAPS=( 'cap_sys_rawio=ep' usr/bin/turbostat ) + +pkg_setup() { + linux-info_pkg_setup + if linux_config_exists; then + CONFIG_CHECK_MODULES="CONFIG_X86_MSR" || ewarn "msr module is needed at runtime" + fi +} + +src_configure() { + export bindir="${EPREFIX}/usr/bin" + export sbindir="${EPREFIX}/usr/sbin" + export mandir="${EPREFIX}/usr/share/man" + export includedir="${EPREFIX}/usr/include" + export libdir="${EPREFIX}/usr/$(get_libdir)" + export localedir="${EPREFIX}/usr/share/locale" + export docdir="${EPREFIX}/usr/share/doc/${PF}" + export confdir="${EPREFIX}/etc" + export bash_completion_dir="${EPREFIX}/usr/share/bash-completion/completions" + export V=1 +} + +src_compile() { + myemakeargs=( + AR="$(tc-getAR)" + CC="$(tc-getCC)" + LD="$(tc-getCC)" + VERSION=${PV} + ) + emake -C tools/power/x86/intel-speed-select "${myemakeargs[@]}" + emake -C tools/power/x86/turbostat "${myemakeargs[@]}" + emake -C tools/power/x86/x86_energy_perf_policy "${myemakeargs[@]}" +} + +src_install() { + pushd "${S}/tools/power/x86/intel-speed-select" || die + emake "${myemakeargs[@]}" DESTDIR="${D}" install + popd || die + pushd "${S}/tools/power/x86/turbostat" || die + emake "${myemakeargs[@]}" DESTDIR="${D}" install + popd || die + pushd "${S}/tools/power/x86/x86_energy_perf_policy" || die + emake "${myemakeargs[@]}" DESTDIR="${D}" install + popd || die + + if use pstate-tracer; then + python_foreach_impl python_doscript tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py + python_foreach_impl python_doscript tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py + fi + + einstalldocs +} + +pkg_postinst() { + fcaps_pkg_postinst +} diff --git a/sys-power/linux-tools-power-x86/metadata.xml b/sys-power/linux-tools-power-x86/metadata.xml new file mode 100644 index 000000000..a169f25fc --- /dev/null +++ b/sys-power/linux-tools-power-x86/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>lssndrbarbieri@gmail.com</email> + <name>Alessandro Barbieri</name> + </maintainer> + <use> + <flag name="pstate-tracer">Install utility to debug and tune the performance of the {amd,intel}_pstate drivers</flag> + </use> +</pkgmetadata> |