Re: [PATCH] Coverage: Add support for TSIM format

2019-02-14 Thread Joel Sherrill
On Wed, Feb 13, 2019 at 11:00 PM Vijay Kumar Banerjee <
vijaykumar9...@gmail.com> wrote:

>
>
> On Thu, Feb 14, 2019, 4:15 AM Chris Johns  wrote:
>
>> On 8/2/19 5:39 pm, Vijay Kumar Banerjee wrote:
>> > Attaching v3 of the patch. :)
>>
>> Pushed.
>>
>> Nice work and thank you for sticking with this. It sits nicely in the
>> framework.
>>
> Thanks !! :)
>

:)



>
>> Thanks
>> Chris
>>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Coverage: Add support for TSIM format

2019-02-13 Thread Vijay Kumar Banerjee
On Thu, Feb 14, 2019, 4:15 AM Chris Johns  wrote:

> On 8/2/19 5:39 pm, Vijay Kumar Banerjee wrote:
> > Attaching v3 of the patch. :)
>
> Pushed.
>
> Nice work and thank you for sticking with this. It sits nicely in the
> framework.
>
Thanks !! :)

>
> Thanks
> Chris
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Coverage: Add support for TSIM format

2019-02-13 Thread Chris Johns
On 8/2/19 5:39 pm, Vijay Kumar Banerjee wrote:
> Attaching v3 of the patch. :)

Pushed.

Nice work and thank you for sticking with this. It sits nicely in the framework.

Thanks
Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] Coverage: Add support for TSIM format

2019-02-07 Thread Vijay Kumar Banerjee
Attaching v3 of the patch. :)
From 11267b9ebf80921cb45c0a8e1a4a1df8513c8a97 Mon Sep 17 00:00:00 2001
From: Vijay Kumar Banerjee 
Date: Fri, 1 Feb 2019 01:01:42 +0530
Subject: [PATCH v3] Coverage: Add support for TSIM format

---
 tester/rt/coverage.py   | 35 +
 tester/rtems/testing/bsps/leon3-sis-cov.ini | 12 ---
 tester/rtems/testing/defaults.mc|  4 +++
 3 files changed, 33 insertions(+), 18 deletions(-)

diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
index 9fc9b64..eef88f7 100644
--- a/tester/rt/coverage.py
+++ b/tester/rt/coverage.py
@@ -45,6 +45,7 @@ from rtemstoolkit import path
 from rtemstoolkit import log
 from rtemstoolkit import execute
 from rtemstoolkit import macros
+from rtemstoolkit import version
 
 
 import options
@@ -288,14 +289,20 @@ class covoar(object):
 '''
 Covoar runner
 '''
-def __init__(self, base_result_dir, config_dir, executables, explanations_txt, trace, prefix):
+def __init__(self,
+ base_result_dir,
+ config_dir,
+ executables,
+ trace,
+ prefix,
+ covoar_cmd):
 self.base_result_dir = base_result_dir
 self.config_dir = config_dir
 self.executables = ' '.join(executables)
-self.explanations_txt = explanations_txt
-self.project_name = 'RTEMS-5'
+self.project_name = 'RTEMS-' + str(version.version())
 self.trace = trace
 self.prefix = prefix
+self.covoar_cmd = covoar_cmd
 
 def _find_covoar(self):
 covoar_exe = 'covoar'
@@ -316,10 +323,11 @@ class covoar(object):
 if not path.exists(symbol_file):
 raise error.general('coverage: no symbol set file: %s'% (symbol_file))
 exe = self._find_covoar()
-command = exe + ' -S ' + symbol_file + \
-  ' -O ' + covoar_result_dir + \
-  ' -E ' + self.explanations_txt + \
-  ' -p ' + self.project_name + ' ' + self.executables
+command = exe + ' -O ' + covoar_result_dir + \
+  ' -p ' + self.project_name + \
+  ' ' + self.executables + ' '
+command += self.covoar_cmd
+
 log.notice()
 log.notice('Running coverage analysis: %s (%s)' % (set_name, covoar_result_dir))
 start_time = datetime.datetime.now()
@@ -344,7 +352,6 @@ class coverage_run(object):
 self.trace = trace
 self.macros = macros_
 self.build_dir = self.macros['_cwd']
-self.explanations_txt = self.macros.expand(self.macros['cov_explanations'])
 self.test_dir = path.join(self.build_dir, self.macros['bsp'] + '-coverage')
 if not path.exists(self.test_dir):
 path.mkdir(self.test_dir)
@@ -353,8 +360,7 @@ class coverage_run(object):
 self.coverage_config_path = path.join(self.rtscripts, 'coverage')
 self.symbol_config_path = path.join(self.coverage_config_path,
 'symbol-sets.ini')
-self.symbol_select_path = path.join(self.coverage_config_path,
-self.macros['bsp'] + '-symbols.ini')
+self.symbol_select_path = self.macros.expand(self.macros['bsp_symbol_path'])
 self.executables = executables
 self.symbol_sets = []
 self.no_clean = int(self.macros['_no_clean'])
@@ -364,6 +370,7 @@ class coverage_run(object):
 self.bsp_name = self.macros['bsp'].split('-')[0]
 self.prefix = prefix
 self.macros.define('coverage')
