From patchwork Tue Apr 27 01:24:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "MOESSBAUER, Felix" X-Patchwork-Id: 458 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:e7c8:0:0:0:0:0 with SMTP id y8csp2327680oov; Tue, 27 Apr 2021 02:28:52 -0700 (PDT) X-Received: by 2002:a2e:7010:: with SMTP id l16mr16354221ljc.41.1619515731913; Tue, 27 Apr 2021 02:28:51 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1619515731; cv=pass; d=google.com; s=arc-20160816; b=egVcTzPrmRkPjZwBiebP+k+oMzSGOXSk2RRlo75t+nG1c24Worku6l76yAsI2e953e ZtZUBzKxjh0G/ubukXfptJA+WB9zTqsNWTm2d+xV3xKZ24JDBJ6ZS/MKETrzNdwx3Gh1 GZ9BcqVsLV7yHfKPZU1GvH68YbO7CiC9kxUqK9tRhLNbNZRTUEdY3ZTd/c4l3g6b1Q9w rwpeq7I4nXqpNnzX2GOtX89UaX41nM8HJ8hQOOKPfR+CA60xS7NPnsb+1+VVj970u7xE 0OeorJyuwPJQe5uIsAJjMu6FWwHkAm2xV4IbapgDOpAeidWtlfcMKzp8hFEFaReU6hiQ gUHg== 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=KBwZsy+IGgRN1POyC4q1xjvJEoKd8NAJPe7a4JsQHzs=; b=DyIGQXUTSx+kBfq2eGADwZNJVSOyUUA/kIBapk+o9G3vec+P7gYdnRXFr6L6NaQFkx cR+ld7qkp8MUgtBbUgaUM9GZkJcmxC/+pv0E90qvrR4KT5ziwf8TtB8tDQmCOdOw6K4b ap8XTwPpCRswdCaRbKffxcs12qlOeo2b7KtdOJNtF6L5b/sbRPIazwnCMUx9aw17tALe 3pKnersP7tkVHYaCRecLsGTezSXU/sHVTJgXzyhtO3LBmsn4KuyH/nVxeBWJ5xMayqg8 7cr/0ww1hS6+aqFwYE/r8HLElW17oN1Ct7nW+ZpUpz3hZILPq40H8viEDYFkIyNqKzfz 9SEQ== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=QjM4a4an; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbczk33mgwucrbu5st6camgqepxnttxq@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCZK33MGWUCRBU5ST6CAMGQEPXNTTXQ@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 r17sor8657549ljn.70.2021.04.27.02.28.51 (Google Transport Security); Tue, 27 Apr 2021 02:28:51 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbczk33mgwucrbu5st6camgqepxnttxq@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=QjM4a4an; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbczk33mgwucrbu5st6camgqepxnttxq@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCZK33MGWUCRBU5ST6CAMGQEPXNTTXQ@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com ARC-Seal: i=2; a=rsa-sha256; t=1619515731; cv=pass; d=google.com; s=arc-20160816; b=n5dZDctcaUZBeXk9CsGA8pnZxM0dkGpFhaduD5VpQHUFAh9C8O0F479s0twDzXlkcH q/YgbQrvhegnbjvtGLOeQdMm5tsoKuoyA6zEwVSCCsUQRs+sOHao4bEJ3ZrBjj/RVLgI CCP1QcZad1MeJ9D6WXUh3qCFd+Whg9HEA+aXCkiFEZMRc2UDVRXV4SXorhYi5+Q8JcGg 0iQBQX9NraGisrSBkDgRbSEg0Uzy6YRdEMAVD9VckQNO50YOOBqQQ+DGPWVrBuWr1SOC Hfg3nUPuPC7QsfmjRPPo4nHF8Cg769TtDwl/PYZPhI1rbVjgNtrsxQ5CnaFGArMuSTwC Q29Q== 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=KBwZsy+IGgRN1POyC4q1xjvJEoKd8NAJPe7a4JsQHzs=; b=iQxbv1X+ltHTOB2mV3K3ETeqGiauIUWqJRupdgILCJW+UmkfMBGT1txyZGs6+mUHHt FSIj/9Bz5qdkiTXUb47rNNQrXZheK75p96Bn9tABkR78Ys7ma1+PBWR1Af7Lpkg32r4Z tBPoP8JKVtSRrqsuIkPLECxSApXevupN18Gh5rSC1saMckNW9vP0fgway1j3NJnGRHvH bvPaKZ1amSekdPNvsqXec62nZEpfbYgyRe06n+EIL1am+NjHGUx2pVmdMWOR9B1ps4lQ lKdAri4GMcc6auoRS9QOTdAS+bYykdfqaCYLhrzrhDpZbIhk6EVVV/caS6cuBJpuUpmC Yotg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of felix.moessbauer@siemens.com designates 194.138.37.39 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=KBwZsy+IGgRN1POyC4q1xjvJEoKd8NAJPe7a4JsQHzs=; b=QjM4a4anovdHBLh8cdgxvnw3VaEzqo1/kLIk5fnTNz4l1cif7wtrgiEyP/o7I1VyON n26lIw8A4LmKOuIhQqoUm/AhCpm3dmub3LlNnx7MhZrlIRDa3iKfxwgAfn+bvBPZux1k /eIt0T4zxcgaoClEHtR3kR7xr23dzRSXiruhgz0x4hBXulyZsNJ20y0LEHaEvlguUPD/ Hr3X6wPdewg2gf/Y1qQBORQ54m4dn9mGKf9xn99dQt+x4Er2LVD5eve3bpKFYQJx64P0 uPHi/yLnL93MB88QZOJaS8iMXErtl7NX38ynG3UGIYOTnFJ/i873GNWF5v9KiOmdb3OU ZkMg== 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=KBwZsy+IGgRN1POyC4q1xjvJEoKd8NAJPe7a4JsQHzs=; b=RQwAtQhSr4nwo5yonkUBFw5oEuMomDJtAMNKJJqoeg65czipvR5qqTaR9TkonYjws8 bsJ4QIJtxZpxrXBJV+EVLrf+U8j6aAYfR4F20eUo5s2ZOHXUZ3XKtKH7qrADKX6rEMRj IDjxzpM+C9iiin+mQBCtcTXIE1PE3jh2leHsxdMK2qyWBTWm2/mtyXL5o9IUFN/GYzFm 4ND6nQAUbKPAlIvsGVpRHgzFoDK/KsHoIbgvhM8G8GkM8B2bvRbOl3+modmeqEXNjj6S 8i3Vbg5jKDCJ7FztmRTAsbw8cTNF3Fp5OjjYT+JvTyLAmAYoPif63U+7QC1yoNkidowH UkOQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM532cBJD7rz5p5W2awsn4Bb4mDMSCz7HC9A4XZW5FyLSX/Bxw/Nl3 rdq1NkUjPgjXK4iL4GWqRiw= X-Google-Smtp-Source: ABdhPJyDYu1gByY9CjTsWnIzLc6g1LpfBN4rKGC1J+7cU0wpV/jneWOVjTZ37Q+HoZwUcl02fOj1jg== X-Received: by 2002:a2e:9355:: with SMTP id m21mr16225007ljh.213.1619515731529; Tue, 27 Apr 2021 02:28:51 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:6c2:: with SMTP id u2ls3333075lff.3.gmail; Tue, 27 Apr 2021 02:28:50 -0700 (PDT) X-Received: by 2002:a19:3813:: with SMTP id f19mr16088330lfa.473.1619515730496; Tue, 27 Apr 2021 02:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619515730; cv=none; d=google.com; s=arc-20160816; b=nDP8NwM2XyMd5XSF3H7xCxY+SpKIPP2mlh8Mua73LzjXSYF2nQ2c6ZXgtXMZs3eyym MeU8H5HFJofZSLQwA0GdlTlOfxTcZIiu3t0XkUxHSpajeFRmqBbj0T6ooMPQVoVXqwRi lJt7m2dUe/mL+n+cqlyDgK3MMyCYpawJexYYuYIAXaMXn6Udnpd1lce895VPH6Fhn7Jx wWYAgAFlQVGfEMa5lQ6pM22tLw8SCo9lirHxc3MjRIeY7rw0qp0i2juvOE/Woi4Wptt4 y9MJZ75/wSxjAPUf7gGZhaAAsL/3fn7fN9QRBs8xQi0Topl/bnvIFmw7kFdQoqkOEngH bcqw== 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=etvjzdRPDS1hs+G1kjfJKNPqDxuNojnUEFBT3mKvcqs=; b=UmZA9EJYOo74IUVcOnTzkPd9IxjW4Ff9gNFzHR7xIcHGWl3d3crLvvSSU3xtij4RNb Q8OGyG3Wyrz5ydU57Z+OouWpXZnQQOWRoJublcMnMuYb8MLJDk04GYnxoK5MJltQlJGK soJqHQavbJCEr0jeGNpSQcmjHIwsag31qUWzivmoNmnF9CloNQ9g7X3xftwhCs8dKEg1 W25dslTCyjk/9L3x7qmFdKHx2WaeXtkzERawMmLA/sH8cehRWfiRy4JNv4SncSNAeVf5 tqSXKb/xOByr5XLpQO/HeLLOqudjsIjJTEDaCy2UkJ2gn+79udbHYVg5fS4izvj8WzK2 Wlpw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of felix.moessbauer@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=felix.moessbauer@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id b39si561788ljr.1.2021.04.27.02.28.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Apr 2021 02:28:50 -0700 (PDT) Received-SPF: pass (google.com: domain of felix.moessbauer@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id 13R9Snsh027402 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Apr 2021 11:28:49 +0200 Received: from MD1T0KAC-VM.ad001.siemens.net (md1t0kac.ad001.siemens.net [139.25.0.7]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 13R9P5qa006138; Tue, 27 Apr 2021 11:25:12 +0200 From: Felix Moessbauer To: isar-users@googlegroups.com, amikan@ilbers.de, jan.kiszka@siemens.com Cc: henning.schild@siemens.com, Felix Moessbauer Subject: [PATCH v2 1/2] RFC: Package perf from linux kernel tools Date: Tue, 27 Apr 2021 11:24:57 +0200 Message-Id: <20210427092458.4261-2-felix.moessbauer@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <4d3f03d0-817a-4815-1a37-ce91388463ab@ilbers.de> References: <4d3f03d0-817a-4815-1a37-ce91388463ab@ilbers.de> 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 194.138.37.39 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?1698185328050563928?= X-GMAIL-MSGID: =?utf-8?q?1698185328050563928?= This patch adds the linux-perf- 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__" (in the tools-perf-python.patch). As this debianization is not part of the kernel recipe, 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. Signed-off-by: Felix Moessbauer --- .../linux-perf/debian/control.tmpl | 45 ++++++ .../recipes-kernel/linux-perf/debian/rules | 59 ++++++++ .../files/4.19/tools-perf-install.patch | 58 ++++++++ .../files/4.19/tools-perf-python.patch | 55 ++++++++ .../files/4.19/tools-perf-version.patch | 119 ++++++++++++++++ .../files/5.10/tools-perf-install.patch | 52 +++++++ .../files/5.10/tools-perf-python.patch | 56 ++++++++ .../files/5.10/tools-perf-version.patch | 128 ++++++++++++++++++ .../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 | 15 ++ .../linux-perf/linux-perf-5.10_5.10.26.bb | 15 ++ .../recipes-kernel/linux-perf/linux-perf.inc | 47 +++++++ 15 files changed, 934 insertions(+) create mode 100644 meta-isar/recipes-kernel/linux-perf/debian/control.tmpl create mode 100644 meta-isar/recipes-kernel/linux-perf/debian/rules create mode 100644 meta-isar/recipes-kernel/linux-perf/files/4.19/tools-perf-install.patch create mode 100644 meta-isar/recipes-kernel/linux-perf/files/4.19/tools-perf-python.patch create mode 100644 meta-isar/recipes-kernel/linux-perf/files/4.19/tools-perf-version.patch create mode 100644 meta-isar/recipes-kernel/linux-perf/files/5.10/tools-perf-install.patch create mode 100644 meta-isar/recipes-kernel/linux-perf/files/5.10/tools-perf-python.patch create mode 100644 meta-isar/recipes-kernel/linux-perf/files/5.10/tools-perf-version.patch 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-5.10_5.10.26.bb create mode 100644 meta-isar/recipes-kernel/linux-perf/linux-perf.inc diff --git a/meta-isar/recipes-kernel/linux-perf/debian/control.tmpl b/meta-isar/recipes-kernel/linux-perf/debian/control.tmpl new file mode 100644 index 0000000..e204437 --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/debian/control.tmpl @@ -0,0 +1,45 @@ +Source: linux-perf-${KERNEL_PERF_COMPAT} +Maintainer: ${MAINTAINER} +Priority: optional +Build-Profiles: +Section: devel +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, + +Package: linux-perf-${KERNEL_PERF_COMPAT} +Architecture: alpha amd64 arm64 armel armhf hppa i386 mips mips64 mips64el mipsel mipsn32 mipsn32el mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el powerpc ppc64 ppc64el riscv64 s390 s390x sh4 sparc sparc64 +Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, ${python3:Depends} +Recommends: linux-base +Provides: linux-tools-${KERNEL_PERF_COMPAT} +Conflicts: linux-tools-${KERNEL_PERF_COMPAT} +Replaces: linux-tools-${KERNEL_PERF_COMPAT} +Suggests: linux-doc-${KERNEL_PERF_COMPAT} +Description: Performance analysis tools for Linux ${KERNEL_PERF_COMPAT} + This package contains the 'perf' performance analysis tools for Linux + kernel version ${KERNEL_PERF_COMPAT}. + . + The linux-base package contains a 'perf' command which will invoke the + appropriate version for the running kernel. + + +Package: linux-perf +Build-Profiles: +Architecture: alpha amd64 arm64 armel armhf hppa i386 mips mips64 mips64el mipsel mipsn32 mipsn32el mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el powerpc ppc64 ppc64el riscv64 s390 s390x sh4 sparc sparc64 +Depends: linux-perf-${KERNEL_PERF_COMPAT} (= ${binary:Version}), ${misc:Depends} +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. diff --git a/meta-isar/recipes-kernel/linux-perf/debian/rules b/meta-isar/recipes-kernel/linux-perf/debian/rules new file mode 100644 index 0000000..b21876e --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/debian/rules @@ -0,0 +1,59 @@ +#!/usr/bin/make -f +# Note: this ruleset is based on the Makefile +# that is used for building the linux-perf- +# package in debian + +VERSION ?= $(KERNEL_PERF_COMPAT) +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 + + # do not ship python2 script + rm -f $(DESTDIR)/usr/lib/perf_$(VERSION)-core/scripts/python/call-graph-from-sql.py + + # Check for unversioned files that are likely to result in file conflicts + cd $(DESTDIR) && ! find \! -type d \! -path '*[_-]$(VERS_PATTERN)*' | grep . + +override_dh_shlibdeps: + dh_shlibdeps -Xperf-read-vdso + +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/4.19/tools-perf-install.patch b/meta-isar/recipes-kernel/linux-perf/files/4.19/tools-perf-install.patch new file mode 100644 index 0000000..8cfd02a --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/files/4.19/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/4.19/tools-perf-python.patch b/meta-isar/recipes-kernel/linux-perf/files/4.19/tools-perf-python.patch new file mode 100644 index 0000000..5770d9f --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/files/4.19/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/4.19/tools-perf-version.patch b/meta-isar/recipes-kernel/linux-perf/files/4.19/tools-perf-version.patch new file mode 100644 index 0000000..6833bb7 --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/files/4.19/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/files/5.10/tools-perf-install.patch b/meta-isar/recipes-kernel/linux-perf/files/5.10/tools-perf-install.patch new file mode 100644 index 0000000..b25bd25 --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/files/5.10/tools-perf-install.patch @@ -0,0 +1,52 @@ +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] +--- + tools/perf/Makefile.perf | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +--- a/tools/perf/Makefile.perf ++++ b/tools/perf/Makefile.perf +@@ -952,8 +952,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 +@@ -967,22 +967,22 @@ 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_$(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) tests/pe-file.exe* '$(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/5.10/tools-perf-python.patch b/meta-isar/recipes-kernel/linux-perf/files/5.10/tools-perf-python.patch new file mode 100644 index 0000000..205ec19 --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/files/5.10/tools-perf-python.patch @@ -0,0 +1,56 @@ +--- a/tools/perf/Makefile.perf ++++ b/tools/perf/Makefile.perf +@@ -982,10 +982,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/python.c ++++ b/tools/perf/util/python.c +@@ -110,7 +110,7 @@ + #if PY_MAJOR_VERSION < 3 + PyMODINIT_FUNC initperf(void); + #else +-PyMODINIT_FUNC PyInit_perf(void); ++PyMODINIT_FUNC PyInit_perf_5_10(void); + #endif + + #define member_def(type, member, ptype, help) \ +@@ -1303,7 +1303,7 @@ + #if PY_MAJOR_VERSION < 3 + PyMODINIT_FUNC initperf(void) + #else +-PyMODINIT_FUNC PyInit_perf(void) ++PyMODINIT_FUNC PyInit_perf_5_10(void) + #endif + { + PyObject *obj; +--- a/tools/perf/util/setup.py ++++ b/tools/perf/util/setup.py +@@ -66,7 +66,7 @@ + if '-DHAVE_LIBCAP_SUPPORT' in cflags: + extra_libraries += [ 'cap' ] + +-perf = Extension('perf', ++perf = Extension('perf_5_10', + sources = ext_sources, + include_dirs = ['util/include'], + libraries = extra_libraries, +@@ -74,7 +74,7 @@ + extra_objects = [libtraceevent, libapikfs, libperf], + ) + +-setup(name='perf', ++setup(name='perf_5_10', + version='0.1', + description='Interface with the Linux profiling infrastructure', + author='Arnaldo Carvalho de Melo', diff --git a/meta-isar/recipes-kernel/linux-perf/files/5.10/tools-perf-version.patch b/meta-isar/recipes-kernel/linux-perf/files/5.10/tools-perf-version.patch new file mode 100644 index 0000000..ccc2883 --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/files/5.10/tools-perf-version.patch @@ -0,0 +1,128 @@ +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.] +--- + tools/perf/Documentation/Makefile | 14 ++++++++------ + tools/perf/Makefile.perf | 16 ++++++++-------- + tools/perf/util/Build | 1 + + tools/perf/util/vdso.c | 4 ++-- + 4 files changed, 19 insertions(+), 16 deletions(-) + +diff --git a/tools/perf/Documentation/Makefile b/tools/perf/Documentation/Makefile +index 6e54979c2124..db2cb7669da1 100644 +--- a/tools/perf/Documentation/Makefile ++++ b/tools/perf/Documentation/Makefile +@@ -195,14 +195,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 + +diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf +index 86dbb51bb272..ed69643c3249 100644 +--- a/tools/perf/Makefile.perf ++++ b/tools/perf/Makefile.perf +@@ -888,23 +888,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'; \ +@@ -942,7 +942,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)' +@@ -967,7 +967,7 @@ install-python_ext: + + # 'make install-doc' should call 'make -C Documentation install' + $(INSTALL_DOC_TARGETS): +- $(Q)$(MAKE) -C $(DOC_DIR) O=$(OUTPUT) $(@:-doc=) ASCIIDOC_EXTRA=$(ASCIIDOC_EXTRA) ++ $(Q)$(MAKE) -C $(DOC_DIR) O=$(OUTPUT) $(@:-doc=) ASCIIDOC_EXTRA=$(ASCIIDOC_EXTRA) VERSION=$(VERSION) + + ### Cleaning rules + +diff --git a/tools/perf/util/Build b/tools/perf/util/Build +index 8d18380ecd10..5dd0f6c387b3 100644 +--- a/tools/perf/util/Build ++++ b/tools/perf/util/Build +@@ -234,6 +234,7 @@ CFLAGS_hweight.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ET + CFLAGS_parse-events.o += -Wno-redundant-decls + CFLAGS_expr.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) +diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c +index 3cc91ad048ea..e7483388bb5d 100644 +--- a/tools/perf/util/vdso.c ++++ b/tools/perf/util/vdso.c +@@ -55,12 +55,12 @@ static struct vdso_info *vdso_info__new(void) + .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 + }; +-- +2.27.0 + 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..638741c --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/linux-perf-4.19_4.19.160.bb @@ -0,0 +1,15 @@ +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2021 +# +# SPDX-License-Identifier: MIT +KERNEL_PERF_COMPAT = "4.19" + +SRC_URI += " \ + https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-${PV}.tar.xz \ + file://4.19/tools-perf-version.patch; \ + file://4.19/tools-perf-install.patch; \ + file://4.19/tools-perf-python.patch; \ +" +SRC_URI[sha256sum] = "18345206f9c61e8adafa5204d0ca0b8619f1d9aafd70cbd5cb0fbf1faf521585" + +require recipes-kernel/linux-perf/linux-perf.inc diff --git a/meta-isar/recipes-kernel/linux-perf/linux-perf-5.10_5.10.26.bb b/meta-isar/recipes-kernel/linux-perf/linux-perf-5.10_5.10.26.bb new file mode 100644 index 0000000..d49b5fd --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/linux-perf-5.10_5.10.26.bb @@ -0,0 +1,15 @@ +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2021 +# +# SPDX-License-Identifier: MIT +KERNEL_PERF_COMPAT = "5.10" + +SRC_URI += " \ + https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-${PV}.tar.xz \ + file://5.10/tools-perf-version.patch; \ + file://5.10/tools-perf-install.patch; \ + file://5.10/tools-perf-python.patch; \ +" +SRC_URI[sha256sum] = "fc532833f1ac167f363f1b9de85db39d2d635ab516f66dc381bdd70804601482" + +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..8f426ad --- /dev/null +++ b/meta-isar/recipes-kernel/linux-perf/linux-perf.inc @@ -0,0 +1,47 @@ +# Kernel specific linux-perf- package +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2021 +# +# SPDX-License-Identifier: MIT +# +# This recipe packages the perf tools independently +# of the kernel build. By that, it is possible to +# patch the perf package while still using an upstream kernel +# +# To build perf for a new (upstream) kernel, include this +# recipe in a file "linux-perf-_". +# E.g. linux-perf-5.10_5.10.13 +# In this recipe, set SRC_URI to the kernel sources and add your patches +# +# Note: only major and minor versions of the kernel have to match, +# the patch level should be irrelevant. + +inherit dpkg + +MAINTAINER ?= "Felix Moessbauer " +CHANGELOG_V ?= "${PV}+rtcloud" + +SRC_URI += " \ + file://debian \ +" +S = "${WORKDIR}/linux-${PV}" + +TEMPLATE_FILES += "debian/control.tmpl" +TEMPLATE_VARS += "KERNEL_PERF_COMPAT" + +do_prepare_build[cleandirs] += "${S}/debian" + +do_prepare_build() { + deb_debianize + cp ${WORKDIR}/debian/control ${S}/debian/ + cp ${WORKDIR}/debian/rules ${S}/debian/ + echo "native" > ${S}/debian/source + echo "debian/binarypackage/usr /" > ${S}/debian/linux-perf-${KERNEL_PERF_COMPAT}.install + deb_add_changelog +} + +dpkg_runbuild_prepend() { + export DEB_BUILD_OPTIONS="nocheck" + export KERNEL_PERF_COMPAT="${KERNEL_PERF_COMPAT}" +} From patchwork Tue Apr 27 01:24: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: 456 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:e7c8:0:0:0:0:0 with SMTP id y8csp2325690oov; Tue, 27 Apr 2021 02:25:15 -0700 (PDT) X-Received: by 2002:a5d:6d0f:: with SMTP id e15mr28912643wrq.302.1619515514915; Tue, 27 Apr 2021 02:25:14 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1619515514; cv=pass; d=google.com; s=arc-20160816; b=yXulsu6ukDRbXghWx5L4tLdjG54SZzeqMcKHsM36oGF8m0mmEZk9pZf3Xg+vZsMs86 i6fiSKs8cB73ZjJjxxL7hNJKVVQ7tCBPV0t33+pybl09UuGK9ziGDuYvJEihy6e/C+RC XsOCtL8nhkBcu+usnkbZcUAgefDMgQuZ8WDFKS/nODp0l+txicGTrNqZQGRxxfVMvqsn 9g9CHDwZ1b2kFEvHAbDwygsXk6ukZdc1dS55Fan8l1e4tCJ9v5xAcua3SqeYtQzzDkJ1 W9I+RRlIqesOYMp8ohSP1ODucID4nlzPdSRffRPnK9kXFpQ6RHy21lpR6NiDubd1FTac xgyw== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=K2Ix+C4DqEGHiN/qiNRZO4qt52yZGFK5ApxDZ5OhquQ=; b=J6cD7FoGrC8jSMpmrFEhZfYVZDAj7pVg0vFac9moxiNUj/B6Ej999CCn5dzszGCBf6 +2qnK3lxe0PgZnoHIT0Bo/nPsdfTGUaH7S0MYZ5+PjacDLMemu2nqMRyseC/saSqEo0M B7qtPMr4//sFX4/dYhEurrEfkxf5Ty8Ie4TlK85MlrdAoJ52X97yaM24tVgJ2zrzwLv5 D2QV4vVFNSUjG7zlgo30w9gNXsKUzUtLDD9N4tzuPf6bDAz4XMtfhyRqgjnef+thI/8q 1kPZcReRpAkrA46qt+TOue4MnIjBX7ILGqFFwPWxgIiGaT0Ogr7V7BnEWyLlnxJBhe0c XqYQ== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b="qwLH/MCI"; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbczk33mgwucrb6vqt6camgqev2lkwfy@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCZK33MGWUCRB6VQT6CAMGQEV2LKWFY@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 x16sor3247925wrp.31.2021.04.27.02.25.14 (Google Transport Security); Tue, 27 Apr 2021 02:25:14 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbczk33mgwucrb6vqt6camgqev2lkwfy@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="qwLH/MCI"; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbczk33mgwucrb6vqt6camgqev2lkwfy@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCZK33MGWUCRB6VQT6CAMGQEV2LKWFY@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com ARC-Seal: i=2; a=rsa-sha256; t=1619515514; cv=pass; d=google.com; s=arc-20160816; b=F1iQuY0VNDFgpDQe80iKYRhY+eKf/hjgRv90dRGRxTit1y8ghN7+fM4aI9R6X94shG t0tviy7Q5a5ND/BjEMo8LoqWme/FonqzXPyXkU7IFy817W6aXmJ/CebFRzxSIGe9ioHJ Get3IOX06JVAiIwaqDrJogeOcSLiU2mP8iP+yvtG3VbAySLSP9tNqznwyFFpP9cQdNNt wTR1zBy1m0jp293CWF4oZZr+6w+NGzLAqu3VCIhcVoJCXpGxoBuoMUPP8SAjw5kWJsA4 a2MynugikpiKm30Acjv0OE7Zh+CKelYtw6D6kOej2mdhXQbG5lqV/CT/7BXM6tq0nrQM 9ANA== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=K2Ix+C4DqEGHiN/qiNRZO4qt52yZGFK5ApxDZ5OhquQ=; b=JXRj9S0mY2UeosQGJTsMisvfhJsxKzNtjsIFTK2kH+WiwoPfhNadu1wXz13FabDeZM 3JWN7bgbnEUssrOpxGaWAAVAyd19PkkqUXZjgoxvI2cUDqpBx60IgBmNQgRatroI3B92 L5BdSz2S7NHk6SguXVavgk/AFvtc2ACC8A84bbo28RTtisdG1OvaV1BGhQOMHFt6+OdG qfp9uGFYBWOrhsr4+BiasPAVm9sbJV5jgmHe1H6XMF0KnnstXmJYHV/xued8BqJvXUTf no4iHzTSsqqkaraeMGr4czWYICa6j5CVCG0g4VFMDtq2xmE9pfimV43xOtDSEbxycGc5 ivzw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of felix.moessbauer@siemens.com designates 194.138.37.40 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:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=K2Ix+C4DqEGHiN/qiNRZO4qt52yZGFK5ApxDZ5OhquQ=; b=qwLH/MCIZE03VBtPihUJckwEJlXuNtZl79qEqIw97RHkLLKeKyxQxChZPOGwyARo/V Bdpr3rGSvZ3uQEinZB6BH/6qN3f+FgOiWFVsJKvAHxb4r0bu8WEZsZOM9akXCDjN9Vv2 gbTJ4Hrx52lTnw14iWArvWWhcGLurBwb6QovFYKaqfWicoDwbvNAqlnjGsiR/tmvCCcg 1X4/UOgQgm6kFm/yg8YwQl3J4lUXPzFFG+CCm9MjJKueiyy80uJKJJ0Vma27uqxR0Q45 yTMRXm1t2q0pHEOG2EROu8cjn5CpGJPJokQsG7lnLrMqXU1xUnV1W8/lZaiY7rwjbbyV usAA== 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: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=K2Ix+C4DqEGHiN/qiNRZO4qt52yZGFK5ApxDZ5OhquQ=; b=Rl+5LXTgmHxIzAUWVljum1+ZQQrTg8/de0bOhASR8peCfMeo4y5mKk2uxNellK+nQj CgyyYYRxPHshy9gjt8h4mBA2MByfIqDTrjzxsevM9w6MVfNA1CrUbwpqxvb4gFjK1TOq ktqtKI+Yv80wW14S0nLFJR87P99A4JmSGwZjyyyuXaqq7cJfF7I8VxXugwSipdzfU31s yMBf+wd7u0V1mDEEQbXGr+3+VoJbau2xzT+UfG07FXEp67W0/UibKWU9XweqiI3QWCwC LGKSjIeprvBL0PyEdTwbXrTWODi757Hcxku1cBJrqXou1jh9BL3fcNZWdMHUeE7Fmakd Vi/w== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM533i33JiJgo8xeHuwwu4nm3sdaunHNeO/OlHGIjey1WjqwH4xVb3 OUi1ufwtw0DkksaVCS5dc5A= X-Google-Smtp-Source: ABdhPJxyZhXr7rGErLPXreesiah0AVcElMqIqir+Dx3t/SAqT9Xfip4Ra6EB5qJlc5hCvDG7edjmzw== X-Received: by 2002:adf:fecd:: with SMTP id q13mr28000225wrs.7.1619515514288; Tue, 27 Apr 2021 02:25:14 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:fb47:: with SMTP id c7ls5173306wrs.0.gmail; Tue, 27 Apr 2021 02:25:13 -0700 (PDT) X-Received: by 2002:adf:9042:: with SMTP id h60mr28038644wrh.362.1619515513603; Tue, 27 Apr 2021 02:25:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619515513; cv=none; d=google.com; s=arc-20160816; b=gNZLsv8Zhn70qSJX4O22HD1jP3yxbx2hLV8uBgPRcN92RbAPjW0FyFER5Ka4veqMZD 3ZU5Bx8QmVymQp9iQ9N3X2V2pho/12ZKi3TcUwPUGceaFnCcA3uPGd51AO1f8smNKaKV bcCmkcanGB8dwN9qAVXeFq0bgGg23l78/Vh+2URu63i4kL6rbL8IrsUajphVcaGo0p1o DCGUT1ZyTZzozq70BxDqd/9BceC67SsCQRtDG+b6gvhtMeI7IGnWyaUO1pLLQ9MY+Rnm kRJ8W9YlBxGQRd49fdrjWDjH6bES5PcP3usgYlBGy+av6883Rz/cSROOo61tiZ7LQxrJ 37cw== 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=nIzFCX2XAvu0K+mTL79TxuwLFkbWdHbTPwvabLmd8sA=; b=mtUjqhDTKJ0a1DB7tqNMG4Rhudxli5YZEpoD5KGfgd4ASKlkyynFk3hjHi70AfZBWp negjNeDuReJVCPiC3a3ejoT3Picfws6INgg1+mp1oRhSSTG8lJJIUcv/fe33oIg1ia5x l/kIufzOP08f6VZF8n/R967cN+iNhq7p3yA4WjgoKrycVrXIKWd8JqH9MUg3x4AsfIO7 yXuI1Q7V/LLL5qYOLALmHQ+IKqRhpmEzYyZk6IXKLYAVxu7oebSHYSNDbaSYV4ECdSa2 jRmysxAIbZQENVDdB5/923wyjbA0fWdyag/NDt3qcLnQBnrchyjgnJgExzVOj3ERRWI7 Wpmg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of felix.moessbauer@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=felix.moessbauer@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id p65si132360wmp.0.2021.04.27.02.25.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Apr 2021 02:25:13 -0700 (PDT) Received-SPF: pass (google.com: domain of felix.moessbauer@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 13R9PCaV024649 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Apr 2021 11:25:13 +0200 Received: from MD1T0KAC-VM.ad001.siemens.net (md1t0kac.ad001.siemens.net [139.25.0.7]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 13R9P5qb006138; Tue, 27 Apr 2021 11:25:12 +0200 From: Felix Moessbauer To: isar-users@googlegroups.com, amikan@ilbers.de, jan.kiszka@siemens.com Cc: henning.schild@siemens.com, Felix Moessbauer Subject: [PATCH v2 2/2] Add wrapper to load correct python perf module based on kernel Date: Tue, 27 Apr 2021 11:24:58 +0200 Message-Id: <20210427092458.4261-3-felix.moessbauer@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <4d3f03d0-817a-4815-1a37-ce91388463ab@ilbers.de> References: <4d3f03d0-817a-4815-1a37-ce91388463ab@ilbers.de> 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 194.138.37.40 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?1698185100715651108?= X-GMAIL-MSGID: =?utf-8?q?1698185100715651108?= This patch adds a wrapper around the versioned python bindings of perf. The wrapper takes care of detecting the current kernel version and loading the perf_ module. Then, it mapps this module to just perf, so downstream python modules just have to `import perf` instead of the versioned version. Signed-off-by: Felix Moessbauer --- .../files/debian/linux-base.install | 6 +++++ .../files/lib/python3/dist-packages/perf.py | 23 +++++++++++++++++ .../recipes-core/linux-base/linux-base_4.6.bb | 25 +++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 meta-isar/recipes-core/linux-base/files/debian/linux-base.install create mode 100644 meta-isar/recipes-core/linux-base/files/lib/python3/dist-packages/perf.py create mode 100644 meta-isar/recipes-core/linux-base/linux-base_4.6.bb diff --git a/meta-isar/recipes-core/linux-base/files/debian/linux-base.install b/meta-isar/recipes-core/linux-base/files/debian/linux-base.install new file mode 100644 index 0000000..b94175d --- /dev/null +++ b/meta-isar/recipes-core/linux-base/files/debian/linux-base.install @@ -0,0 +1,6 @@ +bin/linux-check-removal usr/bin +bin/linux-update-symlinks usr/bin +bin/linux-version usr/bin +bin/perf usr/bin +lib/DebianLinux.pm usr/share/perl5 +lib/python3/dist-packages/perf.py usr/lib/python3/dist-packages/ diff --git a/meta-isar/recipes-core/linux-base/files/lib/python3/dist-packages/perf.py b/meta-isar/recipes-core/linux-base/files/lib/python3/dist-packages/perf.py new file mode 100644 index 0000000..26d3e81 --- /dev/null +++ b/meta-isar/recipes-core/linux-base/files/lib/python3/dist-packages/perf.py @@ -0,0 +1,23 @@ +#!/usr/bin/python3 +# Wrapper to load the kernel-specific version +# of the python perf module + +import platform + +uname = platform.uname().release +kvers = uname.split('.') + +if len(kvers) < 2: + raise RuntimeError('Could not detect kernel version in: {}'.format(kvers)) +try: + perf = __import__('perf_{}_{}'.format(kvers[0], kvers[1])) + symbols = [symbol for symbol in perf.__dict__ if not symbol.startswith("_")] + globals().update({symbol: getattr(perf, symbol) for symbol in symbols}) + del perf + del symbols +except ModuleNotFoundError: + raise ModuleNotFoundError('perf package not found. Install debian package linux-perf-{}.{}'.format(kvers[0],kvers[1])) + +del platform +del uname +del kvers diff --git a/meta-isar/recipes-core/linux-base/linux-base_4.6.bb b/meta-isar/recipes-core/linux-base/linux-base_4.6.bb new file mode 100644 index 0000000..178e4cb --- /dev/null +++ b/meta-isar/recipes-core/linux-base/linux-base_4.6.bb @@ -0,0 +1,25 @@ +# Patched version of linux-base that includes perf python wrapper +# +# This software is a part of ISAR. +# Copyright (c) Siemens AG, 2021 +# +# SPDX-License-Identifier: MIT + +inherit dpkg + +SRC_URI = " \ + apt://${PN} \ + file://lib/python3/dist-packages/perf.py \ + file://debian/linux-base.install \ + " + +MAINTAINER ?= "isar-users " +CHANGELOG_V ?= "+isar" + +do_prepare_build() { + mkdir -p ${S}/lib/python3/dist-packages + cp -r ${WORKDIR}/lib ${S} + cp -r ${WORKDIR}/debian ${S} + cd ${S} + deb_add_changelog +}