From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6730113598409932800 X-Received: by 2002:adf:d852:: with SMTP id k18mr10035033wrl.88.1567173497422; Fri, 30 Aug 2019 06:58:17 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a5d:660f:: with SMTP id n15ls1995692wru.11.gmail; Fri, 30 Aug 2019 06:58:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUmtWsijvODScW0zOp+ksfxLV50gz7ZFQ/EQKRh9NEFw3bhyO9PV9ImIbP4ws/haER9PbB X-Received: by 2002:a5d:4fc4:: with SMTP id h4mr19178439wrw.64.1567173497025; Fri, 30 Aug 2019 06:58:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567173497; cv=none; d=google.com; s=arc-20160816; b=ixJq4h8d1jbWLHtE9ZlzpEjWR4zWqs+3hmJLIVSXsu87ypHJCeDb0PqzCWfyYQi9UW cLAtFsObfufj2S78H2RrQBFg2X0+iNFVLfndQcp3Atv70vCie7Wn/KhwkmS8GaWrO9Pq VFs0Gome0A9AliXvepw/SUw2y6mQlIGSegrR9uDCqWHG/sjnbbU6upg6yAVagl9MxlJ5 bo7DcWDTrGJ0wcqTauzMsriza6WFjOx/vSSPrtZw9D43KNBo85x0d+IxdOzAubHqnDQn PFuXgFBKEh1ncKJgXK+C9y58TaatH0S/yXcKGEF1ZI+qk8PrD39kAa8J41ylU4wwBlK/ lBPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=NaXBM/33Nc4tcxuSAJXdf5KmcNOiEgB35PnK8CM7s18=; b=njGQM0LhUfHzjS2IJhDE0ToqnTSxK25Iu2uouUTuOnT7JKR1RZOwVp/QoNnzuy82PK YHsMtGZK1TAE8dGWr5bg37hbz9bkc/RuzzsB7MKzkwhaQ7GkAskyxIw4Yl01sP73xUjL 8yNwtarvTfvLzLDZ+7aKS7LLsria8t1a9hGiAdR3uLu6Pa3PqiHC1M4SwT6fpGpK3bwl tlX0hNCmE5IAnfVnbnQ8FpFTjkkdMoacPk4ft6vXnTMyNKQOYv4aNYcdgd6kbRG86kkW v0ItKpW7ABOWBwI4Lh16gsTRq68CYvXOxEUEPqEEJzE+OECJykB4y8pZeAp9XKkS7x9t /4ew== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id a198si524073wma.4.2019.08.30.06.58.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Aug 2019 06:58:17 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id x7UDwGSs022027 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2019 15:58:16 +0200 Received: from md1za8fc.ad001.siemens.net ([139.25.69.53]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id x7UDwG8v024993; Fri, 30 Aug 2019 15:58:16 +0200 Date: Fri, 30 Aug 2019 15:58:15 +0200 From: Henning Schild To: Cedric Hombourger Cc: Subject: Re: [RFC Kernel PATCH 1/1] builddeb: support creation of linux-perf packages Message-ID: <20190830155815.3042828c@md1za8fc.ad001.siemens.net> In-Reply-To: <1566976653-174-2-git-send-email-Cedric_Hombourger@mentor.com> References: <1566976653-174-1-git-send-email-Cedric_Hombourger@mentor.com> <1566976653-174-2-git-send-email-Cedric_Hombourger@mentor.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: g3vzulQFJ7Mn Am Wed, 28 Aug 2019 09:17:33 +0200 schrieb Cedric Hombourger : > Provide a mechanism for the Debian package generation scripts to also > produce perf packages in addition to the kernel packages. Pass > KDEB_PERF=1 to the "make deb-pkg" command line. The structure of the > packages should match very closely with Debian's with the perf binary > and support folders suffixed with the kernel version number > (Debian's /usr/bin/perf script checks the running kernel to spawn the > corresponding perf_ binary). It shall also be noted that it > is left to the user to specify runtime dependencies via the added > KDEB_PERF_DEPS variable. They are indeed distro and environment > specific (perf determines what features should be compiled in after > checking packages installed on the build host) Good idea, also not doing it inside Isar. I have one other debian based non-Isar project where we have a debian/ folder for perf ;). I would suggest trying that on ubuntu before posting. > Signed-off-by: Cedric Hombourger > --- > scripts/package/builddeb | 32 ++++++++++++++++++++++++++++++++ > scripts/package/mkdebian | 26 ++++++++++++++++++++++++++ > 2 files changed, 58 insertions(+) > > diff --git a/scripts/package/builddeb b/scripts/package/builddeb > index c4c580f547ef..76c9c49a678f 100755 > --- a/scripts/package/builddeb > +++ b/scripts/package/builddeb > @@ -51,6 +51,8 @@ tmpdir="$objtree/debian/tmp" > kernel_headers_dir="$objtree/debian/hdrtmp" > libc_headers_dir="$objtree/debian/headertmp" > dbg_dir="$objtree/debian/dbgtmp" > +perf_dir="$objtree/debian/linux-perf-tmp" > +perf_xy_dir="$objtree/debian/linux-perf-$VERSION.$PATCHLEVEL-tmp" xy seems like a strange name, i did not even start looking why there are two and what they are used for > packagename=linux-image-$version > kernel_headers_packagename=linux-headers-$version > libc_headers_packagename=linux-libc-dev > @@ -78,6 +80,7 @@ BUILD_DEBUG=$(if_enabled_echo CONFIG_DEBUG_INFO Yes) > > # Setup the directory structure > rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" > "$dbg_dir" $objtree/debian/files > +rm -rf "$perf_dir" "$perf_xy_dir" Seems like this should be merged with the line before. > mkdir -m 755 -p "$tmpdir/DEBIAN" > mkdir -p "$tmpdir/lib" "$tmpdir/boot" > mkdir -p "$kernel_headers_dir/lib/modules/$version/" > @@ -129,6 +132,30 @@ if is_enabled CONFIG_MODULES; then > fi > fi > > +if [ -n "$KDEB_PERF" ]; then > + mkdir -p $perf_dir $perf_xy_dir > + $MAKE -C tools/perf -f > Makefile.perf \ > + DESTDIR="$(readlink -f > $perf_xy_dir)" \ > + > STRACE_GROUPS_DIR=share/perf_$VERSION.$PATCHLEVEL-core/strace/groups > \ > + > LDFLAGS= > \ > + > prefix=/usr > \ > + > perf_examples_dir=share/doc/linux-perf-$VERSION.$PATCHLEVEL/examples > \ > + > perf_include_dir=include/perf_$VERSION.$PATCHLEVEL > \ > + > perfexecdir=lib/perf_$VERSION.$PATCHLEVEL-core > \ > + > plugindir=/usr/lib/traceevent_$VERSION.$PATCHLEVEL/plugins > \ > + > srctree=$(pwd) > \ > + > tipdir=share/doc/linux-perf-$VERSION.$PATCHLEVEL > \ > + install These lines all seem a little long. > + mv > $perf_xy_dir/etc/bash_completion.d/perf > \ > + > $perf_xy_dir/etc/bash_completion.d/perf_$VERSION.$PATCHLEVEL > + mv $perf_xy_dir/usr/bin/perf > $perf_xy_dir/usr/bin/perf_$VERSION.$PATCHLEVEL > + rm -f $perf_xy_dir/usr/bin/trace > + for p in $perf_xy_dir/usr/bin/perf-*; do > + [ -f $p ] || continue > + mv $p > $perf_xy_dir/usr/lib/perf_$VERSION.$PATCHLEVEL-core/ > + done > +fi > + > if [ "$ARCH" != "um" ]; then > $MAKE -f $srctree/Makefile headers > $MAKE -f $srctree/Makefile headers_install > INSTALL_HDR_PATH="$libc_headers_dir/usr" @@ -191,6 +218,11 @@ fi > > create_package "$packagename" "$tmpdir" > > +if [ -n "$KDEB_PERF" ]; then > + create_package "linux-perf-$VERSION.$PATCHLEVEL" > "$perf_xy_dir" > + forcearch="-DArchitecture=all" create_package "linux-perf" > "$perf_dir" +fi > + > if [ -n "$BUILD_DEBUG" ] ; then > # Build debug package > # Different tools want the image in different locations > diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian > index e0750b70453f..a5826b634509 100755 > --- a/scripts/package/mkdebian > +++ b/scripts/package/mkdebian > @@ -207,10 +207,36 @@ Description: Linux kernel debugging symbols for > $version all the necessary debug symbols for the kernel and its > modules. EOF > > +[ -n "${KDEB_PERF}" ] && cat <> debian/control > + > +Package: linux-perf > +Section: devel > +Architecture: all > +Depends: linux-perf-${VERSION}.${PATCHLEVEL} > +Description: Performance analysis tools for Linux (meta-package) > + This package depends on the package containing the 'perf' > performance analysis > + tools for the latest Linux kernel. > + > +Package: linux-perf-${VERSION}.${PATCHLEVEL} > +Section: devel > +Architecture: $debarch > +Depends: ${KDEB_PERF_DEPS} > +Description: Performance analysis tools for Linux $version > + This package contains the 'perf' performance analysis tools for > Linux kernel That all seems copied from Debian, except where does the "Section" come from and why deviate? Henning > + version $version > +EOF > + > cat < debian/rules > #!$(command -v $MAKE) -f > > srctree ?= . > +EOF > + > +[ -n "${KDEB_PERF}" ] && cat <> debian/rules > +export KDEB_PERF=${KDEB_PERF} > +EOF > + > +cat <> debian/rules > > build: > \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \