From 48688d49de7264603504f4c3807d40ee09e5428a Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Wed, 25 Aug 2021 03:38:54 +0200 Subject: [PATCH] sys-apps/intel-cmt-cat: initial import Signed-off-by: Alessandro Barbieri --- sys-apps/intel-cmt-cat/Manifest | 1 + .../files/intel-cmt-cat-perl-makefile.patch | 22 ++++ .../intel-cmt-cat/intel-cmt-cat-4.2.0.ebuild | 108 ++++++++++++++++++ sys-apps/intel-cmt-cat/metadata.xml | 51 +++++++++ 4 files changed, 182 insertions(+) create mode 100644 sys-apps/intel-cmt-cat/Manifest create mode 100644 sys-apps/intel-cmt-cat/files/intel-cmt-cat-perl-makefile.patch create mode 100644 sys-apps/intel-cmt-cat/intel-cmt-cat-4.2.0.ebuild create mode 100644 sys-apps/intel-cmt-cat/metadata.xml diff --git a/sys-apps/intel-cmt-cat/Manifest b/sys-apps/intel-cmt-cat/Manifest new file mode 100644 index 0000000000..59cfff0d6b --- /dev/null +++ b/sys-apps/intel-cmt-cat/Manifest @@ -0,0 +1 @@ +DIST intel-cmt-cat-4.2.0.tar.gz 470596 BLAKE2B 781e69a7019a27e87b6b6c8d2c914305a837d019cadf8d1b6221942c631e0e46531a292379d7979ae88e7a590b155bc4e5a62777bdd9ebfb2881471ef64bfa32 SHA512 ccfae2e3fa5bb8b7dfe5ed39ab20a8526eb759378aeb14fb7ed79f4f94820cd69e497c9e7d411f1d9ec40c07ca4c7c4f2db6ff1e034a8517c01c06bd8a70d4b6 diff --git a/sys-apps/intel-cmt-cat/files/intel-cmt-cat-perl-makefile.patch b/sys-apps/intel-cmt-cat/files/intel-cmt-cat-perl-makefile.patch new file mode 100644 index 0000000000..39b9a553ea --- /dev/null +++ b/sys-apps/intel-cmt-cat/files/intel-cmt-cat-perl-makefile.patch @@ -0,0 +1,22 @@ +--- a/lib/perl/Makefile.PL ++++ b/lib/perl/Makefile.PL +@@ -42,8 +42,8 @@ + WriteMakefile( + 'NAME' => 'pqos', + 'VERSION' => "0.1", +- 'CCFLAGS' => "$Config{ccflags} -Wno-unused-variable -Wno-unused-value", +- 'LIBS' => ['-lpqos', '-L/usr/local/lib -lpqos'], ++ 'CCFLAGS' => "$Config{ccflags} -Wno-unused-variable -Wno-unused-value -I..", ++ 'LIBS' => ['-lpqos', '-L.. -lpqos'], + 'OBJECT' => 'pqos_wrap.o', + 'clean' => {FILES => "pqos_wrap.c"}, + ); +@@ -56,7 +56,7 @@ + + my $swig_target = <<"SWIG_MAKEFILE"; + pqos_wrap.c: +- $swig -perl -outdir \$(INST_LIB) -I/usr/local/include \$(EXTRA_SWIGFLAGS) pqos.i ++ $swig -perl -outdir \$(INST_LIB) -I.. \$(EXTRA_SWIGFLAGS) pqos.i + SWIG_MAKEFILE + + my $perltidy_targets = <<'PERLTIDY_MAKEFILE'; diff --git a/sys-apps/intel-cmt-cat/intel-cmt-cat-4.2.0.ebuild b/sys-apps/intel-cmt-cat/intel-cmt-cat-4.2.0.ebuild new file mode 100644 index 0000000000..e65818eef9 --- /dev/null +++ b/sys-apps/intel-cmt-cat/intel-cmt-cat-4.2.0.ebuild @@ -0,0 +1,108 @@ +# Copyright 2020-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} pypy3 ) + +inherit distutils-r1 perl-module + +DESCRIPTION="User space software for Intel(R) Resource Director Technology" +HOMEPAGE=" + http://www.intel.com/content/www/us/en/architecture-and-technology/resource-director-technology.html + https://github.com/intel/intel-cmt-cat +" +SRC_URI="https://github.com/intel/intel-cmt-cat/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64" +IUSE="perl" + +RDEPEND=" + ${PYTHON_DEPS} + perl? ( dev-lang/perl:= ) +" +DEPEND="${RDEPEND}" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" +PATCHES=( "${FILESDIR}/${PN}-perl-makefile.patch" ) + +distutils_enable_tests unittest + +src_prepare() { + mkdir -p "${T}/prefix" || die + + distutils-r1_python_prepare_all +} + +src_compile() { + emake all PREFIX="${T}/prefix" + + if use perl; then + pushd "lib/perl" || die + perl-module_src_configure + perl-module_src_compile + popd || die + fi + pushd "lib/python" || die + python_foreach_impl distutils-r1_python_compile + popd || die +# pushd "appqos" || die +# python_foreach_impl distutils-r1_python_compile +# popd || die +} + +src_install() { + emake install PREFIX="${T}/prefix" + + dobin "${T}"/prefix/bin/* + doheader "${T}"/prefix/include/* + doman "${T}"/prefix/man/man*/* + dolib.so "${T}"/prefix/lib/* + + dobin tools/membw/membw + dobin snmp/rdt-agentx.pl + + dodoc ChangeLog README + docinto membw + dodoc tools/membw/README + docinto pqos + dodoc -r pqos/README pqos/configs + docinto lib + dodoc lib/README + docinto lib/python + dodoc lib/python/README.txt + docinto snmp + dodoc snmp/README + docinto rdtset + dodoc rdtset/README + docinto appqos + dodoc appqos/README.md + + if use perl ; then + pushd "lib/perl" || die + unset DOCS + myinst=( DESTDIR="${D}" ) + perl-module_src_install + popd || die + docinto lib/perl + dodoc lib/perl/README + fi + unset DOCS + pushd "lib/python" || die + python_foreach_impl distutils-r1_python_install + popd || die +# pushd "appqos" || die +# python_foreach_impl distutils-r1_python_install +# popd || die +} + +src_test() { + pushd "lib/python" || die + python_foreach_impl python_test + popd || die +# pushd "appqos" || die +# python_foreach_impl python_test +# popd || die +} diff --git a/sys-apps/intel-cmt-cat/metadata.xml b/sys-apps/intel-cmt-cat/metadata.xml new file mode 100644 index 0000000000..fd18b35329 --- /dev/null +++ b/sys-apps/intel-cmt-cat/metadata.xml @@ -0,0 +1,51 @@ + + + + + https://github.com/intel/intel-cmt-cat/issues + intel/intel-cmt-cat + + + lssndrbarbieri@gmail.com + Alessandro Barbieri + + +Overview +======== + +This software package provides basic support for +Intel(R) Resource Director Technology (Intel(R) RDT) including: +Cache Monitoring Technology (CMT), Memory Bandwidth Monitoring (MBM), +Cache Allocation Technology (CAT), Code and Data Prioritization (CDP) +and Memory Bandwidth Allocation (MBA). + +In principle, the software programs the technologies via +Model Specific Registers (MSR) on a hardware thread basis. +MSR access is arranged via a standard operating system driver: +msr on Linux and cpuctl on FreeBSD. In the most common architectural +implementations, presence of the technologies is detected via the +CPUID instruction. + +In a limited number of special cases where CAT is not architecturally +supported on a particular SKU (but instead a non-architectural +(model-specific) implementation exists) it can be detected via brand +string. This brand string is read from CPUID and compared to a table +of known-supported SKUs. If needed, a final check is to probe the +specific MSR’s to discover hardware capabilities, however it is +recommended that CPUID enumeration should be used wherever possible. + +From software version v1.0.0 the library adds option to use Intel(R) RDT via +available OS interfaces (perf and resctrl on Linux). The library detects +presence of these interfaces and allows to select the preferred one through +a configuration option. +As the result, existing tools like 'pqos' or 'rdtset' can also be used +to manage Intel(R) RDT in an OS compatible way. MSR interface remains +the default option for now. 'pqos' tool wrappers have been added to help with +the interface selection. 'pqos-os' and 'pqos-msr' for OS and MSR interface +operations respectively. + +PID API compile time option has been removed and the APIs are always available. +Note that proper operation of these APIs depends on availability and +selection of OS interface. + +