public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: Cedric Hombourger <Cedric_Hombourger@mentor.com>
Cc: <isar-users@googlegroups.com>
Subject: Re: [RFC Kernel PATCH 1/1] builddeb: support creation of linux-perf packages
Date: Fri, 30 Aug 2019 15:58:15 +0200	[thread overview]
Message-ID: <20190830155815.3042828c@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <1566976653-174-2-git-send-email-Cedric_Hombourger@mentor.com>

Am Wed, 28 Aug 2019 09:17:33 +0200
schrieb Cedric Hombourger <Cedric_Hombourger@mentor.com>:

> 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_<version> 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 <Cedric_Hombourger@mentor.com>
> ---
>  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 <<EOF >> 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 <<EOF > debian/rules
>  #!$(command -v $MAKE) -f
>  
>  srctree ?= .
> +EOF
> +
> +[ -n "${KDEB_PERF}" ] && cat <<EOF >> debian/rules
> +export KDEB_PERF=${KDEB_PERF}
> +EOF
> +
> +cat <<EOF >> debian/rules
>  
>  build:
>  	\$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \


  reply	other threads:[~2019-08-30 13:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28  7:17 [RFC Kernel PATCH 0/1] " Cedric Hombourger
2019-08-28  7:17 ` [RFC Kernel PATCH 1/1] builddeb: " Cedric Hombourger
2019-08-30 13:58   ` Henning Schild [this message]
2019-09-03  8:01     ` Cedric Hombourger
2019-09-03 14:59       ` Baurzhan Ismagulov
2019-09-03 15:19         ` Jan Kiszka
2019-09-04  8:37           ` Henning Schild

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190830155815.3042828c@md1za8fc.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=Cedric_Hombourger@mentor.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox