From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2459B5F2C for ; Mon, 29 Apr 2019 16:41:49 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Apr 2019 07:41:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,409,1549958400"; d="scan'208";a="168968621" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.113]) ([10.237.220.113]) by fmsmga001.fm.intel.com with ESMTP; 29 Apr 2019 07:41:47 -0700 To: David Marchand , dev@dpdk.org Cc: thomas@monjalon.net, aconole@redhat.com References: <1556548116-18458-1-git-send-email-david.marchand@redhat.com> From: "Burakov, Anatoly" Message-ID: <50d1a87f-98fb-2ad5-3da0-265d118564fd@intel.com> Date: Mon, 29 Apr 2019 15:41:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1556548116-18458-1-git-send-email-david.marchand@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] test: load tests symbols from binary at init 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: , X-List-Received-Date: Mon, 29 Apr 2019 14:41:50 -0000 On 29-Apr-19 3:28 PM, David Marchand wrote: > Rather than call nm on the test application binary for each test to > consider, call it once at the object init. > > Signed-off-by: David Marchand > --- > > With a little patch of mine, before: > # make O=master test > /root/dpdk/master/app/test -c f -n 4 > Filtering tests took 24s <=== > > Running tests with 4 workers > > Test name Test result Test Total > ================================================================================ > Skipped autotests: > devargs: Skipped [Not compiled] [00m 00s] > cryptodev_sw_mrvl: Skipped [Not compiled] [00m 00s] > ... > > After: > # make O=master test > /root/dpdk/master/app/test -c f -n 4 > Filtering tests took 0s <=== > > Running tests with 4 workers > > Test name Test result Test Total > ================================================================================ > Skipped autotests: > devargs: Skipped [Not compiled] [00m 00s] > cryptodev_sw_mrvl: Skipped [Not compiled] [00m 00s] > ... > > --- > app/test/autotest_runner.py | 29 ++++++++++++++--------------- > 1 file changed, 14 insertions(+), 15 deletions(-) > > diff --git a/app/test/autotest_runner.py b/app/test/autotest_runner.py > index 36941a4..b72716e 100644 > --- a/app/test/autotest_runner.py > +++ b/app/test/autotest_runner.py > @@ -192,7 +192,6 @@ class AutotestRunner: > def __init__(self, cmdline, target, blacklist, whitelist, n_processes): > self.cmdline = cmdline > self.target = target > - self.binary = cmdline.split()[0] > self.blacklist = blacklist > self.whitelist = whitelist > self.skipped = [] > @@ -201,6 +200,16 @@ def __init__(self, cmdline, target, blacklist, whitelist, n_processes): > self.n_processes = n_processes > self.active_processes = 0 > > + # parse the binary for available test commands > + binary = cmdline.split()[0] > + stripped = 'not stripped' not in \ > + subprocess.check_output(['file', binary]) > + if not stripped: > + symbols = subprocess.check_output(['nm', binary]).decode('utf-8') > + self.avail_cmds = re.findall('test_register_(\w+)', symbols) > + else: > + self.avail_cmds = None > + > # log file filename > logfile = "%s.log" % target > csvfile = "%s.csv" % target > @@ -275,20 +284,10 @@ def __filter_test(self, test): > return False > > # if test wasn't compiled in, remove it as well > - > - # parse the binary for available test commands > - stripped = 'not stripped' not in \ > - subprocess.check_output(['file', self.binary]) > - if not stripped: > - symbols = subprocess.check_output(['nm', > - self.binary]).decode('utf-8') > - avail_cmds = re.findall('test_register_(\w+)', symbols) > - > - if test_cmd not in avail_cmds: > - # notify user > - result = 0, "Skipped [Not compiled]", test_id, 0, "", None > - self.skipped.append(tuple(result)) > - return False > + if self.avail_cmds and test_cmd not in self.avail_cmds: > + result = 0, "Skipped [Not compiled]", test_id, 0, "", None > + self.skipped.append(tuple(result)) > + return False > > return True > > LGTM Acked-by: Anatoly Burakov -- Thanks, Anatoly From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A2CCBA0679 for ; Mon, 29 Apr 2019 16:41:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6F2245F51; Mon, 29 Apr 2019 16:41:51 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 2459B5F2C for ; Mon, 29 Apr 2019 16:41:49 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Apr 2019 07:41:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,409,1549958400"; d="scan'208";a="168968621" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.113]) ([10.237.220.113]) by fmsmga001.fm.intel.com with ESMTP; 29 Apr 2019 07:41:47 -0700 To: David Marchand , dev@dpdk.org Cc: thomas@monjalon.net, aconole@redhat.com References: <1556548116-18458-1-git-send-email-david.marchand@redhat.com> From: "Burakov, Anatoly" Message-ID: <50d1a87f-98fb-2ad5-3da0-265d118564fd@intel.com> Date: Mon, 29 Apr 2019 15:41:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1556548116-18458-1-git-send-email-david.marchand@redhat.com> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] test: load tests symbols from binary at init 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" Message-ID: <20190429144147.ZWGnStnf_1nlyQh8QDkJNR7dygoErEH1wnFYKsREKzA@z> On 29-Apr-19 3:28 PM, David Marchand wrote: > Rather than call nm on the test application binary for each test to > consider, call it once at the object init. > > Signed-off-by: David Marchand > --- > > With a little patch of mine, before: > # make O=master test > /root/dpdk/master/app/test -c f -n 4 > Filtering tests took 24s <=== > > Running tests with 4 workers > > Test name Test result Test Total > ================================================================================ > Skipped autotests: > devargs: Skipped [Not compiled] [00m 00s] > cryptodev_sw_mrvl: Skipped [Not compiled] [00m 00s] > ... > > After: > # make O=master test > /root/dpdk/master/app/test -c f -n 4 > Filtering tests took 0s <=== > > Running tests with 4 workers > > Test name Test result Test Total > ================================================================================ > Skipped autotests: > devargs: Skipped [Not compiled] [00m 00s] > cryptodev_sw_mrvl: Skipped [Not compiled] [00m 00s] > ... > > --- > app/test/autotest_runner.py | 29 ++++++++++++++--------------- > 1 file changed, 14 insertions(+), 15 deletions(-) > > diff --git a/app/test/autotest_runner.py b/app/test/autotest_runner.py > index 36941a4..b72716e 100644 > --- a/app/test/autotest_runner.py > +++ b/app/test/autotest_runner.py > @@ -192,7 +192,6 @@ class AutotestRunner: > def __init__(self, cmdline, target, blacklist, whitelist, n_processes): > self.cmdline = cmdline > self.target = target > - self.binary = cmdline.split()[0] > self.blacklist = blacklist > self.whitelist = whitelist > self.skipped = [] > @@ -201,6 +200,16 @@ def __init__(self, cmdline, target, blacklist, whitelist, n_processes): > self.n_processes = n_processes > self.active_processes = 0 > > + # parse the binary for available test commands > + binary = cmdline.split()[0] > + stripped = 'not stripped' not in \ > + subprocess.check_output(['file', binary]) > + if not stripped: > + symbols = subprocess.check_output(['nm', binary]).decode('utf-8') > + self.avail_cmds = re.findall('test_register_(\w+)', symbols) > + else: > + self.avail_cmds = None > + > # log file filename > logfile = "%s.log" % target > csvfile = "%s.csv" % target > @@ -275,20 +284,10 @@ def __filter_test(self, test): > return False > > # if test wasn't compiled in, remove it as well > - > - # parse the binary for available test commands > - stripped = 'not stripped' not in \ > - subprocess.check_output(['file', self.binary]) > - if not stripped: > - symbols = subprocess.check_output(['nm', > - self.binary]).decode('utf-8') > - avail_cmds = re.findall('test_register_(\w+)', symbols) > - > - if test_cmd not in avail_cmds: > - # notify user > - result = 0, "Skipped [Not compiled]", test_id, 0, "", None > - self.skipped.append(tuple(result)) > - return False > + if self.avail_cmds and test_cmd not in self.avail_cmds: > + result = 0, "Skipped [Not compiled]", test_id, 0, "", None > + self.skipped.append(tuple(result)) > + return False > > return True > > LGTM Acked-by: Anatoly Burakov -- Thanks, Anatoly