From patchwork Tue Jan 19 02:41:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "MOESSBAUER, Felix" X-Patchwork-Id: 277 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:b386:0:0:0:0:0 with SMTP id p6csp3207826ooo; Tue, 19 Jan 2021 04:43:09 -0800 (PST) X-Received: by 2002:a1c:e055:: with SMTP id x82mr3959855wmg.185.1611060188960; Tue, 19 Jan 2021 04:43:08 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1611060188; cv=pass; d=google.com; s=arc-20160816; b=sBY1iJ7pjp3Hpn+lE3W/qwg9GtnQj0hnIAqO2VZJvsHxjV+8VRUhtWSuem7t1hGc0L +wK8agzwsbFUFXM879bWWTU4f6q4Bj9yJVvKrws1pBVzGXoSXuu2mTdO58H7jU9t+8KD dulFPMbE3aPEhyMEPQQWjQkYvAwaqKTkxlpL2sttuwgyHJFq0XiTNZ5jGNphyf42RGPf qft7XIWGSQ42g1houW3oIn4XzqWO2XmzJqFFDsyIq5U2HBoDWTQTrUX6K9lYWPxsR7+f dKgzIoBiI15Vh2s/dV0C7UvsvYvfn3b52P7c7jZ8xdBNwvll8CIjrznc/I6PNwr2Fp7j kmzg== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:sender:dkim-signature; bh=9l4qiL+y19aEcUNxqls+kFISQk8jVSJx61J4ianA6Mk=; b=sXYmXwsMNiTmAsql2kGPn+T/aOY4Ea3D7064p+uoj8EPhhe/WF8baC7dekjj5y3oKp scS1YH8duGsJxjH9Jm3s3MfWUEjA/SGq5SWd9Dvu5chjkujjbhG6Gupus0KvcRCDL37S yC7d/MwRP5JABs+qBuhImNBt+yJJDqwtqwcefuf+HltUJnYn+yBGKGIeob/5nYaIKCfl x87OopOPtannSYtjS2K2UsbXxlFZPTsfNdBIQo3P+onFcoBQoHWXfDu9++6Ia/gK6EeU IH58FeoNU3ec8o7BWch1YQd9xdM6RnxtxJ8XyXcqASpOP34EzBTY2xtPI5gxGogXHM1z TYGA== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=X5if87js; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbczk33mgwucrbxfhtoaamgqe7kvrd6a@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCZK33MGWUCRBXFHTOAAMGQE7KVRD6A@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com Received: from mail-sor-f55.google.com (mail-sor-f55.google.com. [209.85.220.55]) by mx.google.com with SMTPS id w5sor9853690wrl.50.2021.01.19.04.43.08 (Google Transport Security); Tue, 19 Jan 2021 04:43:08 -0800 (PST) Received-SPF: pass (google.com: domain of isar-users+bncbczk33mgwucrbxfhtoaamgqe7kvrd6a@googlegroups.com designates 209.85.220.55 as permitted sender) client-ip=209.85.220.55; Authentication-Results: mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=X5if87js; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbczk33mgwucrbxfhtoaamgqe7kvrd6a@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCZK33MGWUCRBXFHTOAAMGQE7KVRD6A@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com ARC-Seal: i=2; a=rsa-sha256; t=1611060188; cv=pass; d=google.com; s=arc-20160816; b=UANi7m5tOSrD6HG/8wTOyKaYu6xlW29IRGsLmDTk8c0R6a7w9KFt8wng1swPcahOm7 yRNFDQNHb847TuKrG47xOcPZyisP0sjMmflRa3oI0rWPH3URS5LOlz+aRjBo7YEJ6HId PtFVPHSe7AyEl5lv+nqAShWuoMZB1+z36Fa5EehryW4FHbqWf5hcvFJggNSI2t9M4i4V wzeMjBs94qGaLYKL/Hc+nkFisjZZzOgVGI+FpkQ4CGD8GWUJGHjNWxelF8vTJ7XyHWlk Nur92WJCxBHd76LzW7HY4YKawSmPto2hq/yrJsowVTUidM0CPpOBlAKRbv2QmHQW2duw QaYA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:sender:dkim-signature; bh=9l4qiL+y19aEcUNxqls+kFISQk8jVSJx61J4ianA6Mk=; b=vUFRqsFPfMxU3fmEESCKnlN+2NsUTM9wsl4lAGZQrMqFvO8sYsSx/GVVa3yGtjhNhU NPOfUNpfGrIjnRBgbzEO5MfrieuIA5ovJHbPeNmDyDQTif/SayWjvqZq/4jTl+Eh7gM2 RTQmTBtv50xV6+eHk+Y+ayTHHeJTyZn1nAaLiMVYIxxpV/52IvRyk5xqOIYGwOiWh0/H 3duOFkbao926P+4V0P3eoNN4B/1gq3Q0FOI7fJIu4jJOh2vXyrt4RWAP2GoBAVkfRTVh 6Epiwx1IngtjC9d/kRR3RZBJ2nRrsCsdUcW5O95+dVTUvpvcmiWaTh9PmoZMCYaniriJ Leqw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of felix.moessbauer@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=felix.moessbauer@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=9l4qiL+y19aEcUNxqls+kFISQk8jVSJx61J4ianA6Mk=; b=X5if87js4F9bXh19cylnVhQlD2W8F0F11w0SXZYn4l5EsfSMsCH/D6UHYhWNsJiQy0 h+/D+X6C1K2hJ/sGtW1UmsTXGbqWAeWOTa2Al7UpF1vJcdhZLLeGS4qRNX8lAN365mMw Zkll9L4mLlPtL+Ia5om/z7sHenpLY7cBnqS8F3Xuu9qsOA70NOjlBB/gTwlx461/oUNl H6a07x13jI355GE+iZ9NAZDDKOKXzp0zFGrQns8LYIg5UEY6jMi/lBsQDrHOINE5f+eo +iKQ0sFGtAe0+7/NjRsxOK9Ol53qHRBeF24F2amJxeX4F6lNG8ZwTYoO02OQ4u5nDvd8 Ndog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=9l4qiL+y19aEcUNxqls+kFISQk8jVSJx61J4ianA6Mk=; b=hCgqJQOUrxBoPeMIfc9ZshNcWT+pM7talsElVKrd59ywlaAp6KrtABR34FbEKE/Dz1 Q6u82iID4g/5I3heVtMKi43sLvvJRsKGFLdK083mweiOnE4GV4XjbHCvkMz5JgsYRGvg xQSy25ATXeUCGMhEnkTp5aoHqN+b5pen2F3jQtjiSufNyEr+FwJtl6nE1Y+Dyf5ekazZ pTJKojnPDrkWqhRQH0CFK8l4lF6xcbUoX6eOHhcHy5k5ufRqcw+9fFp1XnfN7VzpwiYq KxXqRU7sNn3MgLD05NWCDNQOglXGufJioclWtuI/x+OiIu+hZfd65bTClCHAz7kp67JP nhZg== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM530//5DHZgJJGNmJtoQ3ghItwGeV6TQyGuAfkKAPwqRVn3qlBnev QqunKcM6uYoLUybU7fe+u3A= X-Google-Smtp-Source: ABdhPJxpoLK28aMzTd763001wXCg2H0GG4v3efN8h79YacRm1JawNb5+R2bXix2H+P4uqFwNiBah6g== X-Received: by 2002:adf:92a4:: with SMTP id 33mr4130728wrn.347.1611060188641; Tue, 19 Jan 2021 04:43:08 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a5d:5543:: with SMTP id g3ls12988934wrw.0.gmail; Tue, 19 Jan 2021 04:43:07 -0800 (PST) X-Received: by 2002:a5d:5181:: with SMTP id k1mr4125803wrv.226.1611060187788; Tue, 19 Jan 2021 04:43:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611060187; cv=none; d=google.com; s=arc-20160816; b=bYWEO49hpYargPpiD14Mw0EN5N2PX6NwiuF1GbXClJ5Mr2DmymwarqdRQcELY/s/41 Y1dyPQiKcm0vSugd5n9w1Pg0xcJ7ALCLZLxVBC2yScI9E7WsRUqCUmZBUePNdvxibl42 sL2jLmznE7LqOqQK+vDL4i/971Ny1RMIbnd4+FmcXMv5VjukIxaK8PW35fPkjJ7GOjlG ByKCQPEwhNX98QDBE18yWSudO+6qXsU906Hg1SJ0b63wlrgtMwI0gAFWvgO8B7/kEkle EgZEfm5CL4rEZoyTgHTmyOvCqGFAUhMIei3ONkwPghRlDEoqB5gjQvFtcIggog9elURB T4qg== 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:date:subject:cc:to:from; bh=SgNyhUWulBPmPHA4UOytzfCZxc/svb43F8c5PPhuStE=; b=W8zgHhNeH4oUAxyR0JMKy7HA8Q8F/ucrhljwNzYt6W8IR69ysOnFt0/40UjLFZAP/W ouJXDzlwgPNl6HteEChnPmcGmeqtii7uk2Wmk46bEIS4T4R8DCn8vxtx4f65Gzq++INl e/q4ggyc3ZP4gtwy04qFWwiIYp2aG/Z/HDWyxLVPau/MLego997sx6iy1+AcGPjsTpfg 3G0G6G9zu8qKuZ6wB5KShV7YqdS2D2h4cEy4CZs3LLyRWMOquzTbFfOvfdWRWcruQdJw yzDmOc22tilXp3psopf9GHY3oxuHDzeyCnd5RRMFQirLpkMAYCXgP1+Vw0xuCmo3YTDS Vj/A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of felix.moessbauer@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=felix.moessbauer@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id e16si1263201wrn.1.2021.01.19.04.43.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jan 2021 04:43:07 -0800 (PST) Received-SPF: pass (google.com: domain of felix.moessbauer@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 10JCh7gk012993 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 19 Jan 2021 13:43:07 +0100 Received: from MD1T0KAC-VM.ad001.siemens.net (md1t0kac.ad001.siemens.net [139.25.0.7]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 10JCgkbp025009; Tue, 19 Jan 2021 13:43:07 +0100 From: Felix Moessbauer To: isar-users@googlegroups.com Cc: Felix Moessbauer , adriaan.schmidt@siemens.com, henning.schild@siemens.com, jan.kiszka@siemens.com Subject: [PATCH 1/1] RFC: Package perf from linux kernel tools Date: Tue, 19 Jan 2021 13:41:58 +0100 Message-Id: <20210119124157.12662-2-felix.moessbauer@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210119124157.12662-1-felix.moessbauer@siemens.com> References: <20210119124157.12662-1-felix.moessbauer@siemens.com> MIME-Version: 1.0 X-Original-Sender: felix.moessbauer@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of felix.moessbauer@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=felix.moessbauer@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1689319027692381620?= X-GMAIL-MSGID: =?utf-8?q?1689319048625440159?= This patch adds the linux-perf-4.19 package for a kernel that is build with ISAR. As the perf binaries have to be version specific, we patch the corresponding files from the kernel tools source to incorporate the major and minor version number. These patches are copied over from the official debianization of perf that is done in the src:linux package. Additionally, we package the perf python bindings as well and provide them as module "perf_4_19" (in the tools-perf-python.patch). As this debianization is not part of the kernel receipt, the perf package can be based on a different patch version of the kernel. While this might be intended, it is now the responibility of the user to ensure that both the kernel and the linux-perf- packages are compatible. --- .../recipes-kernel/linux-perf/files/rules | 53 ++++++++ .../linux-perf/files/tools-perf-install.patch | 58 +++++++++ .../linux-perf/files/tools-perf-python.patch | 55 ++++++++ .../linux-perf/files/tools-perf-version.patch | 119 ++++++++++++++++++ .../linux-perf/linux-perf-4.19_4.19.160.bb | 11 ++ .../recipes-kernel/linux-perf/linux-perf.inc | 46 +++++++ 6 files changed, 342 insertions(+) create mode 100644 meta-isar/recipes-kernel/linux-perf/files/rules create mode 100644 meta-isar/recipes-kernel/linux-perf/files/tools-perf-install.patch create mode 100644 meta-isar/recipes-kernel/linux-perf/files/tools-perf-python.patch create mode 100644 meta-isar/recipes-kernel/linux-perf/files/tools-perf-version.patch create mode 100644 meta-isar/recipes-kernel/linux-perf/linux-perf-4.19_4.19.160.bb create mode 100644 meta-isar/recipes-kernel/linux-perf/linux-perf.inc diff --git a/meta-isar/recipes-kernel/linux-perf/files/rules b/meta-isar/recipes-kernel/linux-perf/files/rules new file mode 100644 index 0000000..e23586c --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/files/rules @@ -0,0 +1,53 @@ +#!/usr/bin/make -f +# Note: this ruleset is based on the Makefile +# that is used for building the linux-perf- +# package in debian + +VERSION := 4.19 +deb_top_dir := $(CURDIR)/debian +DESTDIR := $(deb_top_dir)/binarypackage +PARALLEL_BUILD=-j $(shell echo $$(($$(nproc) * 2))) + +CFLAGS := $(shell dpkg-buildflags --get CFLAGS) -Wall +CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) -Wall +LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) + +MAKE_PERF := $(MAKE) O=$(CURDIR) prefix=/usr V=1 VF=1 WERROR=0 EXTRA_CFLAGS='$(CFLAGS) $(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' +MAKE_PERF += NO_GTK2=1 +MAKE_PERF += feature-jvmti=0 +MAKE_PERF += perfexecdir=lib/perf_$(VERSION)-core plugindir=/usr/lib/traceevent_$(VERSION)/plugins STRACE_GROUPS_DIR=share/perf_$(VERSION)-core/strace/groups tipdir=share/doc/linux-perf-$(VERSION) perf_include_dir=include/perf_$(VERSION) perf_examples_dir=share/doc/linux-perf-$(VERSION)/examples +MAKE_PERF += feature-libbfd=0 feature-libbfd-liberty=0 feature-libbfd-liberty-z=0 HAVE_CPLUS_DEMANGLE_SUPPORT=1 +MAKE_PERF += NO_LIBCRYPTO=1 +MAKE_PERF += LIBBABELTRACE=1 +MAKE_PERF += USE_ASCIIDOCTOR=1 +MAKE_PERF += PYTHON=/usr/bin/python3 +VERS_PATTERN := $(subst .,[._],$(VERSION)) + + +override_dh_auto_build: + +${MAKE_PERF} ${PARALLEL_MAKE} -C tools/perf -f Makefile.perf all VERSION=$(VERSION) DESTDIR=dummy + # Check that perf didn't get linked against libbfd or libcrypto + ! ldd $(CURDIR)/perf | grep -E '\blib(bfd|crypto)' + # Check that it includes cplus_demangle from libiberty + grep cplus_demangle $(CURDIR)/perf + +override_dh_auto_install: + +${MAKE_PERF} ${PARALLEL_MAKE} -C tools/perf -f Makefile.perf install VERSION=$(VERSION) DESTDIR=$(DESTDIR) + rm -f $(DESTDIR)/usr/bin/trace_$(VERSION) + mkdir -p $(DESTDIR)/usr/share/bash-completion/ + mv $(DESTDIR)/etc/bash_completion.d \ + $(DESTDIR)/usr/share/bash-completion/completions + rmdir --ignore-fail-on-non-empty $(DESTDIR)/etc + + # Check for unversioned files that are likely to result in file conflicts + cd $(DESTDIR) && ! find \! -type d \! -path '*[_-]$(VERS_PATTERN)*' | grep . + +override_dh_auto_clean: + rm -rf ${deb_top_dir}/binarypackage + +override_dh_auto_test: + echo "Skip tests" + +%: + CFLAGS= LDFLAGS= dh $@ --parallel + diff --git a/meta-isar/recipes-kernel/linux-perf/files/tools-perf-install.patch b/meta-isar/recipes-kernel/linux-perf/files/tools-perf-install.patch new file mode 100644 index 0000000..8cfd02a --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/files/tools-perf-install.patch @@ -0,0 +1,58 @@ +From: Bastian Blank +Date: Fri, 07 Oct 2011 21:37:52 +0100 +Subject: Install perf scripts non-executable +Forwarded: no + +[bwh: Forward-ported to 4.13] + +Index: linux/tools/perf/Makefile.perf +=================================================================== +--- linux.orig/tools/perf/Makefile.perf ++++ linux/tools/perf/Makefile.perf +@@ -796,8 +796,8 @@ endif + ifndef NO_LIBPERL + $(call QUIET_INSTALL, perl-scripts) \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \ +- $(INSTALL) scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \ +- $(INSTALL) scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'; \ ++ $(INSTALL) -m 644 scripts/perl/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/Perf-Trace-Util/lib/Perf/Trace'; \ ++ $(INSTALL) -m 644 scripts/perl/*.pl -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl'; \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin'; \ + $(INSTALL) scripts/perl/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/perl/bin' + endif +@@ -805,27 +805,27 @@ ifndef NO_LIBPYTHON + $(call QUIET_INSTALL, python-scripts) \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin'; \ +- $(INSTALL) scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \ +- $(INSTALL) scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'; \ ++ $(INSTALL) -m 644 scripts/python/Perf-Trace-Util/lib/Perf/Trace/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/Perf-Trace-Util/lib/Perf/Trace'; \ ++ $(INSTALL) -m 644 scripts/python/*.py -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python'; \ + $(INSTALL) scripts/python/bin/* -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/scripts/python/bin' + endif + $(call QUIET_INSTALL, perf_completion-script) \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'; \ +- $(INSTALL) perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf_$(VERSION)' ++ $(INSTALL) -m 644 perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf_$(VERSION)' + $(call QUIET_INSTALL, perf-tip) \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(tip_instdir_SQ)'; \ +- $(INSTALL) Documentation/tips.txt -t '$(DESTDIR_SQ)$(tip_instdir_SQ)' ++ $(INSTALL) -m 644 Documentation/tips.txt -t '$(DESTDIR_SQ)$(tip_instdir_SQ)' + + install-tests: all install-gtk + $(call QUIET_INSTALL, tests) \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \ +- $(INSTALL) tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \ ++ $(INSTALL) -m 644 tests/attr.py '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests'; \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \ +- $(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \ ++ $(INSTALL) -m 644 tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell'; \ +- $(INSTALL) tests/shell/*.sh '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell'; \ ++ $(INSTALL) -m 644 tests/shell/*.sh '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell'; \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib'; \ +- $(INSTALL) tests/shell/lib/*.sh '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib' ++ $(INSTALL) -m 644 tests/shell/lib/*.sh '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/lib' + + install-bin: install-tools install-tests install-traceevent-plugins + diff --git a/meta-isar/recipes-kernel/linux-perf/files/tools-perf-python.patch b/meta-isar/recipes-kernel/linux-perf/files/tools-perf-python.patch new file mode 100644 index 0000000..5770d9f --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/files/tools-perf-python.patch @@ -0,0 +1,55 @@ +--- a/tools/perf/Makefile.perf ++++ b/tools/perf/Makefile.perf +@@ -829,10 +829,10 @@ + + install-bin: install-tools install-tests install-traceevent-plugins + +-install: install-bin try-install-man +- + install-python_ext: +- $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)' ++ $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)' --install-layout=deb; ++ ++install: install-bin try-install-man install-python_ext + + # 'make install-doc' should call 'make -C Documentation install' + $(INSTALL_DOC_TARGETS): +--- a/tools/perf/util/setup.py ++++ b/tools/perf/util/setup.py +@@ -51,14 +51,14 @@ + # use full paths with source files + ext_sources = list(map(lambda x: '%s/%s' % (src_perf, x) , ext_sources)) + +-perf = Extension('perf', ++perf = Extension('perf_4_19', + sources = ext_sources, + include_dirs = ['util/include'], + extra_compile_args = cflags, + extra_objects = [libtraceevent, libapikfs], + ) + +-setup(name='perf', ++setup(name='perf_4_19', + version='0.1', + description='Interface with the Linux profiling infrastructure', + author='Arnaldo Carvalho de Melo', +--- a/tools/perf/util/python.c ++++ b/tools/perf/util/python.c +@@ -77,7 +77,7 @@ + #if PY_MAJOR_VERSION < 3 + PyMODINIT_FUNC initperf(void); + #else +-PyMODINIT_FUNC PyInit_perf(void); ++PyMODINIT_FUNC PyInit_perf_4_19(void); + #endif + + #define member_def(type, member, ptype, help) \ +@@ -1270,7 +1270,7 @@ + #if PY_MAJOR_VERSION < 3 + PyMODINIT_FUNC initperf(void) + #else +-PyMODINIT_FUNC PyInit_perf(void) ++PyMODINIT_FUNC PyInit_perf_4_19(void) + #endif + { + PyObject *obj; diff --git a/meta-isar/recipes-kernel/linux-perf/files/tools-perf-version.patch b/meta-isar/recipes-kernel/linux-perf/files/tools-perf-version.patch new file mode 100644 index 0000000..6833bb7 --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/files/tools-perf-version.patch @@ -0,0 +1,119 @@ +From: Bastian Blank +Date: Mon, 26 Sep 2011 13:53:12 +0100 +Subject: Create manpages and binaries including the version +Forwarded: no + +[bwh: Fix version insertion in perf man page cross-references and perf +man page title. Install bash_completion script for perf with a +version-dependent name. And do the same for trace.] + +Index: linux/tools/perf/Makefile.perf +=================================================================== +--- linux.orig/tools/perf/Makefile.perf ++++ linux/tools/perf/Makefile.perf +@@ -759,23 +759,23 @@ endif + install-tools: all install-gtk + $(call QUIET_INSTALL, binaries) \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'; \ +- $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)'; \ +- $(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf' '$(DESTDIR_SQ)$(bindir_SQ)/trace' ++ $(INSTALL) $(OUTPUT)perf '$(DESTDIR_SQ)$(bindir_SQ)/perf_$(VERSION)'; \ ++ $(LN) '$(DESTDIR_SQ)$(bindir_SQ)/perf_$(VERSION)' '$(DESTDIR_SQ)$(bindir_SQ)/trace_$(VERSION)' ++ $(call QUIET_INSTALL, libexec) \ ++ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' + ifndef NO_PERF_READ_VDSO32 + $(call QUIET_INSTALL, perf-read-vdso32) \ +- $(INSTALL) $(OUTPUT)perf-read-vdso32 '$(DESTDIR_SQ)$(bindir_SQ)'; ++ $(INSTALL) $(OUTPUT)perf-read-vdso32 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'; + endif + ifndef NO_PERF_READ_VDSOX32 + $(call QUIET_INSTALL, perf-read-vdsox32) \ +- $(INSTALL) $(OUTPUT)perf-read-vdsox32 '$(DESTDIR_SQ)$(bindir_SQ)'; ++ $(INSTALL) $(OUTPUT)perf-read-vdsox32 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'; + endif + ifndef NO_JVMTI + $(call QUIET_INSTALL, $(LIBJVMTI)) \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(libdir_SQ)'; \ + $(INSTALL) $(OUTPUT)$(LIBJVMTI) '$(DESTDIR_SQ)$(libdir_SQ)'; + endif +- $(call QUIET_INSTALL, libexec) \ +- $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' + ifndef NO_LIBBPF + $(call QUIET_INSTALL, bpf-headers) \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf'; \ +@@ -811,7 +811,7 @@ ifndef NO_LIBPYTHON + endif + $(call QUIET_INSTALL, perf_completion-script) \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d'; \ +- $(INSTALL) perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf' ++ $(INSTALL) perf-completion.sh '$(DESTDIR_SQ)$(sysconfdir_SQ)/bash_completion.d/perf_$(VERSION)' + $(call QUIET_INSTALL, perf-tip) \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(tip_instdir_SQ)'; \ + $(INSTALL) Documentation/tips.txt -t '$(DESTDIR_SQ)$(tip_instdir_SQ)' +@@ -836,7 +836,7 @@ install-python_ext: + + # 'make install-doc' should call 'make -C Documentation install' + $(INSTALL_DOC_TARGETS): +- $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=) ++ $(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) $(@:-doc=) VERSION=$(VERSION) + + ### Cleaning rules + +Index: linux/tools/perf/Documentation/Makefile +=================================================================== +--- linux.orig/tools/perf/Documentation/Makefile ++++ linux/tools/perf/Documentation/Makefile +@@ -194,14 +194,16 @@ ifdef missing_tools + $(error "You need to install $(missing_tools) for man pages") + endif + +-do-install-man: man ++do-install-man: $(addprefix install-man-,$(_DOC_MAN1)) ++ ++install-man-perf.1: $(OUTPUT)perf.1 ++ $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir) ++ sed -e 's/"PERF"/"PERF_$(VERSION)"/' -e 's/fBperf-/fBperf_$(VERSION)-/g' $^ > $(DESTDIR)$(man1dir)/perf_$(VERSION).1 ++ ++install-man-perf%.1: $(OUTPUT)perf%.1 + $(call QUIET_INSTALL, Documentation-man) \ + $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir); \ +-# $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir); \ +-# $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir); \ +- $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir); \ +-# $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir); \ +-# $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir) ++ sed -e 's/"PERF\\-/"PERF_$(VERSION)\\-/' -e 's/fBperf-/fBperf_$(VERSION)-/g' $^ > $(DESTDIR)$(man1dir)/perf_$(VERSION)$*.1 + + install-man: check-man-tools man do-install-man + +Index: linux/tools/perf/util/Build +=================================================================== +--- linux.orig/tools/perf/util/Build ++++ linux/tools/perf/util/Build +@@ -193,6 +193,7 @@ CFLAGS_libstring.o += -Wno-unused-pa + CFLAGS_hweight.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" + CFLAGS_parse-events.o += -Wno-redundant-decls + CFLAGS_header.o += -include $(OUTPUT)PERF-VERSION-FILE ++CFLAGS_vdso.o += -DPERFEXECDIR='"$(perfexec_instdir_SQ)"' + + $(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c FORCE + $(call rule_mkdir) +Index: linux/tools/perf/util/vdso.c +=================================================================== +--- linux.orig/tools/perf/util/vdso.c ++++ linux/tools/perf/util/vdso.c +@@ -52,12 +52,12 @@ static struct vdso_info *vdso_info__new( + .vdso32 = { + .temp_file_name = VDSO__TEMP_FILE_NAME, + .dso_name = DSO__NAME_VDSO32, +- .read_prog = "perf-read-vdso32", ++ .read_prog = PERFEXECDIR "/perf-read-vdso32", + }, + .vdsox32 = { + .temp_file_name = VDSO__TEMP_FILE_NAME, + .dso_name = DSO__NAME_VDSOX32, +- .read_prog = "perf-read-vdsox32", ++ .read_prog = PERFEXECDIR "/perf-read-vdsox32", + }, + #endif + }; diff --git a/meta-isar/recipes-kernel/linux-perf/linux-perf-4.19_4.19.160.bb b/meta-isar/recipes-kernel/linux-perf/linux-perf-4.19_4.19.160.bb new file mode 100644 index 0000000..33ff6d2 --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/linux-perf-4.19_4.19.160.bb @@ -0,0 +1,11 @@ +KERNEL_COMPAT_VERSION = "4.19" + +SRC_URI += " \ + https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${PV}.tar.xz \ + file://tools-perf-version.patch;apply=yes \ + file://tools-perf-install.patch;apply=yes \ + file://tools-perf-python.patch;apply=yes \ +" +SRC_URI[sha256sum] = "18345206f9c61e8adafa5204d0ca0b8619f1d9aafd70cbd5cb0fbf1faf521585" + +require recipes-kernel/linux-perf/linux-perf.inc diff --git a/meta-isar/recipes-kernel/linux-perf/linux-perf.inc b/meta-isar/recipes-kernel/linux-perf/linux-perf.inc new file mode 100644 index 0000000..a4bc253 --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/linux-perf.inc @@ -0,0 +1,46 @@ +# Kernel specific linux-perf- package +# Note, that only major and minor versions of the +# kernel have to match, the patch level should be +# irrelevant. + +inherit dpkg + +MAINTAINER ?= "Felix Moessbauer " +DESCRIPTION ?= "Performance analysis tools for Linux ${KERNEL_COMPAT_VERSION}" +CHANGELOG_V ?= "${PV}+isar" + +SRC_URI += "file://rules" +S = "${WORKDIR}/linux-${PV}" + +DEBIAN_BUILD_DEPENDS ?= " \ + asciidoctor, \ + gcc-multilib [amd64 mips64 mips64el mips64r6 mips64r6el ppc64 s390x sparc64], \ + libaudit-dev, \ + libbabeltrace-dev (>= 1.5.0), \ + libbabeltrace-dev (>= 1.5.3-2~) | libbabeltrace-ctf-dev (>= 1.5.0), \ + libdw-dev, \ + libiberty-dev, \ + libnewt-dev, \ + libnuma-dev, \ + libperl-dev, \ + libunwind-dev [amd64 arm64 armel armhf hppa i386 mips mips64 mips64el mipsel powerpc ppc64 ppc64el sh4], \ + libopencsd-dev, \ + python3-dev, \ + flex, \ + bison, \ +" + +DEBIAN_DEPENDS ?= "\${shlibs:Depends}, \${misc:Depends}, \${perl:Depends}, \${python3:Depends}" + +do_prepare_build[cleandirs] += "${S}/debian" + +do_prepare_build() { + deb_debianize + echo "3.0 (quilt)" > ${S}/debian/source + echo "debian/binarypackage/usr /" > ${S}/debian/install + deb_add_changelog +} + +dpkg_runbuild_prepend() { + export DEB_BUILD_OPTIONS="nocheck" +}