public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: chombourger@gmail.com
To: isar-users <isar-users@googlegroups.com>
Subject: Re: linux perf_4.19
Date: Tue, 2 Jul 2019 05:14:27 -0700 (PDT)	[thread overview]
Message-ID: <45064917-b93a-4cb7-80dd-833f192bde19@googlegroups.com> (raw)
In-Reply-To: <866f4164-0dc6-beba-ea97-c9904b4bc391@siemens.com>


[-- Attachment #1.1: Type: text/plain, Size: 4310 bytes --]

I do have a kernel patch to make builddep produce a debian package for perf

I however need to clean it up before I submit it upstream. Consider the 
inline patch below as RFC
(tested on 4.14 and 4.19). My worry is around the hard-coded Depends 
(tested OK on Debian 9)

Just did not get around to finalize it - sorry

Index: linux-4.14.71/scripts/package/builddeb
===================================================================
--- linux-4.14.71.orig/scripts/package/builddeb
+++ linux-4.14.71/scripts/package/builddeb
@@ -90,12 +90,23 @@ if [ -n "$KDEB_PKGVERSION" ]; then
 else
        packageversion=$version-$revision
 fi
+perf_kver="${version%%-*}"
+case "$perf_kver" in
+    *.*.*)
+        perf_kver="${perf_kver%.*}"
+        ;;
+esac
 sourcename=$KDEB_SOURCENAME
 tmpdir="$objtree/debian/tmp"
 kernel_headers_dir="$objtree/debian/hdrtmp"
 libc_headers_dir="$objtree/debian/headertmp"
 dbg_dir="$objtree/debian/dbgtmp"
 packagename=linux-image-$version
+perf_dir="$objtree/debian/perf-$perf_kver-tmp"
+meta_perf_dir="$objtree/debian/perftmp"
+perf_packagename=linux-perf-$perf_kver
+meta_perf_packagename=linux-perf
+dbg_dir="$objtree/debian/dbgtmp"
 kernel_headers_packagename=linux-headers-$version
 libc_headers_packagename=linux-libc-dev
 dbg_packagename=$packagename-dbg
@@ -125,6 +136,7 @@ BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_IN

 # Setup the directory structure
 rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" 
$objtree/debian/files
+rm -rf "$meta_perf_dir" "$perf_dir"
 mkdir -m 755 -p "$tmpdir/DEBIAN"
 mkdir -p "$tmpdir/lib" "$tmpdir/boot"
 mkdir -p "$kernel_headers_dir/lib/modules/$version/"
@@ -177,6 +189,21 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_
        fi
 fi
+mkdir -p $perf_dir
+$MAKE -C tools/perf -f Makefile.perf           \
+       DESTDIR="$(readlink -f $perf_dir)"      \
+       srctree=$(pwd)                          \
+       LDFLAGS=                                \
+       prefix=/usr                             \
+       perfexecdir=lib/perf_$perf_kver-core    \
+       install
+mv $perf_dir/usr/bin/perf $perf_dir/usr/bin/perf_$perf_kver
+rm -f $perf_dir/usr/bin/trace
+for p in $perf_dir/usr/bin/perf-*; do
+       [ -f $p ] || continue
+       mv $p $perf_dir/usr/lib/perf_$perf_kver-core/
+done
+
 if [ "$ARCH" != "um" ]; then
        $MAKE headers_check KBUILD_SRC=
        $MAKE headers_install KBUILD_SRC= 
INSTALL_HDR_PATH="$libc_headers_dir/usr"
@@ -352,12 +379,35 @@ Description: Linux support headers for u
  are used by the installed headers for GNU glibc and other system 
libraries.
 EOF

+cat <<EOF >> debian/control
+
+Package: $meta_perf_packagename
+Section: devel
+Architecture: all
+Depends: $perf_packagename
+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: $perf_packagename
+Section: devel
+Architecture: any
+Depends: libunwind8, libperl5.24, libpython2.7, binutils, libnuma1
+Description: Performance analysis tools for Linux $KERNELRELEASE
+ This package contains the 'perf' performance analysis tools for Linux 
kernel
+ version $KERNELRELEASE
+EOF
+
 if [ "$ARCH" != "um" ]; then
        create_package "$kernel_headers_packagename" "$kernel_headers_dir"
        create_package "$libc_headers_packagename" "$libc_headers_dir"
 fi

 create_package "$packagename" "$tmpdir"
+create_package "$perf_packagename" "$perf_dir"
+
+forcearch="-DArchitecture=all" \
+create_package "$meta_perf_packagename" "$meta_perf_dir"

 if [ -n "$BUILD_DEBUG" ] ; then
        # Build debug package

On Tuesday, July 2, 2019 at 1:38:03 PM UTC+2, Jan Kiszka wrote:
>
> On 02.07.19 13:30, srinuv...@gmail.com <javascript:> wrote: 
> > Hi All, 
> > 
> >                 We need to support perf tool in linux-cip 4.19 kernel, 
> Is it 
> > available perf_4.19 in ISAR? 
> > 
>
> Let's start differently: 
>
> - describe the problem you are facing (Debian perf vs. perf from custom 
>    kernels) 
> - describe your current downstream approach to resolve that (ideally 
>    with code) 
> - ask for feedback / suggestions how to address that in Isar generically 
>
> Jan 
>
> -- 
> Siemens AG, Corporate Technology, CT RDA IOT SES-DE 
> Corporate Competence Center Embedded Linux 
>

[-- Attachment #1.2: Type: text/html, Size: 6360 bytes --]

  reply	other threads:[~2019-07-02 12:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02 11:30 srinuvasanasv
2019-07-02 11:38 ` Jan Kiszka
2019-07-02 12:14   ` chombourger [this message]
2019-07-02 17:31     ` Jan Kiszka

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=45064917-b93a-4cb7-80dd-833f192bde19@googlegroups.com \
    --to=chombourger@gmail.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