+self.covoar_cmd = self.macros.expand(self.macros['bsp_covoar_cmd'])
 
 def run(self):
 try:
@@ -379,10 +386,12 @@ class coverage_run(object):
 symbol_sets = parser.parse()
 for sset in symbol_sets:
 parser.write_ini(sset)
-covoar_runner = covoar(self.test_dir, self.symbol_select_path,
-   self.executables, self.explanations_txt,
+covoar_runner = covoar(self.test_dir,
+   self.symbol_select_path,
+   self.executables,
self.trace,
-   self.prefix)
+   self.prefix,
+   self.covoar_cmd)
 covoar_runner.run(sset, self.symbol_select_path)
 self._generate_reports(symbol_sets);
 self._summarize();
diff --git a/tester/rtems/testing/bsps/leon3-sis-cov.ini b/tester/rtems/testing/bsps/leon3-sis-cov.ini
index f0a2ab9..626d314 100644
--- a/tester/rtems/testing/bsps/leon3-sis-cov.ini
+++ b/tester/rtems/testing/bsps/leon3-sis-cov.ini
@@ -32,8 +32,10 @@
 # The leon3 BSP on sis with coverage
 #
 [leon3-sis-cov]
-bsp  = leon3
-arch = sparc
-tester   = %{_rtscripts

Re: [PATCH] Coverage: Add support for TSIM format

2019-02-07 Thread Vijay Kumar Banerjee
On Fri, 8 Feb 2019 at 08:34, Chris Johns  wrote:

> On 8/2/19 9:13 am, Vijay Kumar Banerjee wrote:
> > On Fri, 8 Feb 2019 at 00:15, Chris Johns  > > wrote:
> >
> > On 7/2/19 7:17 pm, Vijay Kumar Banerjee wrote:
> > > I'm trying to do this ...
> > >
> > > ===
> > > diff --git a/tester/rtems/testing/bsps/leon3-sis-cov.ini
> > > b/tester/rtems/testing/bsps/leon3-sis-cov.ini
> > > index d60257c..e450b60 100644
> > > --- a/tester/rtems/testing/bsps/leon3-sis-cov.ini
> > > +++ b/tester/rtems/testing/bsps/leon3-sis-cov.ini
> > > @@ -38,4 +38,4 @@ tester = %{_rtscripts}/run.cfg
> > >  target = sparc-rtems5
> > >  bsp_run_cmd=
> %{rtems_tools}/%{bsp_arch}-rtems%{rtems_version}-sis
> > >  bsp_run_opts   = -leon3 -nouartrx -r -tlim 200 s -cov
> > > -bsp_covoar_cmd = -E %{cov_explanations} -f TSIM
> > > +bsp_covoar_cmd = -S %{bsp_symbol_path} -p %{project_name} -E
> > > %{cov_explanations} -f TSIM
> >
> > Can the common options be moved to coverage part of qemu.cfg?
> >
> > Since I'm trying with the sis. I added it to the run.cfg like this
> >
> > #
> > # Coverage
> > #
> > %if %{defined coverage}
> >   %define covoar_cmd -S %{bsp_symbol_path} -p RTEMS-%{rtems_version} -E
> > %{cov_explanations}
> > %endif
> >
>
> Ahh, I wonder if this should be in a coverage.cfg file you include and
> this way
> it can be shared?
>
> That's a good idea.

>
> > When I print the macros from the config.py I see this macro created like
> this...
> >
> >  coverage: 'none' 'none'  '1'
> >  covoar_cmd:   'none' 'none'  '-S
> >
> /home/lunatic/development/rtems/rtems-tools/tester/rtems/testing/coverage/leo
> \
> >   n3-sis-symbols.ini -p
> RTEMS-5 -E
> > /home/lunatic/development/rtems/rtems-tools/tes \
> >
> > ter/rtems/testing/coverage/Explanations.txt'
> >
> > The only problem now is to expand it from coverage.py which is giving
> error.
> > If I print the macros list from the coverage.py , I see that the list is
> missing
> > this and some other macros. How to get the 'complete' list of macros? :/
>
> Sorry I am not sute, can you see the config object from the coverage code?
>
> I would need to review the code and figure it out and I do not have the
> time.
>
> I can attempt to figure it out with some help :)
Meanwhile, do we want to push this patch in the current working state, with
the options
added to the BSP file? I will send a v3 of this patch with the changes.

Chris
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Coverage: Add support for TSIM format

2019-02-07 Thread Chris Johns
On 8/2/19 9:13 am, Vijay Kumar Banerjee wrote:
> On Fri, 8 Feb 2019 at 00:15, Chris Johns  > wrote:
> 
> On 7/2/19 7:17 pm, Vijay Kumar Banerjee wrote:
> > I'm trying to do this ...
> >
> > ===
> > diff --git a/tester/rtems/testing/bsps/leon3-sis-cov.ini
> > b/tester/rtems/testing/bsps/leon3-sis-cov.ini
> > index d60257c..e450b60 100644
> > --- a/tester/rtems/testing/bsps/leon3-sis-cov.ini
> > +++ b/tester/rtems/testing/bsps/leon3-sis-cov.ini
> > @@ -38,4 +38,4 @@ tester         = %{_rtscripts}/run.cfg
> >  target         = sparc-rtems5
> >  bsp_run_cmd    = %{rtems_tools}/%{bsp_arch}-rtems%{rtems_version}-sis
> >  bsp_run_opts   = -leon3 -nouartrx -r -tlim 200 s -cov
> > -bsp_covoar_cmd = -E %{cov_explanations} -f TSIM
> > +bsp_covoar_cmd = -S %{bsp_symbol_path} -p %{project_name} -E
> > %{cov_explanations} -f TSIM
> 
> Can the common options be moved to coverage part of qemu.cfg?
> 
> Since I'm trying with the sis. I added it to the run.cfg like this 
> 
> #
> # Coverage
> #
> %if %{defined coverage}
>   %define covoar_cmd -S %{bsp_symbol_path} -p RTEMS-%{rtems_version} -E
> %{cov_explanations}
> %endif
>

Ahh, I wonder if this should be in a coverage.cfg file you include and this way
it can be shared?

  
> When I print the macros from the config.py I see this macro created like 
> this...
> 
>  coverage:             'none'     'none'      '1'
>  covoar_cmd:           'none'     'none'      '-S
> /home/lunatic/development/rtems/rtems-tools/tester/rtems/testing/coverage/leo 
> \
>                                               n3-sis-symbols.ini -p RTEMS-5 -E
> /home/lunatic/development/rtems/rtems-tools/tes \
>                                              
> ter/rtems/testing/coverage/Explanations.txt'
> 
> The only problem now is to expand it from coverage.py which is giving error.
> If I print the macros list from the coverage.py , I see that the list is 
> missing
> this and some other macros. How to get the 'complete' list of macros? :/

Sorry I am not sute, can you see the config object from the coverage code?

I would need to review the code and figure it out and I do not have the time.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Coverage: Add support for TSIM format

2019-02-07 Thread Vijay Kumar Banerjee
On Fri, 8 Feb 2019 at 00:15, Chris Johns  wrote:

> On 7/2/19 7:17 pm, Vijay Kumar Banerjee wrote:
> > I'm trying to do this ...
> >
> > ===
> > diff --git a/tester/rtems/testing/bsps/leon3-sis-cov.ini
> > b/tester/rtems/testing/bsps/leon3-sis-cov.ini
> > index d60257c..e450b60 100644
> > --- a/tester/rtems/testing/bsps/leon3-sis-cov.ini
> > +++ b/tester/rtems/testing/bsps/leon3-sis-cov.ini
> > @@ -38,4 +38,4 @@ tester = %{_rtscripts}/run.cfg
> >  target = sparc-rtems5
> >  bsp_run_cmd= %{rtems_tools}/%{bsp_arch}-rtems%{rtems_version}-sis
> >  bsp_run_opts   = -leon3 -nouartrx -r -tlim 200 s -cov
> > -bsp_covoar_cmd = -E %{cov_explanations} -f TSIM
> > +bsp_covoar_cmd = -S %{bsp_symbol_path} -p %{project_name} -E
> > %{cov_explanations} -f TSIM
>
> Can the common options be moved to coverage part of qemu.cfg?
>
> Since I'm trying with the sis. I added it to the run.cfg like this

#
# Coverage
#
%if %{defined coverage}
  %define covoar_cmd -S %{bsp_symbol_path} -p RTEMS-%{rtems_version} -E
%{cov_explanations}
%endif

When I print the macros from the config.py I see this macro created like
this...

 coverage: 'none' 'none'  '1'
 covoar_cmd:   'none' 'none'  '-S
/home/lunatic/development/rtems/rtems-tools/tester/rtems/testing/coverage/leo
\
  n3-sis-symbols.ini -p RTEMS-5
-E /home/lunatic/development/rtems/rtems-tools/tes \

ter/rtems/testing/coverage/Explanations.txt'

The only problem now is to expand it from coverage.py which is giving error.
If I print the macros list from the coverage.py , I see that the list is
missing this and some other macros. How to get the 'complete' list of
macros? :/

> diff --git a/tester/rtems/testing/defaults.mc 
> > b/tester/rtems/testing/defaults.mc 
> > index 54212e0..d3e16a9 100644
> > --- a/tester/rtems/testing/defaults.mc 
> > +++ b/tester/rtems/testing/defaults.mc 
> > @@ -122,5 +122,9 @@ _rtbase: none,none, '%{_rtdir}'
> >  _rttesting:  none,none, '%{_rtbase}/rtems/testing'
> >  _configdir:  none,none,
>  '%{_rtbase}/config:%{_rttesting}'
> >
> > +#Coverage macros
> > +bsp_symbol_path: none,none,
> > '%{_rtscripts}/coverage/%{bsp}-symbols.ini'
> > +project_name:none,none,  'RTEMS-%{rtems_version}'
> > +
> > ==
> >
> > I'm getting an error "error: cannot expand default macro:
> %{rtems_version} "
> >
> > I see the rtems_version macro if I print the macros. How do I access
> this macro?
>
> Please add `--trace` to the command line and see how the cfg files are
> being
> processed. Compare this to a tester command that is working.
>
> Chris
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Coverage: Add support for TSIM format

2019-02-07 Thread Chris Johns
On 7/2/19 7:17 pm, Vijay Kumar Banerjee wrote:
> I'm trying to do this ...
> 
> ===
> diff --git a/tester/rtems/testing/bsps/leon3-sis-cov.ini
> b/tester/rtems/testing/bsps/leon3-sis-cov.ini
> index d60257c..e450b60 100644
> --- a/tester/rtems/testing/bsps/leon3-sis-cov.ini
> +++ b/tester/rtems/testing/bsps/leon3-sis-cov.ini
> @@ -38,4 +38,4 @@ tester         = %{_rtscripts}/run.cfg
>  target         = sparc-rtems5
>  bsp_run_cmd    = %{rtems_tools}/%{bsp_arch}-rtems%{rtems_version}-sis
>  bsp_run_opts   = -leon3 -nouartrx -r -tlim 200 s -cov
> -bsp_covoar_cmd = -E %{cov_explanations} -f TSIM
> +bsp_covoar_cmd = -S %{bsp_symbol_path} -p %{project_name} -E
> %{cov_explanations} -f TSIM

Can the common options be moved to coverage part of qemu.cfg?

> diff --git a/tester/rtems/testing/defaults.mc 
> b/tester/rtems/testing/defaults.mc 
> index 54212e0..d3e16a9 100644
> --- a/tester/rtems/testing/defaults.mc 
> +++ b/tester/rtems/testing/defaults.mc 
> @@ -122,5 +122,9 @@ _rtbase:             none,    none,     '%{_rtdir}'
>  _rttesting:          none,    none,     '%{_rtbase}/rtems/testing'
>  _configdir:          none,    none,     '%{_rtbase}/config:%{_rttesting}'
>  
> +#Coverage macros
> +bsp_symbol_path:     none,    none,     
> '%{_rtscripts}/coverage/%{bsp}-symbols.ini'
> +project_name:        none,    none,      'RTEMS-%{rtems_version}'
> +
> ==
> 
> I'm getting an error "error: cannot expand default macro: %{rtems_version} "
> 
> I see the rtems_version macro if I print the macros. How do I access this 
> macro?

Please add `--trace` to the command line and see how the cfg files are being
processed. Compare this to a tester command that is working.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Coverage: Add support for TSIM format

2019-02-07 Thread Vijay Kumar Banerjee
I'm trying to do this ...

===
diff --git a/tester/rtems/testing/bsps/leon3-sis-cov.ini
b/tester/rtems/testing/bsps/leon3-sis-cov.ini
index d60257c..e450b60 100644
--- a/tester/rtems/testing/bsps/leon3-sis-cov.ini
+++ b/tester/rtems/testing/bsps/leon3-sis-cov.ini
@@ -38,4 +38,4 @@ tester = %{_rtscripts}/run.cfg
 target = sparc-rtems5
 bsp_run_cmd= %{rtems_tools}/%{bsp_arch}-rtems%{rtems_version}-sis
 bsp_run_opts   = -leon3 -nouartrx -r -tlim 200 s -cov
-bsp_covoar_cmd = -E %{cov_explanations} -f TSIM
+bsp_covoar_cmd = -S %{bsp_symbol_path} -p %{project_name} -E
%{cov_explanations} -f TSIM
diff --git a/tester/rtems/testing/defaults.mc b/tester/rtems/testing/
defaults.mc
index 54212e0..d3e16a9 100644
--- a/tester/rtems/testing/defaults.mc
+++ b/tester/rtems/testing/defaults.mc
@@ -122,5 +122,9 @@ _rtbase: none,none, '%{_rtdir}'
 _rttesting:  none,none, '%{_rtbase}/rtems/testing'
 _configdir:  none,none, '%{_rtbase}/config:%{_rttesting}'

+#Coverage macros
+bsp_symbol_path: none,none,
'%{_rtscripts}/coverage/%{bsp}-symbols.ini'
+project_name:none,none,  'RTEMS-%{rtems_version}'
+
==

I'm getting an error "error: cannot expand default macro: %{rtems_version} "

I see the rtems_version macro if I print the macros. How do I access this
macro?
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Coverage: Add support for TSIM format

2019-02-06 Thread Chris Johns
On 6/2/19 9:33 pm, Vijay Kumar Banerjee wrote:
> 
> 
> 
> On Wed, 6 Feb 2019 at 14:04, Chris Johns  > wrote:
> 
> On 6/2/19 7:24 pm, Vijay Kumar Banerjee wrote:
> > @@ -317,9 +324,11 @@ class covoar(object):
> >              raise error.general('coverage: no symbol set file: %s'%
> (symbol_file))
> >          exe = self._find_covoar()
> >          command = exe + ' -S ' + symbol_file + \
> > -                  ' -O ' + covoar_result_dir + \
> > -                  ' -E ' + self.explanations_txt + \
> > -                  ' -p ' + self.project_name + ' ' + self.executables
> > +                   ' -O ' + covoar_result_dir + \
> > +                   ' -p ' + self.project_name + \
> > +                   ' ' + self.executables + ' '
> 
> Can all these be placed in a macro variable and then accessed here?
> 
> Maybe in defaults.mc ?
> 
> I tried this but it seems like all these need bsp name or version. So we can't
> add them in default.mc 
> or testing.mc . If we want to move it to the configuration
> files then we'll have to add it in the bsp ini file (like the explanations 
> file
> has been added ). Do we want to have it in bsp file? It might make the ini 
> file
> complicated.

You can add references to the BSP's macro entry "%{bsp}" in defaults.mc. All
then need to do is expand the macro when you need it. For example:

https://git.rtems.org/rtems-tools/tree/tester/rt/config.py#n146

If you print the macros instance in the config class you will see what it
contains. For example this command:

$ /opt/work/chris/rtems/tools/rtems-tools.git/tester/rtems-run \
 --rtems-tools=/opt/work/rtems/5 --rtems-bsp=psim-run \
 `find . -name hello.exe`

 [ Added `print(self.macros)` as the first line of `def _dir_execute()` ]

The macro values of interest are:

[psim-run] w,r[]
 _target:  'none' 'none'  '%{%{bsp_arch}-rtems%{version}'
 arch: 'none' 'none'  'powerpc'
 bsp:  'none' 'none'  'psim'
 bsp_arch: 'none' 'none'  '%{arch}'
 bsp_run_cmd:  'none' 'none'
'%{rtems_tools}/%{bsp_arch}-rtems%{rtems_version}-run'
 bsp_run_opts: 'none' 'none'  '-f
%{_rtscripts}/bsps/psim-device-tree'
 console_stdio:'none' 'none'  '1'
 exe_trace:'none' 'none'  'output'
 rtems_tools:  'none' 'none'  '/opt/work/rtems/5/bin'
 rtems_version:'none' 'none'  '5'
 run_cmd:  'none' 'none'
'/opt/work/rtems/5/bin/powerpc-rtems5-run'
 run_opts: 'none' 'none'  '-f
/opt/work/chris/rtems/tools/rtems-tools.git/tester/rtems/testing/bsps/psim-de \
  vice-tree'
 test_disable_header:  'none' 'none'  '1'
 test_executable:  'none' 'none'
'./powerpc-rtems5/c/psim/testsuites/samples/hello.exe'
 test_executable_opts: 'none' 'none'  ''
 test_index:   'none' 'none'  '1'
 test_total:   'none' 'none'  '1'
 tester:   'none' 'none'  '%{_rtscripts}/run.cfg'

This means in `defaults.mc` you can use `%{arch}-%{bsp}` etc and if you expand
the macro the values will be recursively resolved.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Coverage: Add support for TSIM format

2019-02-06 Thread Chris Johns
On 6/2/19 7:24 pm, Vijay Kumar Banerjee wrote:
> @@ -317,9 +324,11 @@ class covoar(object):
>  raise error.general('coverage: no symbol set file: %s'% 
> (symbol_file))
>  exe = self._find_covoar()
>  command = exe + ' -S ' + symbol_file + \
> -  ' -O ' + covoar_result_dir + \
> -  ' -E ' + self.explanations_txt + \
> -  ' -p ' + self.project_name + ' ' + self.executables
> +   ' -O ' + covoar_result_dir + \
> +   ' -p ' + self.project_name + \
> +   ' ' + self.executables + ' '

Can all these be placed in a macro variable and then accessed here?

Maybe in defaults.mc?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] Coverage: Add support for TSIM format

2019-02-06 Thread Vijay Kumar Banerjee
On Wed, 6 Feb 2019 at 02:35, Chris Johns  wrote:

> On 6/2/19 1:41 am, Vijay Kumar Banerjee wrote:
> > On Tue, 5 Feb 2019 at 03:37, Chris Johns  > <mailto:chr...@rtems.org>> wrote:
>  On 1/2/19 10:47 pm, Vijay Kumar Banerjee wrote:
> > >  self.trace = trace
> > >  self.prefix = prefix
> > > +self.bsp = bsp
> > >
> > >  def _find_covoar(self):
> > >  covoar_exe = 'covoar'
> > > @@ -316,10 +323,18 @@ class covoar(object):
> > >  if not path.exists(symbol_file):
> > >  raise error.general('coverage: no symbol set file:
> %s'%
> > (symbol_file))
> > >  exe = self._find_covoar()
> > > -command = exe + ' -S ' + symbol_file + \
> > > -  ' -O ' + covoar_result_dir + \
> > > -  ' -E ' + self.explanations_txt + \
> > > -  ' -p ' + self.project_name + ' ' +
> self.executables
> > > +if 'qemu' in self.bsp.split('-'):
> >
> > Are you checking for 'qemu' in the BSP name? The naming used here is
> a
> > convention and making the code depend on a naming convention is
> fragile. Lets
> > not do this.
> >
> > There is a `%{qemu-cmd}` macro defined which must exist for a qemu
> run so it is
> > better to check for this. However ...
> >
> > I'm not able to get it with macros.find(). What's the right way to find
> it?
>
> Find should work and `get` should also work and may be simpler.
>
> > Also, there's a 'cov_format' in testing.mc <http://testing.mc> that is
> hardcoded
> > to 'QEMU'. Can this value be updated from the cfg files ?
>
> I do not mind but maybe this logic is not needed if you can create the
> command
> line in a .cfg file. This means you can bring the needed options together
> from
> the BSP file which could hold the `-f TSIM` option you need and the code
> here is
> common for all coverage.
>
> > > +command = exe + ' -S ' + symbol_file + \
> > > +  ' -O ' + covoar_result_dir + \
> > > +  ' -E ' + self.explanations_txt + \
> > > +  ' -p ' + self.project_name + ' ' +
> self.executables
> > > +else:
> > > +command = exe + ' -S ' + symbol_file + \
> > > +  ' -O ' + covoar_result_dir + \
> > > +  ' -E ' + self.explanations_txt + \
> > > +  ' -f TSIM' + \
> > > +  ' -p ' + self.project_name + ' ' +
> self.executables
> >
> > ... I would prefer the command be managed in the config files and
> this code
> > removed. Do you think this can be done?
> >
> > the exe and the symbol_files are generated by the script itself. I think
> we have
> > to call covoar from the script only.
>
> That is fine, it is just the command line that I am asking about.
>
> something like the attached patch?

> Chris
>
From 33939f89efd1b876b69401e11362bf482af2bdde Mon Sep 17 00:00:00 2001
From: Vijay Kumar Banerjee 
Date: Fri, 1 Feb 2019 01:01:42 +0530
Subject: [PATCH v2] Coverage: Add support for TSIM format

---
 tester/rt/coverage.py   | 31 ++---
 tester/rtems/testing/bsps/leon3-sis-cov.ini | 12 
 2 files changed, 28 insertions(+), 15 deletions(-)

diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
index 9fc9b64..846b098 100644
--- a/tester/rt/coverage.py
+++ b/tester/rt/coverage.py
@@ -45,6 +45,7 @@ from rtemstoolkit import path
 from rtemstoolkit import log
 from rtemstoolkit import execute
 from rtemstoolkit import macros
+from rtemstoolkit import version
 
 
 import options
@@ -288,14 +289,20 @@ class covoar(object):
 '''
 Covoar runner
 '''
-def __init__(self, base_result_dir, config_dir, executables, explanations_txt, trace, prefix):
+def __init__(self,
+ base_result_dir,
+ config_dir,
+ executables,
+ trace,
+ prefix,
+ covoar_cmd):
 self.base_result_dir = base_result_dir
 self.config_dir = config_dir
 self.executables = ' '.join(executables)
-self.explanations_txt = explanations_txt
-self.project_name = 'RTEMS-5'
+self.project_name = 'RTEMS-' + str(version.version())
 self.trace = trace
 self.prefix = prefix
+self.covoar_cmd = covoar_cmd
 
 def _find_covoar(self):
 covoar_exe = 'covoar'
@@ -317,9 +3

Re: [PATCH] Coverage: Add support for TSIM format

2019-02-05 Thread Chris Johns
On 6/2/19 1:41 am, Vijay Kumar Banerjee wrote:
> On Tue, 5 Feb 2019 at 03:37, Chris Johns  > wrote:
 On 1/2/19 10:47 pm, Vijay Kumar Banerjee wrote:
> >          self.trace = trace
> >          self.prefix = prefix
> > +        self.bsp = bsp
> > 
> >      def _find_covoar(self):
> >          covoar_exe = 'covoar'
> > @@ -316,10 +323,18 @@ class covoar(object):
> >          if not path.exists(symbol_file):
> >              raise error.general('coverage: no symbol set file: %s'%
> (symbol_file))
> >          exe = self._find_covoar()
> > -        command = exe + ' -S ' + symbol_file + \
> > -                  ' -O ' + covoar_result_dir + \
> > -                  ' -E ' + self.explanations_txt + \
> > -                  ' -p ' + self.project_name + ' ' + self.executables
> > +        if 'qemu' in self.bsp.split('-'):
> 
> Are you checking for 'qemu' in the BSP name? The naming used here is a
> convention and making the code depend on a naming convention is fragile. 
> Lets
> not do this.
> 
> There is a `%{qemu-cmd}` macro defined which must exist for a qemu run so 
> it is
> better to check for this. However ...
> 
> I'm not able to get it with macros.find(). What's the right way to find it?

Find should work and `get` should also work and may be simpler.

> Also, there's a 'cov_format' in testing.mc  that is 
> hardcoded
> to 'QEMU'. Can this value be updated from the cfg files ?

I do not mind but maybe this logic is not needed if you can create the command
line in a .cfg file. This means you can bring the needed options together from
the BSP file which could hold the `-f TSIM` option you need and the code here is
common for all coverage.

> > +            command = exe + ' -S ' + symbol_file + \
> > +                      ' -O ' + covoar_result_dir + \
> > +                      ' -E ' + self.explanations_txt + \
> > +                      ' -p ' + self.project_name + ' ' + 
> self.executables
> > +        else:
> > +            command = exe + ' -S ' + symbol_file + \
> > +                      ' -O ' + covoar_result_dir + \
> > +                      ' -E ' + self.explanations_txt + \
> > +                      ' -f TSIM' + \
> > +                      ' -p ' + self.project_name + ' ' + 
> self.executables
> 
> ... I would prefer the command be managed in the config files and this 
> code
> removed. Do you think this can be done?
> 
> the exe and the symbol_files are generated by the script itself. I think we 
> have
> to call covoar from the script only. 

That is fine, it is just the command line that I am asking about.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Coverage: Add support for TSIM format

2019-02-05 Thread Vijay Kumar Banerjee
On Tue, 5 Feb 2019 at 03:37, Chris Johns  wrote:

> On 1/2/19 10:47 pm, Vijay Kumar Banerjee wrote:
> > ---
> >  tester/rt/coverage.py   | 28 -
> >  tester/rtems/testing/bsps/leon3-sis-cov.ini |  3 ++-
> >  2 files changed, 24 insertions(+), 7 deletions(-)
> >
> > diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
> > index 9fc9b64..859001a 100644
> > --- a/tester/rt/coverage.py
> > +++ b/tester/rt/coverage.py
> > @@ -288,7 +288,13 @@ class covoar(object):
> >  '''
> >  Covoar runner
> >  '''
> > -def __init__(self, base_result_dir, config_dir, executables,
> explanations_txt, trace, prefix):
> > +def __init__( self,
>
> Extra space?
>
> Will fix this in v2.

> > +  base_result_dir,
> > +  config_dir, executables,
> > +  explanations_txt,
> > +  trace,
> > +  prefix,
> > +  bsp ):
> >  self.base_result_dir = base_result_dir
> >  self.config_dir = config_dir
> >  self.executables = ' '.join(executables)
> > @@ -296,6 +302,7 @@ class covoar(object):
> >  self.project_name = 'RTEMS-5'
>
> I had not noticed this before. We should not be hard coding version
> numbers into
> this part of the code. It requires updating after each release and all in
> likely
> hood this one would be missed. The tool kit has support for versions.
>
> Understood. Will fix.

> >  self.trace = trace
> >  self.prefix = prefix
> > +self.bsp = bsp
> >
> >  def _find_covoar(self):
> >  covoar_exe = 'covoar'
> > @@ -316,10 +323,18 @@ class covoar(object):
> >  if not path.exists(symbol_file):
> >  raise error.general('coverage: no symbol set file: %s'%
> (symbol_file))
> >  exe = self._find_covoar()
> > -command = exe + ' -S ' + symbol_file + \
> > -  ' -O ' + covoar_result_dir + \
> > -  ' -E ' + self.explanations_txt + \
> > -  ' -p ' + self.project_name + ' ' + self.executables
> > +if 'qemu' in self.bsp.split('-'):
>
> Are you checking for 'qemu' in the BSP name? The naming used here is a
> convention and making the code depend on a naming convention is fragile.
> Lets
> not do this.
>
> There is a `%{qemu-cmd}` macro defined which must exist for a qemu run so
> it is
> better to check for this. However ...
>
> I'm not able to get it with macros.find(). What's the right way to find it?
Also, there's a 'cov_format' in testing.mc that is hardcoded to 'QEMU'. Can
this value be updated from the cfg files ?

> > +command = exe + ' -S ' + symbol_file + \
> > +  ' -O ' + covoar_result_dir + \
> > +  ' -E ' + self.explanations_txt + \
> > +  ' -p ' + self.project_name + ' ' +
> self.executables
> > +else:
> > +command = exe + ' -S ' + symbol_file + \
> > +  ' -O ' + covoar_result_dir + \
> > +  ' -E ' + self.explanations_txt + \
> > +  ' -f TSIM' + \
> > +  ' -p ' + self.project_name + ' ' +
> self.executables
>
> ... I would prefer the command be managed in the config files and this code
> removed. Do you think this can be done?
>
> the exe and the symbol_files are generated by the script itself. I think
we have to call
covoar from the script only.

Thanks for the review.

> Thanks
> Chris
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Coverage: Add support for TSIM format

2019-02-04 Thread Chris Johns
On 1/2/19 10:47 pm, Vijay Kumar Banerjee wrote:
> ---
>  tester/rt/coverage.py   | 28 -
>  tester/rtems/testing/bsps/leon3-sis-cov.ini |  3 ++-
>  2 files changed, 24 insertions(+), 7 deletions(-)
> 
> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
> index 9fc9b64..859001a 100644
> --- a/tester/rt/coverage.py
> +++ b/tester/rt/coverage.py
> @@ -288,7 +288,13 @@ class covoar(object):
>  '''
>  Covoar runner
>  '''
> -def __init__(self, base_result_dir, config_dir, executables, 
> explanations_txt, trace, prefix):
> +def __init__( self,

Extra space?

> +  base_result_dir,
> +  config_dir, executables,
> +  explanations_txt,
> +  trace,
> +  prefix,
> +  bsp ):
>  self.base_result_dir = base_result_dir
>  self.config_dir = config_dir
>  self.executables = ' '.join(executables)
> @@ -296,6 +302,7 @@ class covoar(object):
>  self.project_name = 'RTEMS-5'

I had not noticed this before. We should not be hard coding version numbers into
this part of the code. It requires updating after each release and all in likely
hood this one would be missed. The tool kit has support for versions.

>  self.trace = trace
>  self.prefix = prefix
> +self.bsp = bsp
>  
>  def _find_covoar(self):
>  covoar_exe = 'covoar'
> @@ -316,10 +323,18 @@ class covoar(object):
>  if not path.exists(symbol_file):
>  raise error.general('coverage: no symbol set file: %s'% 
> (symbol_file))
>  exe = self._find_covoar()
> -command = exe + ' -S ' + symbol_file + \
> -  ' -O ' + covoar_result_dir + \
> -  ' -E ' + self.explanations_txt + \
> -  ' -p ' + self.project_name + ' ' + self.executables
> +if 'qemu' in self.bsp.split('-'):

Are you checking for 'qemu' in the BSP name? The naming used here is a
convention and making the code depend on a naming convention is fragile. Lets
not do this.

There is a `%{qemu-cmd}` macro defined which must exist for a qemu run so it is
better to check for this. However ...

> +command = exe + ' -S ' + symbol_file + \
> +  ' -O ' + covoar_result_dir + \
> +  ' -E ' + self.explanations_txt + \
> +  ' -p ' + self.project_name + ' ' + self.executables
> +else:
> +command = exe + ' -S ' + symbol_file + \
> +  ' -O ' + covoar_result_dir + \
> +  ' -E ' + self.explanations_txt + \
> +  ' -f TSIM' + \
> +  ' -p ' + self.project_name + ' ' + self.executables

... I would prefer the command be managed in the config files and this code
removed. Do you think this can be done?

Thanks
Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] Coverage: Add support for TSIM format

2019-02-01 Thread Vijay Kumar Banerjee
---
 tester/rt/coverage.py   | 28 -
 tester/rtems/testing/bsps/leon3-sis-cov.ini |  3 ++-
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
index 9fc9b64..859001a 100644
--- a/tester/rt/coverage.py
+++ b/tester/rt/coverage.py
@@ -288,7 +288,13 @@ class covoar(object):
 '''
 Covoar runner
 '''
-def __init__(self, base_result_dir, config_dir, executables, 
explanations_txt, trace, prefix):
+def __init__( self,
+  base_result_dir,
+  config_dir, executables,
+  explanations_txt,
+  trace,
+  prefix,
+  bsp ):
 self.base_result_dir = base_result_dir
 self.config_dir = config_dir
 self.executables = ' '.join(executables)
@@ -296,6 +302,7 @@ class covoar(object):
 self.project_name = 'RTEMS-5'
 self.trace = trace
 self.prefix = prefix
+self.bsp = bsp
 
 def _find_covoar(self):
 covoar_exe = 'covoar'
@@ -316,10 +323,18 @@ class covoar(object):
 if not path.exists(symbol_file):
 raise error.general('coverage: no symbol set file: %s'% 
(symbol_file))
 exe = self._find_covoar()
-command = exe + ' -S ' + symbol_file + \
-  ' -O ' + covoar_result_dir + \
-  ' -E ' + self.explanations_txt + \
-  ' -p ' + self.project_name + ' ' + self.executables
+if 'qemu' in self.bsp.split('-'):
+command = exe + ' -S ' + symbol_file + \
+  ' -O ' + covoar_result_dir + \
+  ' -E ' + self.explanations_txt + \
+  ' -p ' + self.project_name + ' ' + self.executables
+else:
+command = exe + ' -S ' + symbol_file + \
+  ' -O ' + covoar_result_dir + \
+  ' -E ' + self.explanations_txt + \
+  ' -f TSIM' + \
+  ' -p ' + self.project_name + ' ' + self.executables
+
 log.notice()
 log.notice('Running coverage analysis: %s (%s)' % (set_name, 
covoar_result_dir))
 start_time = datetime.datetime.now()
@@ -382,7 +397,8 @@ class coverage_run(object):
 covoar_runner = covoar(self.test_dir, self.symbol_select_path,
self.executables, self.explanations_txt,
self.trace,
-   self.prefix)
+   self.prefix,
+   self.macros['bsp'])
 covoar_runner.run(sset, self.symbol_select_path)
 self._generate_reports(symbol_sets);
 self._summarize();
diff --git a/tester/rtems/testing/bsps/leon3-sis-cov.ini 
b/tester/rtems/testing/bsps/leon3-sis-cov.ini
index f0a2ab9..39fc159 100644
--- a/tester/rtems/testing/bsps/leon3-sis-cov.ini
+++ b/tester/rtems/testing/bsps/leon3-sis-cov.ini
@@ -32,8 +32,9 @@
 # The leon3 BSP on sis with coverage
 #
 [leon3-sis-cov]
-bsp  = leon3
+bsp  = leon3-sis
 arch = sparc
 tester   = %{_rtscripts}/run.cfg
+target   = sparc-rtems5
 bsp_run_cmd  = %{rtems_tools}/%{bsp_arch}-rtems%{rtems_version}-sis
 bsp_run_opts = -leon3 -nouartrx -r -tlim 200 s -cov
-- 
2.17.2

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel