[PATCH] Coverage: Add support for TSIM format

Chris Johns chrisj at rtems.org
Tue Feb 5 21:05:23 UTC 2019


On 6/2/19 1:41 am, Vijay Kumar Banerjee wrote:
> On Tue, 5 Feb 2019 at 03:37, Chris Johns <chrisj at rtems.org
> <mailto:chrisj at 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.

Chris



More information about the devel mailing list