1 |
commit: 48688d49de7264603504f4c3807d40ee09e5428a |
2 |
Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
3 |
AuthorDate: Wed Aug 25 01:38:54 2021 +0000 |
4 |
Commit: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com> |
5 |
CommitDate: Wed Aug 25 01:51:18 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=48688d49 |
7 |
|
8 |
sys-apps/intel-cmt-cat: initial import |
9 |
|
10 |
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com> |
11 |
|
12 |
sys-apps/intel-cmt-cat/Manifest | 1 + |
13 |
.../files/intel-cmt-cat-perl-makefile.patch | 22 +++++ |
14 |
sys-apps/intel-cmt-cat/intel-cmt-cat-4.2.0.ebuild | 108 +++++++++++++++++++++ |
15 |
sys-apps/intel-cmt-cat/metadata.xml | 51 ++++++++++ |
16 |
4 files changed, 182 insertions(+) |
17 |
|
18 |
diff --git a/sys-apps/intel-cmt-cat/Manifest b/sys-apps/intel-cmt-cat/Manifest |
19 |
new file mode 100644 |
20 |
index 000000000..59cfff0d6 |
21 |
--- /dev/null |
22 |
+++ b/sys-apps/intel-cmt-cat/Manifest |
23 |
@@ -0,0 +1 @@ |
24 |
+DIST intel-cmt-cat-4.2.0.tar.gz 470596 BLAKE2B 781e69a7019a27e87b6b6c8d2c914305a837d019cadf8d1b6221942c631e0e46531a292379d7979ae88e7a590b155bc4e5a62777bdd9ebfb2881471ef64bfa32 SHA512 ccfae2e3fa5bb8b7dfe5ed39ab20a8526eb759378aeb14fb7ed79f4f94820cd69e497c9e7d411f1d9ec40c07ca4c7c4f2db6ff1e034a8517c01c06bd8a70d4b6 |
25 |
|
26 |
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 |
27 |
new file mode 100644 |
28 |
index 000000000..39b9a553e |
29 |
--- /dev/null |
30 |
+++ b/sys-apps/intel-cmt-cat/files/intel-cmt-cat-perl-makefile.patch |
31 |
@@ -0,0 +1,22 @@ |
32 |
+--- a/lib/perl/Makefile.PL |
33 |
++++ b/lib/perl/Makefile.PL |
34 |
+@@ -42,8 +42,8 @@ |
35 |
+ WriteMakefile( |
36 |
+ 'NAME' => 'pqos', |
37 |
+ 'VERSION' => "0.1", |
38 |
+- 'CCFLAGS' => "$Config{ccflags} -Wno-unused-variable -Wno-unused-value", |
39 |
+- 'LIBS' => ['-lpqos', '-L/usr/local/lib -lpqos'], |
40 |
++ 'CCFLAGS' => "$Config{ccflags} -Wno-unused-variable -Wno-unused-value -I..", |
41 |
++ 'LIBS' => ['-lpqos', '-L.. -lpqos'], |
42 |
+ 'OBJECT' => 'pqos_wrap.o', |
43 |
+ 'clean' => {FILES => "pqos_wrap.c"}, |
44 |
+ ); |
45 |
+@@ -56,7 +56,7 @@ |
46 |
+ |
47 |
+ my $swig_target = <<"SWIG_MAKEFILE"; |
48 |
+ pqos_wrap.c: |
49 |
+- $swig -perl -outdir \$(INST_LIB) -I/usr/local/include \$(EXTRA_SWIGFLAGS) pqos.i |
50 |
++ $swig -perl -outdir \$(INST_LIB) -I.. \$(EXTRA_SWIGFLAGS) pqos.i |
51 |
+ SWIG_MAKEFILE |
52 |
+ |
53 |
+ my $perltidy_targets = <<'PERLTIDY_MAKEFILE'; |
54 |
|
55 |
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 |
56 |
new file mode 100644 |
57 |
index 000000000..e65818eef |
58 |
--- /dev/null |
59 |
+++ b/sys-apps/intel-cmt-cat/intel-cmt-cat-4.2.0.ebuild |
60 |
@@ -0,0 +1,108 @@ |
61 |
+# Copyright 2020-2021 Gentoo Authors |
62 |
+# Distributed under the terms of the GNU General Public License v2 |
63 |
+ |
64 |
+EAPI=8 |
65 |
+ |
66 |
+PYTHON_COMPAT=( python3_{8..10} pypy3 ) |
67 |
+ |
68 |
+inherit distutils-r1 perl-module |
69 |
+ |
70 |
+DESCRIPTION="User space software for Intel(R) Resource Director Technology" |
71 |
+HOMEPAGE=" |
72 |
+ http://www.intel.com/content/www/us/en/architecture-and-technology/resource-director-technology.html |
73 |
+ https://github.com/intel/intel-cmt-cat |
74 |
+" |
75 |
+SRC_URI="https://github.com/intel/intel-cmt-cat/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" |
76 |
+ |
77 |
+LICENSE="BSD" |
78 |
+SLOT="0" |
79 |
+KEYWORDS="~amd64" |
80 |
+IUSE="perl" |
81 |
+ |
82 |
+RDEPEND=" |
83 |
+ ${PYTHON_DEPS} |
84 |
+ perl? ( dev-lang/perl:= ) |
85 |
+" |
86 |
+DEPEND="${RDEPEND}" |
87 |
+ |
88 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
89 |
+PATCHES=( "${FILESDIR}/${PN}-perl-makefile.patch" ) |
90 |
+ |
91 |
+distutils_enable_tests unittest |
92 |
+ |
93 |
+src_prepare() { |
94 |
+ mkdir -p "${T}/prefix" || die |
95 |
+ |
96 |
+ distutils-r1_python_prepare_all |
97 |
+} |
98 |
+ |
99 |
+src_compile() { |
100 |
+ emake all PREFIX="${T}/prefix" |
101 |
+ |
102 |
+ if use perl; then |
103 |
+ pushd "lib/perl" || die |
104 |
+ perl-module_src_configure |
105 |
+ perl-module_src_compile |
106 |
+ popd || die |
107 |
+ fi |
108 |
+ pushd "lib/python" || die |
109 |
+ python_foreach_impl distutils-r1_python_compile |
110 |
+ popd || die |
111 |
+# pushd "appqos" || die |
112 |
+# python_foreach_impl distutils-r1_python_compile |
113 |
+# popd || die |
114 |
+} |
115 |
+ |
116 |
+src_install() { |
117 |
+ emake install PREFIX="${T}/prefix" |
118 |
+ |
119 |
+ dobin "${T}"/prefix/bin/* |
120 |
+ doheader "${T}"/prefix/include/* |
121 |
+ doman "${T}"/prefix/man/man*/* |
122 |
+ dolib.so "${T}"/prefix/lib/* |
123 |
+ |
124 |
+ dobin tools/membw/membw |
125 |
+ dobin snmp/rdt-agentx.pl |
126 |
+ |
127 |
+ dodoc ChangeLog README |
128 |
+ docinto membw |
129 |
+ dodoc tools/membw/README |
130 |
+ docinto pqos |
131 |
+ dodoc -r pqos/README pqos/configs |
132 |
+ docinto lib |
133 |
+ dodoc lib/README |
134 |
+ docinto lib/python |
135 |
+ dodoc lib/python/README.txt |
136 |
+ docinto snmp |
137 |
+ dodoc snmp/README |
138 |
+ docinto rdtset |
139 |
+ dodoc rdtset/README |
140 |
+ docinto appqos |
141 |
+ dodoc appqos/README.md |
142 |
+ |
143 |
+ if use perl ; then |
144 |
+ pushd "lib/perl" || die |
145 |
+ unset DOCS |
146 |
+ myinst=( DESTDIR="${D}" ) |
147 |
+ perl-module_src_install |
148 |
+ popd || die |
149 |
+ docinto lib/perl |
150 |
+ dodoc lib/perl/README |
151 |
+ fi |
152 |
+ unset DOCS |
153 |
+ pushd "lib/python" || die |
154 |
+ python_foreach_impl distutils-r1_python_install |
155 |
+ popd || die |
156 |
+# pushd "appqos" || die |
157 |
+# python_foreach_impl distutils-r1_python_install |
158 |
+# popd || die |
159 |
+} |
160 |
+ |
161 |
+src_test() { |
162 |
+ pushd "lib/python" || die |
163 |
+ python_foreach_impl python_test |
164 |
+ popd || die |
165 |
+# pushd "appqos" || die |
166 |
+# python_foreach_impl python_test |
167 |
+# popd || die |
168 |
+} |
169 |
|
170 |
diff --git a/sys-apps/intel-cmt-cat/metadata.xml b/sys-apps/intel-cmt-cat/metadata.xml |
171 |
new file mode 100644 |
172 |
index 000000000..fd18b3532 |
173 |
--- /dev/null |
174 |
+++ b/sys-apps/intel-cmt-cat/metadata.xml |
175 |
@@ -0,0 +1,51 @@ |
176 |
+<?xml version="1.0" encoding="UTF-8"?> |
177 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
178 |
+<pkgmetadata> |
179 |
+ <upstream> |
180 |
+ <bugs-to>https://github.com/intel/intel-cmt-cat/issues</bugs-to> |
181 |
+ <remote-id type="github">intel/intel-cmt-cat</remote-id> |
182 |
+ </upstream> |
183 |
+ <maintainer type="person"> |
184 |
+ <email>lssndrbarbieri@×××××.com</email> |
185 |
+ <name>Alessandro Barbieri</name> |
186 |
+ </maintainer> |
187 |
+ <longdescription lang="en"> |
188 |
+Overview |
189 |
+======== |
190 |
+ |
191 |
+This software package provides basic support for |
192 |
+Intel(R) Resource Director Technology (Intel(R) RDT) including: |
193 |
+Cache Monitoring Technology (CMT), Memory Bandwidth Monitoring (MBM), |
194 |
+Cache Allocation Technology (CAT), Code and Data Prioritization (CDP) |
195 |
+and Memory Bandwidth Allocation (MBA). |
196 |
+ |
197 |
+In principle, the software programs the technologies via |
198 |
+Model Specific Registers (MSR) on a hardware thread basis. |
199 |
+MSR access is arranged via a standard operating system driver: |
200 |
+msr on Linux and cpuctl on FreeBSD. In the most common architectural |
201 |
+implementations, presence of the technologies is detected via the |
202 |
+CPUID instruction. |
203 |
+ |
204 |
+In a limited number of special cases where CAT is not architecturally |
205 |
+supported on a particular SKU (but instead a non-architectural |
206 |
+(model-specific) implementation exists) it can be detected via brand |
207 |
+string. This brand string is read from CPUID and compared to a table |
208 |
+of known-supported SKUs. If needed, a final check is to probe the |
209 |
+specific MSR’s to discover hardware capabilities, however it is |
210 |
+recommended that CPUID enumeration should be used wherever possible. |
211 |
+ |
212 |
+From software version v1.0.0 the library adds option to use Intel(R) RDT via |
213 |
+available OS interfaces (perf and resctrl on Linux). The library detects |
214 |
+presence of these interfaces and allows to select the preferred one through |
215 |
+a configuration option. |
216 |
+As the result, existing tools like 'pqos' or 'rdtset' can also be used |
217 |
+to manage Intel(R) RDT in an OS compatible way. MSR interface remains |
218 |
+the default option for now. 'pqos' tool wrappers have been added to help with |
219 |
+the interface selection. 'pqos-os' and 'pqos-msr' for OS and MSR interface |
220 |
+operations respectively. |
221 |
+ |
222 |
+PID API compile time option has been removed and the APIs are always available. |
223 |
+Note that proper operation of these APIs depends on availability and |
224 |
+selection of OS interface. |
225 |
+ </longdescription> |
226 |
+</pkgmetadata> |