aboutsummaryrefslogtreecommitdiffstats
path: root/tools/coverage.py
Commit message (Collapse)AuthorAgeFilesLines
* [coverage] Move coverage generator in it's own folderKevin Rocard2014-02-121-1048/+0
| | | | | | | | | | | | | | | | | | | | BZ: 115218 The coverage report generated script was in the tools folder. Other files will be used for coverage reports. Create a coverage folder in order to contain all coverage report utilities. Change-Id: I23ed75fb109cd4a5f6804398ef17d99e046fd49d Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/114667 Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* [coverage] Create a root element with coverage attributesKevin Rocard2014-02-121-9/+8
| | | | | | | | | | | | | | | | | | | | BZ: 115218 The exported xml coverage report root element did not contain any attributes thus the total coverage was not outputted. Use the base export to xml - modified to use an existing node - to export the root element. Change-Id: I706a45159ae0af5a1b353f7776f62dab3c64f3f5 Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/114695 Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: De Chivre, Renaud <renaud.de.chivre@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* [coverage] Lazy rule evaluationKevin Rocard2014-02-121-4/+7
| | | | | | | | | | | | | | | | | | BZ: 115218 The all and any rule were not lazy. This was a mismatch with the PFW. Make all and any compound rules lazy. Change-Id: If29e3b3f888be40ebf4027d318ae6017396d4d7b Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/114694 Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: De Chivre, Renaud <renaud.de.chivre@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* [Coverage] Change coverage calculation algorithmKevin Rocard2014-02-121-10/+14
| | | | | | | | | | | | | | | | | | | | | BZ: 115218 The coverage was the number of children used divided by the number of children. This was a mistake as a child could have been used despite that all it's descendants might not have been. With this patch the coverage of an element is the coverage children average. Change-Id: I52c9990bec0ed006c70a27aa174898b96829baf5 Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/114693 Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: De Chivre, Renaud <renaud.de.chivre@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* [coverage] Delete useless log message to gain performanceKevin Rocard2014-02-121-6/+1
| | | | | | | | | | | | | | | | | | | | | BZ: 115218 The __eq__ function is very used (1M time in my test), but cProfile showed that it was one of the most slow functions (in cumulate time). Delete useless log in the function in order to gain 90% performance (10s to 1s in cumulate time). Change-Id: I1ece15186cb30947f2c2af277cd0b326ea72c7ea Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/112933 Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* [coverage] Set the default error filter level to errorKevin Rocard2014-02-121-3/+3
| | | | | | | | | | | | | | | | | | | BZ: 115218 The default log filter level was set to warning or info, depending on the libraries availables. Set it always to error. Change-Id: I939165f881095798eea874c2c268cfffcf6187fe Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/112715 Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* [coverage] Add flags to ignore errorsKevin Rocard2014-02-121-6/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | BZ: 115218 2 errors can be raised when parsing PFW logs: - criterion that change their state that is not allowed. The PFW allows an exclusive criterion to be in the none state. - configuration not applicable according to the criterion states that are however applied. It happens in case of log corruption (log lines missing). The user should be able to ignore those 2 errors if low coverage accuracy is allowed. Add the flags: --ignore-incoherent-criterion-state --ignore-ineligible-configuration-application Change-Id: I1a25b47a05e974d711b735e344f9352904c8771b Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/112714 Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* [Coverage] Reset criterion on it's recreationKevin Rocard2014-02-121-1/+11
| | | | | | | | | | | | | | | | | | BZ: 115218 The script was not handling criterion recreation (usually on PFW restart). Reset criterion on it's recreation. Change-Id: I169717c1c62f89ce81b21909f3ee4b981d5e91d8 Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/112713 Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* [Coverage] Raise duplicated criterion specialised exceptionKevin Rocard2014-02-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | | BZ: 115218 When an element is requested to adopt multiple times the same element, the "DuplicatedChildError" exception is raised. However, in case of PFW restart, existing criteria are recreated, which is throwing the generic "DuplicatedChildError" exception. As such event need to be detected, specialise the "DuplicatedChildError" exception in "DuplicatedCriterionError" in order to catch the event easily. Change-Id: Ib0cca1d318233ca0b2f69fd277740ce8f5a550ad Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/112712 Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* [Coverage] Support criterion incoherent stateKevin Rocard2014-02-121-11/+30
| | | | | | | | | | | | | | | | | | | | BZ: 115218 In case of incoherent log (corrupted), some transitions described in the log are not permitted by the internal criterion state machine. Resulting in raising an exception and stopping the program. Add an optional parameter to ignore integrity. Change-Id: I288c0e482b223aa0023e09fb158036b39d0ed8bf Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/112711 Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* [Coverage] Move exception class in the relevant classKevin Rocard2014-02-121-13/+17
| | | | | | | | | | | | | | | | | | | BZ: 115218 Some exceptions were raised only by a particular class. As a result they were polluting the global namespace. Nested the exception class. Change-Id: Icde35d8d2f551a638b97d94bc0a770f70787c723 Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/112710 Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* [Coverage] Delete dangerous assert, raise exceptionKevin Rocard2014-02-121-2/+0
| | | | | | | | | | | | | | | | | | | | BZ: 115218 An assert was checking function input parameters that came from an input file. As a result an corrupted file would stop the program without the opportunity to catch the error. Remove the assert and let the function raise the appropriate exception. Change-Id: Ic8d8d318ca191040c546e354c0911d56670b1030 Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/112709 Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* [Coverage] Delete useless bracketsKevin Rocard2014-02-121-4/+2
| | | | | | | | | | | | | | | | | | | BZ: 115218 Some brackets around return value were used to wrap lines that did not need to be wrapped. Unwrap lines and delete the brackets. Change-Id: I7583deff42b8b4db1ef7dbb61f24329dec908ec3 Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/112708 Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com> Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* PFW: [coverage] Support new log syntax & error handlingKevin Rocard2014-02-121-43/+62
| | | | | | | | | | | | | | | | | | | | BZ: 86781 Support of last change criterion syntax log, - old log line: Selection criterion changed event: (.*) = (.*) - new log line: Selection criterion changed event: Criterion name: (.*), current state: (.*) Change-Id: I626ca7e5dd6deb34fda041a6e9448012b7db62e1 Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/91820 Reviewed-by: Wagner, David <david.wagner@intel.com> Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Tested-by: Barthes, FabienX <fabienx.barthes@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* PFW: Correct log level coverage scriptKevin Rocard2014-02-121-13/+31
| | | | | | | | | | | | | | BZ: 85983 Restrict debug log print to debug log level. Change-Id: I78bb79909502035247f410e9900a560190ee0ad5 Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/90085 Reviewed-by: Centelles, Sylvain <sylvain.centelles@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* PFW: Add licence header in coverage toolKevin Rocard2014-02-121-0/+20
| | | | | | | | | | | | | | | | | | | | BZ: 85983 Add a copyright header to the xml coverage generator script, coverage.py : INTEL CONFIDENTIAL Copyright 2013 Intel Corporation All Rights Reserved. ... Change-Id: I8a5efd67fd3a0603c50a05318f7aec8277689630 Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Reviewed-on: http://android.intel.com:8080/91036 Reviewed-by: Gonzalve, Sebastien <sebastien.gonzalve@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
* PFW: XML coverage tool for domains and criterionsKevin Rocard2014-02-121-0/+913
BZ: 77959 Add a python3 script to generate a PFW setting/configuration/citerion coverage report in XML from the PFW log. Change-Id: I013b033aa8414431d892bc953d9584f78ff44cd0 Reviewed-on: http://android.intel.com:8080/81831 Reviewed-by: Rocard, KevinX <kevinx.rocard@intel.com> Reviewed-by: Centelles, Sylvain <sylvain.centelles@intel.com> Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com> Reviewed-by: cactus <cactus@intel.com> Tested-by: cactus <cactus@intel.com>