From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6919450737082630144 X-Received: by 2002:adf:f20b:: with SMTP id p11mr13326066wro.244.1619515729037; Tue, 27 Apr 2021 02:28:49 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:11:: with SMTP id g17ls9110072wmc.3.gmail; Tue, 27 Apr 2021 02:28:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCa8OWcpX8JPa6FQdrZix6TxIe4mIc+qq5dywcYTkQQwREUJxRjX7YLYWaPkAwvA3N5oLO X-Received: by 2002:a1c:4d17:: with SMTP id o23mr3298848wmh.102.1619515728222; Tue, 27 Apr 2021 02:28:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619515728; cv=none; d=google.com; s=arc-20160816; b=ZKqwzzWPfwQ+rsht+T94hi8aznVSGjWPsNb7utbJYG/JLsUzDz4oV8Bj/LI9Hs1DYP pVQorR2R2PZ4SX5TYq5PIcOnxC5M+RB+TK6WcQUbNuRNZFwvpVAzkMb3oBc09PicB1SK dqflPrm877v1Gc0I+n+slEunX7Xkwv0DpoDAJhD//5cwaPfNOcPNOOe78et6WKUzNiFf e3XpAhGm+EdCDMO/CxSbl1o3er/LyjOG7k6hfxD089ia69wUvO6xPPWnH93dk/K6V0An VDORNBYrCauSqNRh/lj2LlEi4BEe2sabbl5/eNnmUyYXqAI3zBDuiRMDdaome7V8yPlV GB0A== 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=P6lioub4YQ5PDwuIW3fcrggcbAMT4lOgxO4SE1C8fQI=; b=v8tzwrXrbRJRFmQ2M6eN3xidAdTdQkjRGpNNbXNETyJ2HBAmmMnMbsKgzxJXKMQ1Xp DdsSxhTA5W6f+/LzAgsz0wKu3kZ6e8qxk3CCcmtCWxEd+egMeoM/9bRBf2cRyPR2UFN1 nwc3v8BtAHYoNHCYPRyskT3gJnmIUKg5bX69byWnq26tGTJkaSkCSOQrtZxnsTtLd6hv Tg+lh4mtLxbvNYNzPEp4OtWg4K9HPXvbHkYEGIAsOamya8Vt6nvgKHrgQaQD8sy8kzC/ bIANYuBNq8IcY1/wg5ALOMbiNck91icvpY1wDZDTZEN0+mXX7PzmwBUTfnrvJD4uo1MF W1ag== 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 Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id s141si219715wme.2.2021.04.27.02.28.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Apr 2021 02:28:48 -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; 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 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 13R9Sl8m027373 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Apr 2021 11:28:47 +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 13R9P5qZ006138; Tue, 27 Apr 2021 11:25:05 +0200 From: Felix Moessbauer To: isar-users@googlegroups.com, amikan@ilbers.de, jan.kiszka@siemens.com Cc: henning.schild@siemens.com, Felix Moessbauer Subject: [RFC v2 0/2] package linux-perf- in kernel recipe Date: Tue, 27 Apr 2021 11:24:56 +0200 Message-Id: <20210427092458.4261-1-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 Content-Transfer-Encoding: 8bit X-TUID: NhcgWnMRKV5h Hi Anton, there has been some back and forth on how to package perf and its python bindings. IMO the out-of-tree packaging provides the most promising solution here, as the kernel versions do not have to match exactly. Also with debian bullseye things changed again, as an exact-version binding was introduced between linux-perf and linxu-perf-. By that, both have to be build from the same source package. Now, we build and provide that package as well. Our final goal for all the effort was to get the python bindings of perf packaged. These are missing in upstream debian. Unfortunately the kernel itself does not provide any hooks to inject the version "into" the python-binding c source files, so we have to use patches to inject the version into the c function names. I already sent that patch to debian but did not get a response yet. For details, see here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860957 Anyways, we run this patch series on a bunch of images for both debian-buster and debian-bullseye (both custom and debian kernels) for a while. In combination with the wrapper in patch 2, even things like `import perf` work flawlessly. Best regards, Felix Felix Moessbauer (2): RFC: Package perf from linux kernel tools Add wrapper to load correct python perf module based on kernel .../files/debian/linux-base.install | 6 + .../files/lib/python3/dist-packages/perf.py | 23 ++++ .../recipes-core/linux-base/linux-base_4.6.bb | 25 ++++ .../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 +++++++ 18 files changed, 988 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 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 -- 2.20.1