From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 948B4A0577; Wed, 15 Apr 2020 15:20:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ED7F31D701; Wed, 15 Apr 2020 15:20:02 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 164901D700 for ; Wed, 15 Apr 2020 15:20:01 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 993625C0165; Wed, 15 Apr 2020 09:20:00 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 15 Apr 2020 09:20:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=qMIFSitC9/ J/c61xxo3SytN2tDiOFzWaI6+PiOMiYik=; b=PhOiNIHL/eAgP0WqZiEa4DobEY 7b7S7lE+FYT6g+tvBJxTV6NKdyACgxQjx+6V3oXIZVF65v0yKriNU7osxlykl/wR a2z1to9p+pelwgGuMCo2fAsigMvPHk8AT8SQ2GeOjsXUx8LW8+BWDxy+4XtYqAkl rJEXWsEdgHg4dA+Gw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=qMIFSitC9/J/c61xxo3SytN2tDiOFzWaI6+PiOMiYik=; b=Cd4mLenh KJvFaHiMbn4V/0VeZEI0BG/IamyIzz8djIZC7K8dVnVqim0mbLn12yP0eUr7Wv/C rVVdJpN2/4CmEakBi84W0PRNQ7i75Gyq6QwabFsRftHpE+PCC1wkUVam+9OwlXPq eWB/bgzdYIGwh9khLHF3o1UlljedlmftE75JP5CrF9KchBkwdqWHiQJGb3ELuF+3 W59VZIxhaBHcPohsieGTxxqBRPmQT3DUtk7qkiWKxWRXwzNvBrCRMFtDqSuDSr8i ShDQMu16kmA2l6yjmvMChpYWcdONgoA/Dv50PA7qIp+JHjoTzGOU5XGs+Wylk5nN CDskwpmKAhTPNg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrfeefgdehudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id F3B473280060; Wed, 15 Apr 2020 09:19:58 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: bruce.richardson@intel.com, Lukasz Wojciechowski , Aaron Conole , Ruifeng Wang , David Marchand , Gavin Hu Date: Wed, 15 Apr 2020 15:19:54 +0200 Message-Id: <20200415131954.2006010-1-thomas@monjalon.net> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200409180332.592074-1-thomas@monjalon.net> References: <20200409180332.592074-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4] test: remove meson dependency on /proc file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Meson is detecting the path /proc/sys/vm/nr_hugepages in the call to cat in app/test/meson.build and then adding it as a build dependency. This causes build loop if the timestamp of this file keeps changing. It is fixed by hiding hugepage check in a shell script. Fixes: 77784ef0fba8 ("test: allow no-huge mode for fast-tests") Signed-off-by: Thomas Monjalon Tested-by: Lukasz Wojciechowski Reviewed-by: Lukasz Wojciechowski Acked-by: Aaron Conole Reviewed-by: Ruifeng Wang --- v2: use variable as pointed by Lukasz v3: avoid TOCTOU issue as suggested by David v4: remove Linux check in meson file and skip find_program() call --- MAINTAINERS | 1 + app/test/has-hugepage.sh | 9 +++++++++ app/test/meson.build | 10 +--------- 3 files changed, 11 insertions(+), 9 deletions(-) create mode 100755 app/test/has-hugepage.sh diff --git a/MAINTAINERS b/MAINTAINERS index 144cf5d8ea..fe59f0224f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1469,6 +1469,7 @@ F: app/test/Makefile F: app/test/autotest* F: app/test/commands.c F: app/test/get-coremask.sh +F: app/test/has-hugepage.sh F: app/test/packet_burst_generator.c F: app/test/packet_burst_generator.h F: app/test/process.h diff --git a/app/test/has-hugepage.sh b/app/test/has-hugepage.sh new file mode 100755 index 0000000000..865e66cddd --- /dev/null +++ b/app/test/has-hugepage.sh @@ -0,0 +1,9 @@ +#! /bin/sh +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020 Mellanox Technologies, Ltd + +if [ "$(uname)" = "Linux" ] ; then + cat /proc/sys/vm/nr_hugepages || echo 0 +else + echo 0 +fi diff --git a/app/test/meson.build b/app/test/meson.build index 777c536ae0..04b59cffa4 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -396,15 +396,7 @@ dpdk_test = executable('dpdk-test', install_rpath: driver_install_path, install: true) -has_hugepage = true -if is_linux - check_hugepage = run_command('cat', - '/proc/sys/vm/nr_hugepages') - if (check_hugepage.returncode() != 0 or - check_hugepage.stdout().strip() == '0') - has_hugepage = false - endif -endif +has_hugepage = run_command('has-hugepage.sh').stdout().strip() != '0' message('hugepage availability: @0@'.format(has_hugepage)) # some perf tests (eg: memcpy perf autotest)take very long -- 2.26.0