DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test: load tests symbols from binary at init
@ 2019-04-29 14:28 David Marchand
  2019-04-29 14:28 ` David Marchand
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: David Marchand @ 2019-04-29 14:28 UTC (permalink / raw)
  To: dev; +Cc: thomas, aconole

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 <david.marchand@redhat.com>
---

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
 
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH] test: load tests symbols from binary at init
  2019-04-29 14:28 [dpdk-dev] [PATCH] test: load tests symbols from binary at init David Marchand
@ 2019-04-29 14:28 ` David Marchand
  2019-04-29 14:41 ` Burakov, Anatoly
  2019-05-03 17:54 ` Aaron Conole
  2 siblings, 0 replies; 8+ messages in thread
From: David Marchand @ 2019-04-29 14:28 UTC (permalink / raw)
  To: dev; +Cc: thomas, aconole

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 <david.marchand@redhat.com>
---

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
 
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] test: load tests symbols from binary at init
  2019-04-29 14:28 [dpdk-dev] [PATCH] test: load tests symbols from binary at init David Marchand
  2019-04-29 14:28 ` David Marchand
@ 2019-04-29 14:41 ` Burakov, Anatoly
  2019-04-29 14:41   ` Burakov, Anatoly
  2019-05-04 21:04   ` Thomas Monjalon
  2019-05-03 17:54 ` Aaron Conole
  2 siblings, 2 replies; 8+ messages in thread
From: Burakov, Anatoly @ 2019-04-29 14:41 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: thomas, aconole

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 <david.marchand@redhat.com>
> ---
> 
> 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 <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] test: load tests symbols from binary at init
  2019-04-29 14:41 ` Burakov, Anatoly
@ 2019-04-29 14:41   ` Burakov, Anatoly
  2019-05-04 21:04   ` Thomas Monjalon
  1 sibling, 0 replies; 8+ messages in thread
From: Burakov, Anatoly @ 2019-04-29 14:41 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: thomas, aconole

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 <david.marchand@redhat.com>
> ---
> 
> 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 <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] test: load tests symbols from binary at init
  2019-04-29 14:28 [dpdk-dev] [PATCH] test: load tests symbols from binary at init David Marchand
  2019-04-29 14:28 ` David Marchand
  2019-04-29 14:41 ` Burakov, Anatoly
@ 2019-05-03 17:54 ` Aaron Conole
  2019-05-03 17:54   ` Aaron Conole
  2 siblings, 1 reply; 8+ messages in thread
From: Aaron Conole @ 2019-05-03 17:54 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, thomas

David Marchand <david.marchand@redhat.com> writes:

> 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 <david.marchand@redhat.com>
> ---

Acked-by: Aaron Conole <aconole@redhat.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] test: load tests symbols from binary at init
  2019-05-03 17:54 ` Aaron Conole
@ 2019-05-03 17:54   ` Aaron Conole
  0 siblings, 0 replies; 8+ messages in thread
From: Aaron Conole @ 2019-05-03 17:54 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, thomas

David Marchand <david.marchand@redhat.com> writes:

> 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 <david.marchand@redhat.com>
> ---

Acked-by: Aaron Conole <aconole@redhat.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] test: load tests symbols from binary at init
  2019-04-29 14:41 ` Burakov, Anatoly
  2019-04-29 14:41   ` Burakov, Anatoly
@ 2019-05-04 21:04   ` Thomas Monjalon
  2019-05-04 21:04     ` Thomas Monjalon
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2019-05-04 21:04 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Burakov, Anatoly, aconole

29/04/2019 16:41, Burakov, Anatoly:
> 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 <david.marchand@redhat.com>
> 
> LGTM
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] test: load tests symbols from binary at init
  2019-05-04 21:04   ` Thomas Monjalon
@ 2019-05-04 21:04     ` Thomas Monjalon
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2019-05-04 21:04 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Burakov, Anatoly, aconole

29/04/2019 16:41, Burakov, Anatoly:
> 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 <david.marchand@redhat.com>
> 
> LGTM
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-05-04 21:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-29 14:28 [dpdk-dev] [PATCH] test: load tests symbols from binary at init David Marchand
2019-04-29 14:28 ` David Marchand
2019-04-29 14:41 ` Burakov, Anatoly
2019-04-29 14:41   ` Burakov, Anatoly
2019-05-04 21:04   ` Thomas Monjalon
2019-05-04 21:04     ` Thomas Monjalon
2019-05-03 17:54 ` Aaron Conole
2019-05-03 17:54   ` Aaron Conole

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).