Gentoo Archives: gentoo-commits

From: Guilherme Amadio <amadio@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/perf/
Date: Fri, 30 Apr 2021 09:12:58
Message-Id: 1619773250.489caf5c81ff86a759107390ac7c626840c07752.amadio@gentoo
1 commit: 489caf5c81ff86a759107390ac7c626840c07752
2 Author: Guilherme Amadio <amadio <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 30 08:59:06 2021 +0000
4 Commit: Guilherme Amadio <amadio <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 30 09:00:50 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=489caf5c
7
8 dev-util/perf: version bump to 5.12
9
10 Package-Manager: Portage-3.0.18, Repoman-3.0.3
11 Signed-off-by: Guilherme Amadio <amadio <AT> gentoo.org>
12
13 dev-util/perf/Manifest | 1 +
14 dev-util/perf/perf-5.12.ebuild | 257 +++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 258 insertions(+)
16
17 diff --git a/dev-util/perf/Manifest b/dev-util/perf/Manifest
18 index 7742d4dac10..f52fc704996 100644
19 --- a/dev-util/perf/Manifest
20 +++ b/dev-util/perf/Manifest
21 @@ -1,5 +1,6 @@
22 DIST linux-5.10.tar.xz 116606704 BLAKE2B b923d7b66309224f42f35f8a5fa219421b0a9362d2adacdadd8d96251f61f7230878ea297a269a7f3b3c56830f0b177e068691e1d7f88501a05653b0a13274d1 SHA512 95bc137d0cf9148da6a9d1f1a878698dc27b40f68e22c597544010a6c591ce1b256f083489d3ff45ff77753289b535135590194d88ef9f007d0ddab3d74de70e
23 DIST linux-5.11.tar.xz 117619104 BLAKE2B 81300c27bd5476387a83123aaeb4163c73eb61e9245806c23660cb5e6a4fa88ffc9def027031335fa0270fc4080506cd415990014364e3a98b9d2e8c58a29524 SHA512 a567ec133018bb5ec00c60281479b466c26e02137a93a9c690e83997947df02b6fd94e76e8df748f6d70ceb58a19bacc3b1467de10b7a1fad2763db32b3f1330
24 +DIST linux-5.12.tar.xz 118112412 BLAKE2B 842d921b9a73d2aaade763dbd2ec67bdfe0275baa6d628b775f5c87574ad7dc86f0419afcd48c10c1235f4bffa16084243f2cf4556e6afcd391e975fe8ba530b SHA512 be03b6fee1d1ea8087b09874d27c0a602c0b04fd90ad38b975bd2c8455a07e83c29b56814aaf1389e82305fae0e4c2d1701075a7f0a7295dd28149f967ec5b3d
25 DIST linux-5.8.tar.xz 114459324 BLAKE2B 7bd97f8fa4527840754434414c07283e89731dc8ebb1e95fa5bc1469a60af1122582c0d3b6e262e77882f023190068df3537bd8b65964b3caa820bb2c8e579c7 SHA512 45a53ecf351096ef6e98242cca4228b8da9b9139ecc6963695791ea6fb7a9484a4e1c19dcca7ce7cbfdfa49de0451b70973bb078f12bdae9cbaddbc3f8092556
26 DIST linux-5.9.tar.xz 115507140 BLAKE2B e8d11472d63a9f8409ca12a2e8c97c6963a3d4516b5a398b627d6ece565584526f9b5a1377a2fa4bd184c09c7db94c987428bc5d52df0c788464a67e9e8d6dcb SHA512 d3d92ce4246bad74c9a784212f160d98449b1e8793970c2c308276568d852b8effe0528686bdb87d55d691f09a826abf7938d69bdd4759ce65ddd5c05ffe4eca
27 DIST patch-5.10.16.xz 498880 BLAKE2B 14061b505285f24938fb955ccc7f9fbd78ccc0b1026bffb17a89fdad08ea54bfee7bbb841123d9af4d0720a960a27c649c39852af7e2be8a286af926c7bce9c0 SHA512 be9cfe1ae6697956ca7476cedc212a8cbd9da2c3c72096a89afaaf73c5b6655fd04d458f96c472f680c5513c0ea3e4449c4092a958425b6040f0c7774453cd2f
28
29 diff --git a/dev-util/perf/perf-5.12.ebuild b/dev-util/perf/perf-5.12.ebuild
30 new file mode 100644
31 index 00000000000..411cb28ecd2
32 --- /dev/null
33 +++ b/dev-util/perf/perf-5.12.ebuild
34 @@ -0,0 +1,257 @@
35 +# Copyright 1999-2021 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=7
39 +
40 +PYTHON_COMPAT=( python3_{7,8,9} )
41 +inherit bash-completion-r1 estack llvm toolchain-funcs prefix python-r1 linux-info
42 +
43 +DESCRIPTION="Userland tools for Linux Performance Counters"
44 +HOMEPAGE="https://perf.wiki.kernel.org/"
45 +
46 +LINUX_V="${PV:0:1}.x"
47 +if [[ ${PV} == *_rc* ]] ; then
48 + LINUX_VER=$(ver_cut 1-2).$(($(ver_cut 3)-1))
49 + PATCH_VERSION=$(ver_cut 1-3)
50 + LINUX_PATCH=patch-${PV//_/-}.xz
51 + SRC_URI="https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/testing/${LINUX_PATCH}
52 + https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/testing/v${PATCH_VERSION}/${LINUX_PATCH}"
53 +elif [[ ${PV} == *.*.* ]] ; then
54 + # stable-release series
55 + LINUX_VER=$(ver_cut 1-2)
56 + LINUX_PATCH=patch-${PV}.xz
57 + SRC_URI="https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/${LINUX_PATCH}"
58 +else
59 + LINUX_VER=${PV}
60 + SRC_URI=""
61 +fi
62 +
63 +LINUX_SOURCES="linux-${LINUX_VER}.tar.xz"
64 +SRC_URI+=" https://www.kernel.org/pub/linux/kernel/v${LINUX_V}/${LINUX_SOURCES}"
65 +
66 +LICENSE="GPL-2"
67 +SLOT="0"
68 +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
69 +IUSE="audit clang crypt debug +demangle +doc gtk java libpfm lzma numa perl python slang systemtap unwind zlib"
70 +# TODO babeltrace
71 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
72 +
73 +BDEPEND="
74 + ${LINUX_PATCH+dev-util/patchutils}
75 + sys-devel/bison
76 + sys-devel/flex
77 + virtual/pkgconfig
78 + doc? (
79 + app-text/asciidoc
80 + app-text/sgml-common
81 + app-text/xmlto
82 + sys-process/time
83 + )
84 + ${PYTHON_DEPS}
85 +"
86 +
87 +RDEPEND="audit? ( sys-process/audit )
88 + crypt? ( dev-libs/openssl:0= )
89 + clang? (
90 + <sys-devel/clang-10:*
91 + <sys-devel/llvm-10:*
92 + )
93 + demangle? ( sys-libs/binutils-libs:= )
94 + gtk? ( x11-libs/gtk+:2 )
95 + java? ( virtual/jre:* )
96 + libpfm? ( dev-libs/libpfm )
97 + lzma? ( app-arch/xz-utils )
98 + numa? ( sys-process/numactl )
99 + perl? ( dev-lang/perl:= )
100 + python? ( ${PYTHON_DEPS} )
101 + slang? ( sys-libs/slang )
102 + systemtap? ( dev-util/systemtap )
103 + unwind? ( sys-libs/libunwind )
104 + zlib? ( sys-libs/zlib )
105 + dev-libs/elfutils"
106 +
107 +DEPEND="${RDEPEND}
108 + >=sys-kernel/linux-headers-4.19
109 + java? ( virtual/jdk )
110 +"
111 +
112 +S_K="${WORKDIR}/linux-${LINUX_VER}"
113 +S="${S_K}/tools/perf"
114 +
115 +CONFIG_CHECK="~PERF_EVENTS ~KALLSYMS"
116 +
117 +pkg_pretend() {
118 + if ! use doc ; then
119 + ewarn "Without the doc USE flag you won't get any documentation nor man pages."
120 + ewarn "And without man pages, you won't get any --help output for perf and its"
121 + ewarn "sub-tools."
122 + fi
123 +}
124 +
125 +pkg_setup() {
126 + use clang && LLVM_MAX_SLOT=9 llvm_pkg_setup
127 + # We enable python unconditionally as libbpf always generates
128 + # API headers using python script
129 + python_setup
130 +}
131 +
132 +src_unpack() {
133 + local paths=(
134 + tools/arch tools/build tools/include tools/lib tools/perf tools/scripts
135 + scripts include lib "arch/*/lib"
136 + )
137 +
138 + # We expect the tar implementation to support the -j option (both
139 + # GNU tar and libarchive's tar support that).
140 + echo ">>> Unpacking ${LINUX_SOURCES} (${paths[*]}) to ${PWD}"
141 + tar --wildcards -xpf "${DISTDIR}"/${LINUX_SOURCES} \
142 + "${paths[@]/#/linux-${LINUX_VER}/}" || die
143 +
144 + if [[ -n ${LINUX_PATCH} ]] ; then
145 + eshopts_push -o noglob
146 + ebegin "Filtering partial source patch"
147 + filterdiff -p1 ${paths[@]/#/-i } -z "${DISTDIR}"/${LINUX_PATCH} \
148 + > ${P}.patch
149 + eend $? || die "filterdiff failed"
150 + eshopts_pop
151 + fi
152 +
153 + local a
154 + for a in ${A}; do
155 + [[ ${a} == ${LINUX_SOURCES} ]] && continue
156 + [[ ${a} == ${LINUX_PATCH} ]] && continue
157 + unpack ${a}
158 + done
159 +}
160 +
161 +src_prepare() {
162 + default
163 + if [[ -n ${LINUX_PATCH} ]] ; then
164 + pushd "${S_K}" >/dev/null || die
165 + eapply "${WORKDIR}"/${P}.patch
166 + popd || die
167 + fi
168 +
169 + # Drop some upstream too-developer-oriented flags and fix the
170 + # Makefile in general
171 + sed -i \
172 + -e "s:\$(sysconfdir_SQ)/bash_completion.d:$(get_bashcompdir):" \
173 + "${S}"/Makefile.perf || die
174 + # A few places still use -Werror w/out $(WERROR) protection.
175 + sed -i -e 's:-Werror::' \
176 + "${S}"/Makefile.perf "${S_K}"/tools/lib/bpf/Makefile || die
177 +
178 + # Avoid the call to make kernelversion
179 + sed -i -e '/PERF-VERSION-GEN/d' Makefile.perf || die
180 + echo "#define PERF_VERSION \"${PV}\"" > PERF-VERSION-FILE
181 +
182 + # The code likes to compile local assembly files which lack ELF markings.
183 + find -name '*.S' -exec sed -i '$a.section .note.GNU-stack,"",%progbits' {} +
184 +
185 + # Fix shebang to use python from prefix
186 + if [[ -n "${EPREFIX}" ]]; then
187 + hprefixify ${S_K}/scripts/bpf_helpers_doc.py
188 + fi
189 +}
190 +
191 +puse() { usex $1 "" no; }
192 +perf_make() {
193 + # The arch parsing is a bit funky. The perf tools package is integrated
194 + # into the kernel, so it wants an ARCH that looks like the kernel arch,
195 + # but it also wants to know about the split value -- i386/x86_64 vs just
196 + # x86. We can get that by telling the func to use an older linux version.
197 + # It's kind of a hack, but not that bad ...
198 +
199 + # LIBDIR sets a search path of perf-gtk.so. Bug 515954
200 +
201 + local arch=$(tc-arch-kernel)
202 + local java_dir
203 + use java && java_dir="${EPREFIX}/etc/java-config-2/current-system-vm"
204 + # FIXME: NO_CORESIGHT
205 + # FIXME: NO_LIBBABELTRACE
206 + emake V=1 VF=1 \
207 + HOSTCC="$(tc-getBUILD_CC)" HOSTLD="$(tc-getBUILD_LD)" \
208 + CC="$(tc-getCC)" CXX="$(tc-getCXX)" AR="$(tc-getAR)" LD="$(tc-getLD)" NM="$(tc-getNM)" \
209 + PKG_CONFIG="$(tc-getPKG_CONFIG)" \
210 + prefix="${EPREFIX}/usr" bindir_relative="bin" \
211 + tipdir="share/doc/${PF}" \
212 + EXTRA_CFLAGS="${CFLAGS}" \
213 + ARCH="${arch}" \
214 + JDIR="${java_dir}" \
215 + LIBCLANGLLVM=$(usex clang 1 "") \
216 + LIBPFM4=$(usex libpfm 1 "") \
217 + NO_AUXTRACE="" \
218 + NO_BACKTRACE="" \
219 + NO_CORESIGHT=1 \
220 + NO_DEMANGLE=$(puse demangle) \
221 + GTK2=$(usex gtk 1 "") \
222 + feature-gtk2-infobar=$(usex gtk 1 "") \
223 + NO_JVMTI=$(puse java) \
224 + NO_LIBAUDIT=$(puse audit) \
225 + NO_LIBBABELTRACE=1 \
226 + NO_LIBBIONIC=1 \
227 + NO_LIBBPF= \
228 + NO_LIBCRYPTO=$(puse crypt) \
229 + NO_LIBDW_DWARF_UNWIND= \
230 + NO_LIBELF= \
231 + NO_LIBNUMA=$(puse numa) \
232 + NO_LIBPERL=$(puse perl) \
233 + NO_LIBPYTHON=$(puse python) \
234 + NO_LIBUNWIND=$(puse unwind) \
235 + NO_SDT=$(puse systemtap) \
236 + NO_SLANG=$(puse slang) \
237 + NO_LZMA=$(puse lzma) \
238 + NO_ZLIB= \
239 + WERROR=0 \
240 + LIBDIR="/usr/libexec/perf-core" \
241 + libdir="${EPREFIX}/usr/$(get_libdir)" \
242 + "$@"
243 +}
244 +
245 +src_compile() {
246 + # test-clang.bin not build with g++
247 + if use clang; then
248 + pushd "${S_K}/tools/build/feature/" || die
249 + make V=1 CXX=${CHOST}-clang++ test-clang.bin || die
250 + popd
251 + fi
252 + perf_make -f Makefile.perf
253 + use doc && perf_make -C Documentation
254 +}
255 +
256 +src_test() {
257 + :
258 +}
259 +
260 +src_install() {
261 + _install_python_ext() {
262 + perf_make -f Makefile.perf install-python_ext DESTDIR="${D}"
263 + }
264 +
265 + perf_make -f Makefile.perf install DESTDIR="${D}"
266 +
267 + if use python; then
268 + python_foreach_impl _install_python_ext
269 + fi
270 +
271 + if use gtk; then
272 + local libdir
273 + libdir="$(get_libdir)"
274 + # on some arches it ends up in lib even on 64bit, ppc64 for instance.
275 + [[ -f "${ED}"/usr/lib/libperf-gtk.so ]] && libdir="lib"
276 + mv "${ED}"/usr/${libdir}/libperf-gtk.so \
277 + "${ED}"/usr/libexec/perf-core || die
278 + fi
279 +
280 + dodoc CREDITS
281 +
282 + dodoc *txt Documentation/*.txt
283 +
284 + # perf needs this decompressed to print out tips for users
285 + docompress -x /usr/share/doc/${PF}/tips.txt
286 +
287 + if use doc ; then
288 + HTML_DOCS="Documentation/*.html" einstalldocs
289 + doman Documentation/*.1
290 + fi
291 +}