summaryrefslogtreecommitdiffstats
path: root/tester/covoar/DesiredSymbols.h
diff options
context:
space:
mode:
authorAlex White <alex.white@oarcorp.com>2021-04-02 16:21:43 -0500
committerJoel Sherrill <joel@rtems.org>2021-04-06 14:18:55 -0500
commitb02600a6bbc4d0524b731e504c91bc293d70a354 (patch)
tree3a3156d9013552231fd89ddc203dda3032b7def0 /tester/covoar/DesiredSymbols.h
parentcovoar: Fix off-by-one in Coverage::finalizeSymbol() (diff)
downloadrtems-tools-b02600a6bbc4d0524b731e504c91bc293d70a354.tar.bz2
covoar: Split symbols by symbol set
This changes the way covoar organizes the symbols. Instead of treating all symbols as one set, covoar is now aware of multiple symbol sets and tracks statistics for each set. It now also generates reports for each symbol set. This change relieves the caller of covoar of the reponsibility of managing the symbol sets. As a result, covoar can minimize the work done for each symbol set, yielding a significant speedup. Updates #4374
Diffstat (limited to 'tester/covoar/DesiredSymbols.h')
-rw-r--r--tester/covoar/DesiredSymbols.h98
1 files changed, 75 insertions, 23 deletions
diff --git a/tester/covoar/DesiredSymbols.h b/tester/covoar/DesiredSymbols.h
index 5cf96e9..411b818 100644
--- a/tester/covoar/DesiredSymbols.h
+++ b/tester/covoar/DesiredSymbols.h
@@ -198,12 +198,6 @@ namespace Coverage {
typedef std::map<std::string, SymbolInformation> symbolSet_t;
/*!
- * This variable contains a map of symbol sets for each
- * symbol in the system keyed on the symbol name.
- */
- symbolSet_t set;
-
- /*!
* This method constructs a DesiredSymbols instance.
*/
DesiredSymbols();
@@ -214,6 +208,11 @@ namespace Coverage {
~DesiredSymbols();
/*!
+ * The set of all symbols.
+ */
+ const symbolSet_t& allSymbols() const;
+
+ /*!
* This method loops through the coverage map and
* calculates the statistics that have not already
* been filled in.
@@ -262,51 +261,93 @@ namespace Coverage {
/*!
* This method returns the total number of branches always taken
- * for all analyzed symbols.
+ * for all analyzed symbols in a given set.
+ *
+ * @param[in] symbolSetName specifies the symbol set of interest
*
* @return Returns the total number of branches always taken
*/
- uint32_t getNumberBranchesAlwaysTaken( void ) const;
+ uint32_t getNumberBranchesAlwaysTaken(
+ const std::string& symbolSetName
+ ) const;
/*!
* This method returns the total number of branches found for
- * all analyzed symbols.
+ * all analyzed symbols in a given set.
+ *
+ * @param[in] symbolSetName specifies the symbol set of interest
*
* @return Returns the total number of branches found
*/
- uint32_t getNumberBranchesFound( void ) const;
+ uint32_t getNumberBranchesFound(
+ const std::string& symbolSetName
+ ) const;
/*!
* This method returns the total number of branches never taken
- * for all analyzed symbols.
+ * for all analyzed symbols in a given set.
+ *
+ * @param[in] symbolSetName specifies the symbol set of interest
*
* @return Returns the total number of branches never taken
*/
- uint32_t getNumberBranchesNeverTaken( void ) const;
+ uint32_t getNumberBranchesNeverTaken(
+ const std::string& symbolSetName
+ ) const;
/*!
* This method returns the total number of branches not executed
- * for all analyzed symbols.
+ * for all analyzed symbols in a given set.
+ *
+ * @param[in] symbolSetName specifies the symbol set of interest
*
* @return Returns the total number of branches not executed
*/
- uint32_t getNumberBranchesNotExecuted( void ) const;
+ uint32_t getNumberBranchesNotExecuted(
+ const std::string& symbolSetName
+ ) const;
/*!
* This method returns the total number of uncovered ranges
- * for all analyzed symbols.
+ * for all analyzed symbols in a given set.
+ *
+ * @param[in] symbolSetName specifies the symbol set of interest
*
* @return Returns the total number of uncovered ranges
*/
- uint32_t getNumberUncoveredRanges( void ) const;
+ uint32_t getNumberUncoveredRanges(
+ const std::string& symbolSetName
+ ) const;
/*!
* This method returns the total number of unreferenced symbols
- * for all analyzed symbols.
+ * for all analyzed symbols in a given set.
+ *
+ * @param[in] symbolSetName specifies the symbol set of interest
*
* @return Returns the total number of unreferenced symbols
*/
- uint32_t getNumberUnreferencedSymbols( void ) const;
+ uint32_t getNumberUnreferencedSymbols(
+ const std::string& symbolSetName
+ ) const;
+
+ /*!
+ * This method returns all symbol set names.
+ *
+ * @return Returns all symbol set names
+ */
+ std::vector<std::string> getSetNames( void ) const;
+
+ /*!
+ * This method returns all symbols for a given set.
+ *
+ * @param[in] symbolSetName specifies the symbol set of interest
+ *
+ * @return Returns all symbols for the given set
+ */
+ const std::vector<std::string>& getSymbolsForSet(
+ const std::string& symbolSetName
+ ) const;
/*!
* This method returns an indication of whether or not the specified
@@ -353,11 +394,6 @@ namespace Coverage {
*/
void preprocess( void );
- /*!
- * This member contains the statistics kept on each symbol.
- */
- Statistics stats;
-
private:
/*!
@@ -369,6 +405,22 @@ namespace Coverage {
ExecutableInfo* const theExecutable
);
+ /*!
+ * This variable contains a map of symbol sets for each
+ * symbol in the system keyed on the symbol name.
+ */
+ symbolSet_t set;
+
+ /*!
+ * This variable contains a map of symbol set names to symbol name lists.
+ */
+ std::map<std::string, std::vector<std::string>> setNamesToSymbols;
+
+ /*!
+ * This member contains a map of symbol set names to statistics.
+ */
+ std::map<std::string, Statistics> stats;
+
};
}