From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 0FB61A0597;
	Thu,  9 Apr 2020 20:58:49 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 76B8D1D157;
	Thu,  9 Apr 2020 20:58:48 +0200 (CEST)
Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com
 [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 424221D146
 for <dev@dpdk.org>; Thu,  9 Apr 2020 20:58:46 +0200 (CEST)
Received: from eucas1p1.samsung.com (unknown [182.198.249.206])
 by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id
 20200409185846euoutp02f4fdf89c9c657ec0b742b3dc821786f7~EO85WLWpg2548325483euoutp02e
 for <dev@dpdk.org>; Thu,  9 Apr 2020 18:58:46 +0000 (GMT)
DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com
 20200409185846euoutp02f4fdf89c9c657ec0b742b3dc821786f7~EO85WLWpg2548325483euoutp02e
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com;
 s=mail20170921; t=1586458726;
 bh=fJkXREvATFuxB5mc2M1z4eoQdXbg1oogO1A2aKM4Vm8=;
 h=Subject:To:Cc:From:Date:In-Reply-To:References:From;
 b=pUvI+dop40a+yao29bGhOz8Z44viVbmEaxsny1z2uuJLC9xKqdl2KIp01BxAAoSd4
 0PrzkLZodAAT8BK0+albthqqA7Hw06LPbPCm8WxUhZ2G4Dp1IQiH+dNEg8iThwl55b
 nU77Y0fczDty1HRwRDUt9+CqhyTIO7uBMvlm4RjQ=
Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by
 eucas1p2.samsung.com (KnoxPortal) with ESMTP id
 20200409185845eucas1p23fba50e68875ca5d05ca98be228a777b~EO85JDOu53133531335eucas1p20;
 Thu,  9 Apr 2020 18:58:45 +0000 (GMT)
Received: from eucas1p1.samsung.com ( [182.198.249.206]) by
 eusmges2new.samsung.com (EUCPMTA) with SMTP id 96.F2.60679.5607F8E5; Thu,  9
 Apr 2020 19:58:45 +0100 (BST)
Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by
 eucas1p1.samsung.com (KnoxPortal) with ESMTPA id
 20200409185845eucas1p128808ed98ed5ddb00da5295c2ef60ee1~EO84WuLOg1269812698eucas1p1j;
 Thu,  9 Apr 2020 18:58:45 +0000 (GMT)
Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by
 eusmtrp1.samsung.com (KnoxPortal) with ESMTP id
 20200409185845eusmtrp1aad288feb4ae9a5095185e2f9e72a228~EO84WJX452012620126eusmtrp1c;
 Thu,  9 Apr 2020 18:58:45 +0000 (GMT)
X-AuditID: cbfec7f4-0cbff7000001ed07-02-5e8f70658d89
Received: from eusmtip1.samsung.com ( [203.254.199.221]) by
 eusmgms2.samsung.com (EUCPMTA) with SMTP id C3.5A.07950.4607F8E5; Thu,  9
 Apr 2020 19:58:45 +0100 (BST)
Received: from [106.210.88.70] (unknown [106.210.88.70]) by
 eusmtip1.samsung.com (KnoxPortal) with ESMTPA id
 20200409185844eusmtip1ed981812719896b8225a6c1d472474db~EO83wMCSp0642906429eusmtip1U;
 Thu,  9 Apr 2020 18:58:44 +0000 (GMT)
To: Thomas Monjalon <thomas@monjalon.net>, dev@dpdk.org
Cc: bruce.richardson@intel.com, Ruifeng Wang <ruifeng.wang@arm.com>, Gavin
 Hu <gavin.hu@arm.com>, Aaron Conole <aconole@redhat.com>, David Marchand
 <david.marchand@redhat.com>
From: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Message-ID: <8371c0d7-b403-67ae-81f6-eb5522ee7f31@partner.samsung.com>
Date: Thu, 9 Apr 2020 20:58:42 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
 Thunderbird/68.6.0
MIME-Version: 1.0
In-Reply-To: <20200409180332.592074-1-thomas@monjalon.net>
Content-Transfer-Encoding: 8bit
Content-Language: pl
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrJKsWRmVeSWpSXmKPExsWy7djPc7qpBf1xBg9mm1n8evOA3eLGKnuL
 7Su62CzefdrOZHHyxStGi6t9N5gtPj04weLA7rFm3hpGj18LlrJ6LN7zksnj2M1p7B7v911l
 C2CN4rJJSc3JLEst0rdL4MpY+WkDU8F94YqNr+6zNTB2CXQxcnJICJhIHNh5nrmLkYtDSGAF
 o8SXY+sZIZwvjBIrbs2Ecj4zSvxs3whUxgHW0tKVCNItJLCcUeJvvxFEzVtGiTfPtjCC1AgL
 eEuc+sYPUiMiYC6x/+lHdpAaZoHNjBLL5rxgBUmwCdhKHJn5FczmFXCTmP24iwnEZhFQkdix
 /xlYXFQgVuLcoxtQNYISJ2c+YQGxOQWsJDr7zjCC2MwC8hLNW2czQ9giEjcetTBCvLaJXWLv
 /HgI20XiRPdLZghbWOLV8S3sELaMxOnJPSwgx0kIbGOUuPr7JyOEs59R4nrvCqgqa4nD/36z
 gXzGLKApsX6XPkTYUeLO5j5WSKDwSdx4KwhxA5/EpG3ToWHFK9HRJgRRrSfxtGcqI8zaP2uf
 sExgVJqF5LNZSL6ZheSbWQh7FzCyrGIUTy0tzk1PLTbKSy3XK07MLS7NS9dLzs/dxAhMQKf/
 Hf+yg3HXn6RDjAIcjEo8vAYM/XFCrIllxZW5hxglOJiVRHi9m3rjhHhTEiurUovy44tKc1KL
 DzFKc7AoifMaL3oZKySQnliSmp2aWpBaBJNl4uCUamAUVrN2ThE8avxsPj+nfNQ/9fVSi6K/
 H7Pzr73184X5IY1vYtky0h1CErMiOc+Yrmfw5qjU+r2Uy+DbHX/DRQts/5qdi9bbUPb23uPD
 Ul+5mfdm/Nl5X9Xyv/pKwx7VxXdnB2cayYstTn/gc5Ih9STXmpwAEeOeWq8UXeX423tmm+/6
 c39RhKoSS3FGoqEWc1FxIgBX0CvBPAMAAA==
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDIsWRmVeSWpSXmKPExsVy+t/xu7qpBf1xBq8vMFr8evOA3eLGKnuL
 7Su62CzefdrOZHHyxStGi6t9N5gtPj04weLA7rFm3hpGj18LlrJ6LN7zksnj2M1p7B7v911l
 C2CN0rMpyi8tSVXIyC8usVWKNrQw0jO0tNAzMrHUMzQ2j7UyMlXSt7NJSc3JLEst0rdL0MtY
 +WkDU8F94YqNr+6zNTB2CXQxcnBICJhItHQldjFycQgJLGWUWPF2IzNEXEbiwyWgEk4gU1ji
 z7UuNoia14wS25+uYAWpERbwljj1jR+kRkTAXGL/04/sIDXMApsZJd7evcoI0dDLKLFqfScr
 SBWbgK3EkZlfwWxeATeJ2Y+7mEBsFgEViR37n4HFRQViJfqbdzNC1AhKnJz5hAXE5hSwkujs
 OwMWZxYwk5i3+SEzhC0v0bx1NpQtInHjUQvjBEahWUjaZyFpmYWkZRaSlgWMLKsYRVJLi3PT
 c4uN9IoTc4tL89L1kvNzNzECY27bsZ9bdjB2vQs+xCjAwajEw2vA0B8nxJpYVlyZe4hRgoNZ
 SYTXu6k3Tog3JbGyKrUoP76oNCe1+BCjKdBzE5mlRJPzgekgryTe0NTQ3MLS0NzY3NjMQkmc
 t0PgYIyQQHpiSWp2ampBahFMHxMHp1QDY/6usPqshs/cx6Tk0i9KTrXpY9+Uz7fQYO6srFRr
 tzjpHwaRoiuuPjwjkJF18+aWnxkPp0dmflsXOPNAw/vzG/5Y+iet3fpkr2fOtDdrDm3uimtO
 m5Iyw73vX/yHdHdBPkv+nt01z1r17SYx5zJYf3pS+5g9YolGQbbjVEHNL+Kn/UWUcy2MlViK
 MxINtZiLihMBOTareM8CAAA=
X-CMS-MailID: 20200409185845eucas1p128808ed98ed5ddb00da5295c2ef60ee1
X-Msg-Generator: CA
Content-Type: text/plain; charset="utf-8"
X-RootMTR: 20200409180425eucas1p207746156e52ec225d173466de7bee9f4
X-EPHeader: CA
CMS-TYPE: 201P
X-CMS-RootMailID: 20200409180425eucas1p207746156e52ec225d173466de7bee9f4
References: <CGME20200409180425eucas1p207746156e52ec225d173466de7bee9f4@eucas1p2.samsung.com>
 <20200409180332.592074-1-thomas@monjalon.net>
Subject: Re: [dpdk-dev] [PATCH] 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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

works fine

Tested-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>

W dniu 09.04.2020 o 20:03, Thomas Monjalon pisze:
> 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 <thomas@monjalon.net>
> ---
>   MAINTAINERS              |  1 +
>   app/test/has-hugepage.sh | 11 +++++++++++
>   app/test/meson.build     |  8 ++------
>   3 files changed, 14 insertions(+), 6 deletions(-)
>   create mode 100755 app/test/has-hugepage.sh
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 4800f6884a..aa619b6762 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1471,6 +1471,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..484fc5541f
> --- /dev/null
> +++ b/app/test/has-hugepage.sh
> @@ -0,0 +1,11 @@
> +#! /bin/sh -e
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright 2020 Mellanox Technologies, Ltd
> +
> +linux_hugepages_number=/proc/sys/vm/nr_hugepages
> +
> +if [ -r "$linux_hugepages_number" ] ; then
> +	cat /proc/sys/vm/nr_hugepages
> +else
> +	echo 0
> +fi
> diff --git a/app/test/meson.build b/app/test/meson.build
> index 351d29cb65..542408d614 100644
> --- a/app/test/meson.build
> +++ b/app/test/meson.build
> @@ -399,12 +399,8 @@ dpdk_test = executable('dpdk-test',
>   
>   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
> +	check_hugepage = find_program('has-hugepage.sh')
> +	has_hugepage = run_command(check_hugepage).stdout().strip() != '0'
>   endif
>   message('hugepage availability: @0@'.format(has_hugepage))
>   

-- 

Lukasz Wojciechowski
Principal Software Engineer

Samsung R&D Institute Poland
Samsung Electronics
Office +48 22 377 88 25
l.wojciechow@partner.samsung.com