From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6890474322769477632 X-Received: by 2002:a17:906:4bc2:: with SMTP id x2mr2113928ejv.525.1604669905370; Fri, 06 Nov 2020 05:38:25 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:c04e:: with SMTP id k14ls660372edo.1.gmail; Fri, 06 Nov 2020 05:38:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyejyIzOiUgsAKMOHcOnPP2BYJ4v4g7aALmpO5wcy57CCjNMz4RT2fP2taXpo6lQPhoFkn2 X-Received: by 2002:aa7:d3c3:: with SMTP id o3mr2091500edr.319.1604669904310; Fri, 06 Nov 2020 05:38:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604669904; cv=none; d=google.com; s=arc-20160816; b=nR4vBfIyuLe0guKJkL/1CDNfmiKEOEdrtS41TXN/c7iWDmsjvbHwH2vITuDVld7bFg gbshawMKQMM7QyoNV4L63HZykN73r4A/gjxasDgtddKVzbXSnmrFx+iVMXnBAks0Dh2O qni5lBG+sXjq3Fv6LtM33FNBsxYwZjuV/pUHgBQxjOALBj05ejNy454EvRhV+INDj319 aH3bu9jkfCfP2Iw0uJzqdPvIGnXl0O0D0sM69QjfEXAZqhuyBdUGIX8/s6P/kar++hBt QHf4H/suucwZdZxa42cFJsS5bOUqHwfWIyed62c2pZ1Cack8VTTWmlUyDPVTrIOXKz6S YVvQ== 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:subject:cc:to:from:date; bh=4FCRuEnwDKE1OGaudKUa9+pHyZBubHf1Njl6sxurycc=; b=TYucJnrdcJMqqmJfRbN2ZtS8HGPyOb03/Faf/d47EK5/ZGg8C2qvOcBNX3SycijPFl fYsm9k7AQ1glwChvslG+NFncl4xyD2dq114cHtME38fMoUJslkWeKZFL2/Wh4lblsqSD 1fNHTbfv/x/faqb6AlcpW2GapWCwjGngb5OvQkOW0NbSxtZADm39gpfVNBnHhPC1H9sZ dzSruS5R9GqPCkfv6JwWDgnFiyAXxivwxWrA/0SfhattyY2dxBTk5fCe3NgJQzoWwNaI POLR8Z8osmdsgZsejPWBxUdtxWdwVDksp2noaMi3GtmAUgYiSGk0aNk7pmJEp271WkLQ BdbA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id v21si34614edd.4.2020.11.06.05.38.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Nov 2020 05:38:24 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id 0A6DcNaS006277 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 6 Nov 2020 14:38:23 +0100 Received: from md1za8fc.ad001.siemens.net ([139.22.116.104]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 0A6DcMdd003204; Fri, 6 Nov 2020 14:38:23 +0100 Date: Fri, 6 Nov 2020 14:38:21 +0100 From: Henning Schild To: "vijaikumar....@gmail.com" Cc: isar-users Subject: Re: [PATCH v4] Add recipe for linux kselftest Message-ID: <20201106143821.6ac5acc8@md1za8fc.ad001.siemens.net> In-Reply-To: References: <20201102072511.26675-1-Vijaikumar_Kanagarajan@mentor.com> <20201104214447.25133bb0@md1za8fc.ad001.siemens.net> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: 6IBp/Dw+TzW7 Am Wed, 4 Nov 2020 22:17:29 -0800 (PST) schrieb "vijaikumar....@gmail.com" : > On Thursday, November 5, 2020 at 2:14:50 AM UTC+5:30 Henning Schild > wrote: > > > Did not follow the thread and coming late to the table. Did anyone > > consider pushing this upstream into the kernel? > > > > No. Atleast, I did not try it. Ok, we already have other tools like perf and the kernel does not seem to like debianizations in its tree. Henning > > > > > For the kernel itself we eventually failed. But because it turned > > out to be too complicated to find a generic debianization that fits > > all the needs. For a tool it might be a different story. > > > > Henning > > > > Am Mon, 2 Nov 2020 12:55:11 +0530 > > schrieb Vijai Kumar K : > > > > > Kselftest is a set of unit and regression tests under the > > > tools/testing/selftests/ directory of the Linux kernel. These are > > > used for testing individual code paths in the kernel. > > > > > > Kselftest is not debianized and is not available as part of the > > > official Debian repository. > > > > > > This patch provides a recipe to build kselftest from the linux > > > source of your choice. > > > > > > Sometimes developers/testers tend to use the latest version of > > > selftests from Linux upstream stable releases for testing and > > > hence the need for a separate recipe instead of being part of the > > > linux recipe of ISAR. > > > > > > Some kselftest test cases build are known to break in certain > > > linux versions, this has to be addressed upstream. Right now > > > kselftest build succeeds even if atleast one of the testcase case > > > build succeeds. > > > > > > You can change that by setting KSELFTEST_FORCE_TARGETS=1. > > > > > > TARGETS, TARGETS_SKIP, FORCE_TARGETS can be set using the > > > appropriate KSELFTEST_* recipe variable. > > > > > > Signed-off-by: Vijai Kumar K > > > --- > > > Changes since v3: > > > - Remove libnuma-dev. Since it is not available in stretch. > > > - remove entry in isar-image-debug. Added to CI image using > > > IMAGE_INSTALL. > > > > > > Changes since v2: > > > - Use deb_debianize instead of individual calls for changelog, > > > compat & control. > > > - Add package to isar-image-debug > > > > > > Changes since v1: > > > - Addressed review comments in v1 > > > - Used debianize APIs for control, compat and changelog. > > > - Moved Depends & S definitions to include file. > > > - Added cross compilation bits in rules. > > > - Change clang, llvm to clang:native & llvm:native > > > > > > .../kselftest/kselftest_5.6.13.bb | 11 ++++ > > > meta/recipes-kernel/kselftest/files/rules | 41 +++++++++++++ > > > meta/recipes-kernel/kselftest/kselftest.inc | 58 > > > +++++++++++++++++++ scripts/ci_build.sh | > > > 1 + 4 files changed, 111 insertions(+) > > > create mode 100644 > > > meta-isar/recipes-kernel/kselftest/kselftest_5.6.13.bb create > > > mode 100755 meta/recipes-kernel/kselftest/files/rules create mode > > > 100644 meta/recipes-kernel/kselftest/kselftest.inc > > > > > > diff --git > > > a/meta-isar/recipes-kernel/kselftest/kselftest_5.6.13.bb > > > b/meta-isar/recipes-kernel/kselftest/kselftest_5.6.13.bb new file > > > mode 100644 index 0000000..0c9818a --- /dev/null > > > +++ b/meta-isar/recipes-kernel/kselftest/kselftest_5.6.13.bb > > > @@ -0,0 +1,11 @@ > > > +# Kselftest package > > > +# > > > +# This software is a part of ISAR. > > > +# Copyright (c) Mentor Graphics, a Siemens business, 2020 > > > +# > > > +# SPDX-License-Identifier: MIT > > > + > > > +require recipes-kernel/kselftest/kselftest.inc > > > + > > > +SRC_URI += > > > "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-${PV}.tar.xz" > > > +SRC_URI[sha256sum] = > > > "f125d79c8f6974213638787adcad6b575bbd35a05851802fd83f622ec18ff987" > > > diff --git a/meta/recipes-kernel/kselftest/files/rules > > > b/meta/recipes-kernel/kselftest/files/rules new file mode 100755 > > > index 0000000..776d341 --- /dev/null +++ > > > b/meta/recipes-kernel/kselftest/files/rules @@ -0,0 +1,41 @@ > > > +#!/usr/bin/make -f > > > + > > > +# Debian rules for Kselftest build > > > +# > > > +# This software is a part of ISAR. > > > +# Copyright (c) Mentor, A Siemens Business > > > +# > > > +# SPDX-License-Identifier: MIT > > > + > > > +deb_top_dir:=$(CURDIR)/debian > > > +kselftest_install_dir > > > :=$(deb_top_dir)/kselftest/usr/libexec/kselftest +export > > > CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)- + > > > +ifeq ($(DEB_HOST_GNU_CPU), arm) > > > +export ARCH=arm > > > +endif > > > +ifeq ($(DEB_HOST_GNU_CPU), aarch64) > > > +export ARCH=arm64 > > > +endif > > > +ifeq ($(DEB_HOST_GNU_CPU), riscv64) > > > +export ARCH=riscv > > > +endif > > > +ifneq (,$(findstring 86,$(DEB_HOST_GNU_CPU))) > > > +export ARCH=x86 > > > +endif > > > + > > > +PARALLEL_BUILD=-j $(shell echo $$(($$(nproc) * 2))) > > > + > > > +override_dh_auto_build: > > > + $(MAKE) defconfig > > > + $(MAKE) $(PARALLEL_BUILD) -C tools/testing/selftests/ > > > ${KSELFTEST_ARGS} + > > > +override_dh_auto_install: > > > + mkdir -p ${kselftest_install_dir} > > > + cd tools/testing/selftests/ && > > > KSFT_INSTALL_PATH=${kselftest_install_dir} $(MAKE) > > > $(PARALLEL_BUILD) install ${KSELFTEST_ARGS} + > > > +override_dh_auto_clean: > > > + rm -rf ${deb_top_dir}/kselftest/ > > > + > > > +%: > > > + CFLAGS= LDFLAGS= dh $@ --parallel > > > diff --git a/meta/recipes-kernel/kselftest/kselftest.inc > > > b/meta/recipes-kernel/kselftest/kselftest.inc new file mode > > > 100644 index 0000000..2a76028 > > > --- /dev/null > > > +++ b/meta/recipes-kernel/kselftest/kselftest.inc > > > @@ -0,0 +1,58 @@ > > > +# Kselftest package for Linux > > > +# > > > +# This software is a part of ISAR. > > > +# Copyright (c) Mentor Graphics, a Siemens Business, 2020 > > > +# > > > +# SPDX-License-Identifier: MIT > > > + > > > +inherit dpkg > > > + > > > +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" > > > + > > > +# Some test-cases like memfd compilation failed in > > > cross-compilation. +# Force native compilation for now to have > > > consistent output across +# ISAR native/cross compilation setups. > > > +ISAR_CROSS_COMPILE = "0" > > > + > > > +DESCRIPTION ?= "Kernel selftests from Linux kernel ${PV}" > > > + > > > +DEBIAN_BUILD_DEPENDS ?= " \ > > > + rsync, \ > > > + flex, \ > > > + bison, \ > > > + fuse, \ > > > + libelf-dev:native, \ > > > + libcap-ng-dev:native, \ > > > + libpopt-dev:native, \ > > > + libcap-dev:native, \ > > > + libmount-dev:native, \ > > > + libfuse-dev:native, \ > > > + libmnl-dev:native, \ > > > + pkg-config, \ > > > + clang:native, \ > > > + llvm:native, \ > > > +" > > > + > > > +SRC_URI += "file://rules" > > > +S = "${WORKDIR}/linux-${PV}" > > > + > > > +KSELFTEST_TARGETS ?= "" > > > +KSELFTEST_SKIP_TARGETS ?= "" > > > +KSELFTEST_FORCE_TARGETS ?= "0" > > > + > > > +do_prepare_build[cleandirs] += "${S}/debian" > > > +do_prepare_build() { > > > + deb_debianize > > > +} > > > + > > > +dpkg_runbuild_prepend() { > > > + if [ -n "${KSELFTEST_TARGETS}" ];then > > > + export KSELFTEST_ARGS="TARGETS=\"${KSELFTEST_TARGETS}\"" > > > + fi > > > + if [ ${KSELFTEST_FORCE_TARGETS} -eq 1 ];then > > > + export KSELFTEST_ARGS="${KSELFTEST_ARGS} FORCE_TARGETS=1" > > > + fi > > > + if [ -n "${KSELFTEST_SKIP_TARGETS}" ];then > > > + export KSELFTEST_ARGS="${KSELFTEST_ARGS} > > > SKIP_TARGETS=\"${KSELFTEST_SKIP_TARGETS}\"" > > > + fi > > > +} > > > diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh > > > index c0a032e..2d06543 100755 > > > --- a/scripts/ci_build.sh > > > +++ b/scripts/ci_build.sh > > > @@ -143,6 +143,7 @@ cat >>conf/local.conf < > > ISAR_ENABLE_COMPAT_ARCH_amd64 = "1" > > > ISAR_ENABLE_COMPAT_ARCH_arm64 = "1" > > > ISAR_ENABLE_COMPAT_ARCH_debian-stretch_amd64 = "0" > > > +IMAGE_INSTALL += "kselftest" > > > EOF > > > > > > if [ -n "$CROSS_BUILD" ]; then > > > > >