Skip to content
Snippets Groups Projects
Commit dda3689a authored by Jan Trávníček's avatar Jan Trávníček
Browse files

make measurements library independent from std ext

parent 8c5e4809
No related branches found
No related tags found
No related merge requests found
Showing
with 52 additions and 47 deletions
LIBRARY:=alib2algo LIBRARY:=alib2algo
TESTBIN:=alib2test TESTBIN:=alib2test
LINK_PATHS=../alib2str/ ../alib2data/ ../alib2xml/ ../alib2measure/ ../alib2common/ ../alib2std/ LINK_PATHS=../alib2str/ ../alib2data/ ../alib2xml/ ../alib2common/ ../alib2std/ ../alib2measure/
LINK_LIBRARIES=alib2str alib2data alib2xml alib2measure alib2common alib2std xml2 LINK_LIBRARIES=alib2str alib2data alib2xml alib2common alib2std alib2measure xml2
INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2str/src/ \$$(SOURCES_BASE_DIR)/../../alib2data/src/ \$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src/ /usr/include/libxml2/ INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2str/src/ \$$(SOURCES_BASE_DIR)/../../alib2data/src/ \$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src/ \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ /usr/include/libxml2/
LIBRARY:=alib2algo_experimental LIBRARY:=alib2algo_experimental
TESTBIN:=alib2test TESTBIN:=alib2test
LINK_PATHS=../alib2algo/ ../alib2str/ ../alib2data_experimental/ ../alib2data/ ../alib2xml/ ../alib2measure/ ../alib2common/ ../alib2std/ LINK_PATHS=../alib2algo/ ../alib2str/ ../alib2data_experimental/ ../alib2data/ ../alib2xml/ ../alib2common/ ../alib2std/ ../alib2measure/
LINK_LIBRARIES=alib2algo alib2str alib2data_experimental alib2data alib2xml alib2measure alib2common alib2std xml2 LINK_LIBRARIES=alib2algo alib2str alib2data_experimental alib2data alib2xml alib2common alib2std alib2measure xml2
INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2algo/src/ \$$(SOURCES_BASE_DIR)/../../alib2str/src/ \$$(SOURCES_BASE_DIR)/../../alib2data_experimental/src/ \$$(SOURCES_BASE_DIR)/../../alib2data/src/ \$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src/ /usr/include/libxml2/ INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2algo/src/ \$$(SOURCES_BASE_DIR)/../../alib2str/src/ \$$(SOURCES_BASE_DIR)/../../alib2data_experimental/src/ \$$(SOURCES_BASE_DIR)/../../alib2data/src/ \$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src/ \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ /usr/include/libxml2/
LIBRARY:=alib2aux LIBRARY:=alib2aux
TESTBIN:=alib2test TESTBIN:=alib2test
LINK_PATHS=../alib2str/ ../alib2data/ ../alib2xml/ ../alib2measure/ ../alib2common/ ../alib2std/ LINK_PATHS=../alib2str/ ../alib2data/ ../alib2xml/ ../alib2common/ ../alib2std/ ../alib2measure/
LINK_LIBRARIES=alib2str alib2data alib2xml alib2measure alib2common alib2std xml2 LINK_LIBRARIES=alib2str alib2data alib2xml alib2common alib2std alib2measure xml2
INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2str/src/ \$$(SOURCES_BASE_DIR)/../../alib2data/src/ \$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src/ /usr/include/libxml2/ INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2str/src/ \$$(SOURCES_BASE_DIR)/../../alib2data/src/ \$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src/ \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ /usr/include/libxml2/
LIBRARY:=alib2cli LIBRARY:=alib2cli
TESTBIN:=alib2test TESTBIN:=alib2test
LINK_PATHS=../alib2xml/ ../alib2measure/ ../alib2common/ ../alib2std/ LINK_PATHS=../alib2xml/ ../alib2common/ ../alib2std/ ../alib2measure/
LINK_LIBRARIES=alib2xml alib2measure alib2common alib2std xml2 LINK_LIBRARIES=alib2xml alib2common alib2std alib2measure xml2
INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src/ /usr/include/libxml2/ INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src/ \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ /usr/include/libxml2/
LIBRARY:=alib2common LIBRARY:=alib2common
TESTBIN:=alib2test TESTBIN:=alib2test
LINK_PATHS=../alib2std/ LINK_PATHS=../alib2measure/ ../alib2std/
LINK_LIBRARIES=alib2std LINK_LIBRARIES=alib2measure alib2std
INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2std/src/ INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2measure/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src/
LIBRARY:=alib2data LIBRARY:=alib2data
TESTBIN:=alib2test TESTBIN:=alib2test
LINK_PATHS=../alib2xml/ ../alib2measure/ ../alib2common/ ../alib2std/ LINK_PATHS=../alib2xml/ ../alib2common/ ../alib2std/ ../alib2measure/
LINK_LIBRARIES=alib2xml alib2measure alib2common alib2std xml2 LINK_LIBRARIES=alib2xml alib2common alib2std alib2measure xml2
INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src \$$(SOURCES_BASE_DIR)/../../alib2std/src/ /usr/include/libxml2/ INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ /usr/include/libxml2/
LIBRARY:=alib2data_experimental LIBRARY:=alib2data_experimental
TESTBIN:=alib2test TESTBIN:=alib2test
LINK_PATHS=../alib2data/ ../alib2xml/ ../alib2measure/ ../alib2common/ ../alib2std/ LINK_PATHS=../alib2data/ ../alib2xml/ ../alib2common/ ../alib2std/ ../alib2measure/
LINK_LIBRARIES=alib2data alib2xml alib2measure alib2common alib2std xml2 LINK_LIBRARIES=alib2data alib2xml alib2common alib2std xml2 alib2measure
INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2data/src/ \$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src \$$(SOURCES_BASE_DIR)/../../alib2std/src/ /usr/include/libxml2/ INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2data/src/ \$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ /usr/include/libxml2/
LIBRARY:=alib2elgo LIBRARY:=alib2elgo
TESTBIN:=alib2test TESTBIN:=alib2test
LINK_PATHS=../alib2algo/ ../alib2str/ ../alib2data/ ../alib2xml/ ../alib2measure/ ../alib2common/ ../alib2std/ LINK_PATHS=../alib2algo/ ../alib2str/ ../alib2data/ ../alib2xml/ ../alib2common/ ../alib2std/ ../alib2measure/
LINK_LIBRARIES=alib2algo alib2str alib2data alib2xml alib2measure alib2common alib2std xml2 LINK_LIBRARIES=alib2algo alib2str alib2data alib2xml alib2common alib2std alib2measure xml2
INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2algo/src/ \$$(SOURCES_BASE_DIR)/../../alib2str/src/ \$$(SOURCES_BASE_DIR)/../../alib2data/src/ \$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src/ /usr/include/libxml2/ INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2algo/src/ \$$(SOURCES_BASE_DIR)/../../alib2str/src/ \$$(SOURCES_BASE_DIR)/../../alib2data/src/ \$$(SOURCES_BASE_DIR)/../../alib2xml/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src/ \$$(SOURCES_BASE_DIR)/../../alib2measure/src/ /usr/include/libxml2/
LIBRARY:=alib2measure LIBRARY:=alib2measure
TESTBIN:=alib2test TESTBIN:=alib2test
LINK_PATHS=../alib2common/ ../alib2std/ LINK_PATHS=
LINK_LIBRARIES=alib2common alib2std LINK_LIBRARIES=
INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src/ INCLUDE_PATHS=
...@@ -20,10 +20,10 @@ std::string to_string ( stealth_string & ); ...@@ -20,10 +20,10 @@ std::string to_string ( stealth_string & );
stealth_string stealthStringFromString ( const std::string & ); stealth_string stealthStringFromString ( const std::string & );
   
template < typename T > template < typename T >
using stealth_vector = ext::vector < T, stealth_allocator < T > >; using stealth_vector = std::vector < T, stealth_allocator < T > >;
   
template < class Key, class T, class Compare = std::less < Key > > template < class Key, class T, class Compare = std::less < Key > >
using stealth_map = ext::map < Key, T, Compare, stealth_allocator < std::pair < const Key, T > > >; using stealth_map = std::map < Key, T, Compare, stealth_allocator < std::pair < const Key, T > > >;
} }
   
#endif /* STEALTH_TYPES_HPP_ */ #endif /* STEALTH_TYPES_HPP_ */
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
* Author: Radovan Cerveny * Author: Radovan Cerveny
*/ */
   
#ifdef __clang__
#include <cstdlib> #include <cstdlib>
#include <new> #include <new>
#include "../measurements/MeasurementNew.hpp" #include "../measurements/MeasurementNew.hpp"
...@@ -19,5 +17,3 @@ void operator delete( void * ptr ) noexcept { ...@@ -19,5 +17,3 @@ void operator delete( void * ptr ) noexcept {
void operator delete( void * ptr, std::size_t ) noexcept { void operator delete( void * ptr, std::size_t ) noexcept {
operator delete( ptr, true ); operator delete( ptr, true );
} }
#endif
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
*/ */
   
#include "MeasurementEngine.hpp" #include "MeasurementEngine.hpp"
#include <exception/CommonException.h> #include <stdexcept>
   
namespace measurements { namespace measurements {
   
...@@ -40,7 +40,7 @@ void MeasurementEngine::popMeasurementFrame ( ) { ...@@ -40,7 +40,7 @@ void MeasurementEngine::popMeasurementFrame ( ) {
unsigned currentIdx = frameIdxStack.back ( ); unsigned currentIdx = frameIdxStack.back ( );
   
if ( frames[currentIdx].type == measurements::Type::ROOT ) if ( frames[currentIdx].type == measurements::Type::ROOT )
throw::exception::CommonException ( "MeasurementEngine: popMeasurementFrame failed, no measurements started" ); throw std::domain_error ( "MeasurementEngine: popMeasurementFrame failed, no measurements started" );
   
frameIdxStack.pop_back ( ); frameIdxStack.pop_back ( );
   
......
...@@ -17,11 +17,20 @@ std::ostream & operator <<( std::ostream & os, const MeasurementFrame & frame ) ...@@ -17,11 +17,20 @@ std::ostream & operator <<( std::ostream & os, const MeasurementFrame & frame )
   
ss << "(TIME: " << frame.time << "), (MEM: " << frame.memory << "), (COUNTER: " << frame.counter << ")"; ss << "(TIME: " << frame.time << "), (MEM: " << frame.memory << "), (COUNTER: " << frame.counter << ")";
   
os << ext::make_tuple ( frame.name, frame.type, frame.parentIdx, frame.subIdxs, ss.str ( ) ); os << "(" << frame.name << ", " << frame.type << ", " << frame.parentIdx << ", [";
bool first = true;
for ( int subId : frame.subIdxs ) {
if ( first )
first = false;
else
os << ", ";
os << subId;
}
os << "], " << ss.str ( ) << ")";
return os; return os;
} }
   
MeasurementFrame MeasurementFrame::aggregate ( const ext::vector < MeasurementFrame > & framesToAggregate ) { MeasurementFrame MeasurementFrame::aggregate ( const std::vector < MeasurementFrame > & framesToAggregate ) {
MeasurementFrame aggregatedFrame ( framesToAggregate[0].name, framesToAggregate[0].type, framesToAggregate[0].parentIdx ); MeasurementFrame aggregatedFrame ( framesToAggregate[0].name, framesToAggregate[0].type, framesToAggregate[0].parentIdx );
   
aggregatedFrame.subIdxs = framesToAggregate[0].subIdxs; aggregatedFrame.subIdxs = framesToAggregate[0].subIdxs;
......
...@@ -28,7 +28,7 @@ struct MeasurementFrame { ...@@ -28,7 +28,7 @@ struct MeasurementFrame {
   
MeasurementFrame ( measurements::stealth_string, measurements::Type, unsigned ); MeasurementFrame ( measurements::stealth_string, measurements::Type, unsigned );
   
static MeasurementFrame aggregate ( const ext::vector < MeasurementFrame > & ); static MeasurementFrame aggregate ( const std::vector < MeasurementFrame > & );
}; };
   
std::ostream & operator <<( std::ostream &, const MeasurementFrame & ); std::ostream & operator <<( std::ostream &, const MeasurementFrame & );
......
...@@ -96,13 +96,13 @@ void MeasurementResults::printAsTree ( std::ostream & os, unsigned idx, std::str ...@@ -96,13 +96,13 @@ void MeasurementResults::printAsTree ( std::ostream & os, unsigned idx, std::str
} }
} }
   
MeasurementResults MeasurementResults::aggregate ( const ext::vector < MeasurementResults > & resultsToAggregate ) { MeasurementResults MeasurementResults::aggregate ( const std::vector < MeasurementResults > & resultsToAggregate ) {
MeasurementResults aggregatedResults; MeasurementResults aggregatedResults;
   
size_t frameCount = resultsToAggregate[0].frames.size ( ); size_t frameCount = resultsToAggregate[0].frames.size ( );
   
for ( size_t frameIdx = 0; frameIdx < frameCount; ++frameIdx ) { for ( size_t frameIdx = 0; frameIdx < frameCount; ++frameIdx ) {
ext::vector < MeasurementFrame > framesToAggregate; std::vector < MeasurementFrame > framesToAggregate;
   
for ( const MeasurementResults & measurementResults : resultsToAggregate ) for ( const MeasurementResults & measurementResults : resultsToAggregate )
framesToAggregate.push_back ( measurementResults.frames[frameIdx] ); framesToAggregate.push_back ( measurementResults.frames[frameIdx] );
......
...@@ -28,7 +28,7 @@ struct MeasurementResults { ...@@ -28,7 +28,7 @@ struct MeasurementResults {
void printAsList ( std::ostream & ) const; void printAsList ( std::ostream & ) const;
void printAsTree ( std::ostream & ) const; void printAsTree ( std::ostream & ) const;
   
static MeasurementResults aggregate ( const ext::vector < MeasurementResults > & ); static MeasurementResults aggregate ( const std::vector < MeasurementResults > & );
   
private: private:
void printAsList ( std::ostream &, unsigned ) const; void printAsList ( std::ostream &, unsigned ) const;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Author: Radovan Cerveny * Author: Radovan Cerveny
*/ */
#include "MeasurementTypes.hpp" #include "MeasurementTypes.hpp"
#include <exception/CommonException.h> #include <stdexcept>
   
namespace measurements { namespace measurements {
   
...@@ -33,7 +33,7 @@ std::string to_string ( Type t ) { ...@@ -33,7 +33,7 @@ std::string to_string ( Type t ) {
return "ALGORITHM"; return "ALGORITHM";
} }
   
throw::exception::CommonException ( "Missing case." ); throw std::invalid_argument ( "Missing case." );
} }
   
Type measurementTypeFromString ( const std::string & ts ) { Type measurementTypeFromString ( const std::string & ts ) {
...@@ -53,7 +53,7 @@ Type measurementTypeFromString ( const std::string & ts ) { ...@@ -53,7 +53,7 @@ Type measurementTypeFromString ( const std::string & ts ) {
   
if ( ts == "ALGORITHM" ) return Type::ALGORITHM; if ( ts == "ALGORITHM" ) return Type::ALGORITHM;
   
throw::exception::CommonException ( "measurementTypeFromString failed, unknown measurement type: " + ts ); throw std::invalid_argument ( "measurementTypeFromString failed, unknown measurement type: " + ts );
} }
   
std::ostream & operator <<( std::ostream & os, Type t ) { std::ostream & operator <<( std::ostream & os, Type t ) {
......
...@@ -48,7 +48,7 @@ void CounterDataFrame::hint ( unsigned frameIdx, measurements::stealth_vector < ...@@ -48,7 +48,7 @@ void CounterDataFrame::hint ( unsigned frameIdx, measurements::stealth_vector <
} }
} }
   
CounterDataFrame CounterDataFrame::aggregate ( const ext::vector < MeasurementFrame > & framesToAggregate ) { CounterDataFrame CounterDataFrame::aggregate ( const std::vector < MeasurementFrame > & framesToAggregate ) {
// FIXME dummmy aggregation // FIXME dummmy aggregation
return framesToAggregate[0].counter; return framesToAggregate[0].counter;
} }
......
...@@ -33,7 +33,7 @@ struct CounterDataFrame { ...@@ -33,7 +33,7 @@ struct CounterDataFrame {
static void update ( unsigned, measurements::stealth_vector < MeasurementFrame > & ); static void update ( unsigned, measurements::stealth_vector < MeasurementFrame > & );
static void hint ( unsigned, measurements::stealth_vector < MeasurementFrame > &, CounterHint ); static void hint ( unsigned, measurements::stealth_vector < MeasurementFrame > &, CounterHint );
   
static CounterDataFrame aggregate ( const ext::vector < MeasurementFrame > & ); static CounterDataFrame aggregate ( const std::vector < MeasurementFrame > & );
}; };
   
std::ostream & operator <<( std::ostream &, const CounterDataFrame & ); std::ostream & operator <<( std::ostream &, const CounterDataFrame & );
......
...@@ -64,7 +64,7 @@ void MemoryDataFrame::hint ( unsigned frameIdx, measurements::stealth_vector < M ...@@ -64,7 +64,7 @@ void MemoryDataFrame::hint ( unsigned frameIdx, measurements::stealth_vector < M
} }
} }
   
MemoryDataFrame MemoryDataFrame::aggregate ( const ext::vector < MeasurementFrame > & framesToAggregate ) { MemoryDataFrame MemoryDataFrame::aggregate ( const std::vector < MeasurementFrame > & framesToAggregate ) {
// FIXME dummmy aggregation // FIXME dummmy aggregation
return framesToAggregate[0].memory; return framesToAggregate[0].memory;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment