[PATCH v2] Coverage: Add support to generate separate reports for each symbol-set

Vijay Kumar Banerjee vijaykumar9597 at gmail.com
Thu Aug 2 21:45:11 UTC 2018


Hello,

If you find some time, please do a final review of this patch and provide
suggestions if it's not mergeable yet :)

There are only three days left, I seek some advice on the wrapup work on
coverage
analysis . The current status is :

* This patch adds support to generate separate report for each symbol-sets.

* I sent a patch a day ago with the symbol-sets and the respective libraray
  addresses added to the symbol-sets.ini file. I have also attached a
screenshot of the report.
  Joel, does the report look good to you ?
  What are the next steps to get the reports published ? Is it intended to
be a
  post GSoC work ?

* I have completed the dumper for gcno files. There are still more
understanding
  needed to make sense out of the data, but all the data can be dumped in a
human
  readable format now. Please have a look at the  generated txt file.
  https://github.com/thelunatic/gcno_dumper/blob/master/gcno_dump.txt
<https://github.com/thelunatic/gcno_dumper/blob/master/gcno_dump.txt>

*  Any other suggestions ?

Thanks
--vijayk

On 30 July 2018 at 22:55, Vijay Kumar Banerjee <vijaykumar9597 at gmail.com>
wrote:

> Invoke covoar multiple times from the script to generate separate
> reports for each symbol-set.
> ---
>  tester/rt/coverage.py | 38 ++++++++++++++++++--------------------
>  1 file changed, 18 insertions(+), 20 deletions(-)
>
> diff --git a/tester/rt/coverage.py b/tester/rt/coverage.py
> index 7dd5002..c979332 100644
> --- a/tester/rt/coverage.py
> +++ b/tester/rt/coverage.py
> @@ -99,8 +99,8 @@ class summary:
>          return line.strip().split(' ')[0]
>
>  class report_gen_html:
> -    def __init__(self, p_symbol_sets_list, build_dir, rtdir, bsp):
> -        self.symbol_sets_list = ['score']
> +    def __init__(self, symbol_sets, build_dir, rtdir, bsp):
> +        self.symbol_sets = symbol_sets
>          self.build_dir = build_dir
>          self.partial_reports_files = list(['index.html', 'summary.txt'])
>          self.number_of_columns = 1
> @@ -109,7 +109,7 @@ class report_gen_html:
>
>      def _find_partial_reports(self):
>          partial_reports = {}
> -        for symbol_set in self.symbol_sets_list:
> +        for symbol_set in self.symbol_sets:
>              set_summary = summary(path.join(self.bsp + "-coverage",
>                                              symbol_set))
>              set_summary.parse()
> @@ -204,7 +204,7 @@ class report_gen_html:
>      def add_covoar_src_path(self):
>          table_js_path = path.join(self.covoar_src_path, 'table.js')
>          covoar_css_path = path.join(self.covoar_src_path, 'covoar.css')
> -        for symbol_set in self.symbol_sets_list:
> +        for symbol_set in self.symbol_sets:
>              symbol_set_dir = path.join(self.build_dir,
>                                         self.bsp + '-coverage', symbol_set)
>              html_files = os.listdir(symbol_set_dir)
> @@ -264,27 +264,23 @@ class symbol_parser(object):
>              for sset in self.ssets:
>                  lib = path.join(self.build_dir, config.get('libraries',
> sset))
>                  self.symbol_sets[sset] = lib.encode('utf-8')
> +            return self.ssets
>          except:
>              raise error.general('Symbol set parsing failed')
>
> -    def _write_ini(self):
> +    def write_ini(self, symbol_set):
>          config = configparser.ConfigParser()
>          try:
> -            sets = ', '.join(self.symbol_sets.keys())
> +            sset = symbol_set
>              config.add_section('symbol-sets')
> -            config.set('symbol-sets', 'sets', sets)
> -            for key in self.symbol_sets.keys():
> -                config.add_section(key)
> -                config.set(key, 'libraries', self.symbol_sets[key])
> +            config.set('symbol-sets', 'sets', sset)
> +            config.add_section(sset)
> +            config.set(sset, 'libraries', self.symbol_sets[sset])
>              with open(self.symbol_select_file, 'w') as conf:
>                  config.write(conf)
>          except:
>              raise error.general('symbol parser write failed')
>
> -    def run(self):
> -        self.parse()
> -        self._write_ini()
> -
>  class covoar(object):
>      '''
>      Covoar runner
> @@ -371,20 +367,22 @@ class coverage_run(object):
>                                     self.symbol_select_path,
>                                     self.symbol_set,
>                                     build_dir)
> -            parser.run()
> -            covoar_runner = covoar(self.test_dir, self.symbol_select_path,
> +            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,
>                                     self.trace)
> -            covoar_runner.run('score', self.symbol_select_path)
> -            self._generate_reports();
> +                covoar_runner.run(sset, self.symbol_select_path)
> +            self._generate_reports(symbol_sets);
>              self._summarize();
>          finally:
>              self._cleanup();
>
> -    def _generate_reports(self):
> +    def _generate_reports(self, symbol_sets):
>          log.notice('Coverage generating reports')
>          if self.report_format == 'html':
> -            report = report_gen_html(self.symbol_sets,
> +            report = report_gen_html(symbol_sets,
>                                       self.build_dir,
>                                       self.rtdir,
>                                       self.macros['bsp'])
> --
> 2.14.4
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20180803/7030cc5d/attachment-0001.html>


More information about the devel mailing list