6 #pragma warning( disable : 4786 )
50 : public
std::binary_function<
55 inline bool operator()
61 const ChronoEntity*
e1 = p1.first;
62 const ChronoEntity* e2 = p2.
first;
63 return ( ( 0 == e1 || 0 == e2 ) ?
true : (*e1)<(*e2) ) ;
71 const std::pair<const StatEntity*,const IChronoStatSvc::StatTag*> ,
72 const std::pair<const StatEntity*,const IChronoStatSvc::StatTag*> , bool >
76 inline bool operator()
84 return ( 0 == se1 || 0 == se2 ) ?
true : (*se1)<(*se2) ;
99 , m_header (
" Counter | # | sum | mean/eff^* | rms/err^* | min | max |")
101 , m_format1 (
" %|-15.15s|%|17t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |" )
103 , m_format2 (
"*%|-15.15s|%|17t||%|10d| |%|11.5g| |(%|#9.7g| +- %|-#9.7g|)%%| ------- | ------- |" )
105 , m_useEffFormat (
true )
108 declareProperty (
"ChronoPrintOutTable" ,
109 m_chronoTableFlag =
true );
111 declareProperty (
"ChronoDestinationCout" ,
112 m_chronoCoutFlag =
false );
114 declareProperty (
"ChronoPrintLevel" ,
118 declareProperty (
"ChronoTableToBeOrdered" ,
119 m_chronoOrderFlag =
true );
121 declareProperty (
"PrintUserTime" ,
122 m_printUserTime =
true );
124 declareProperty (
"PrintSystemTime" ,
125 m_printSystemTime =
false );
127 declareProperty (
"PrintEllapsedTime" ,
128 m_printEllapsedTime =
false );
131 declareProperty (
"StatPrintOutTable" ,
132 m_statTableFlag =
true );
134 declareProperty (
"StatDestinationCout" ,
135 m_statCoutFlag =
false );
137 declareProperty (
"StatPrintLevel" ,
141 declareProperty (
"StatTableToBeOrdered" ,
142 m_statOrderFlag =
true );
146 declareProperty (
"NumberOfSkippedEventsForMemStat" ,
147 m_numberOfSkippedEventsForMemStat = -1 ) ;
149 declareProperty(
"AsciiStatsOutputFile",
150 m_statsOutFileName =
"",
151 "Name of the output file storing the stats. If empty, no"
152 " statistics will be saved (default)" );
155 (
"StatTableHeader" , m_header ,
156 "The header row for the output Stat-table" ) ;
158 (
"RegularRowFormat" , m_format1 ,
159 "The format for the regular row in the output Stat-table" ) ;
161 (
"EfficiencyRowFormat" , m_format2 ,
162 "The format for the regular row in the outptu Stat-table" ) ;
164 (
"UseEfficiencyRowFormat" , m_useEffFormat ,
165 "Use the special format for printout of efficiency counters" ) ;
195 log <<
MSG::INFO <<
" Number of skipped events for MemStat"
249 std::cout << local <<
" The Final CPU consumption (Chrono) Table "
258 <<
" The Final CPU consumption ( Chrono ) Table "
269 { tmpCont.
push_back( MPair( &(it->second) , &(it->first) ) ) ; }
278 for( MCont::iterator iter = tmpCont.begin() ; tmpCont.end() != iter ; ++iter )
281 ChronoEntity* entity = iter->
first ;
if( 0 == entity ) { continue ; }
282 const ChronoTag* tag = iter->second ;
if( 0 == tag ) { continue ; }
306 for( MCont::iterator iter = tmpCont.begin() ; tmpCont.end() != iter ; ++iter )
309 ChronoEntity* entity = iter->
first ;
if( 0 == entity ) { continue ; }
310 const ChronoTag* tag = iter->second ;
if( 0 == tag ) { continue ; }
334 for( MCont::iterator iter = tmpCont.begin() ; tmpCont.end() != iter ; ++iter )
337 ChronoEntity* entity = iter->
first ;
if( 0 == entity ) { continue ; }
338 const ChronoTag* tag = iter->second ;
if( 0 == tag ) { continue ; }
380 ChronoEntity& entity = m_chronoEntities [ chronoTag ] ;
391 ChronoEntity& entity = m_chronoEntities [ chronoTag ] ;
403 return m_chronoEntities[ chronoTag ].delta( theType );
412 if( m_printUserTime ) {
414 << m_chronoEntities[ chronoTag ].outputUserTime ()
417 if( m_printSystemTime ) {
419 << m_chronoEntities[ chronoTag ].outputSystemTime()
429 {
return m_chronoEntities[ chronoTag ].status(); }
441 if (theIter==m_statEntities.end()){
443 StatEntity& theSe = m_statEntities[ statTag ];
450 theStat=&((*theIter).second);
453 theStat->
addFlag ( statFlag ) ;
462 log << (
MSG::Level) m_statPrintLevel << m_statEntities[ statTag ] <<
endmsg;
475 if ( m_chronoEntities.end() != it ) {
return &(it->second) ; }
489 if ( m_statEntities.end() != it ) {
return &(it->second) ; }
502 <<
"Could not open the output file for writing chrono statistics ["
518 chronos.
push_back( MPair( &(it->second) , &(it->first) ) ) ;
527 for( MCont::iterator iter = chronos.begin() ;
528 chronos.end() != iter;
531 const ChronoEntity* entity = iter->
first;
532 if( 0 == entity ) { continue ; }
535 if( 0 == tag ) { continue ; }
538 out <<
"\n[" << *tag <<
"]\n";
541 out <<
"cpu_user_total = " << entity->
uTotalTime() <<
"\n";
542 out <<
"cpu_user_min = " << entity->
uMinimalTime() <<
"\n";
543 out <<
"cpu_user_mean = " << entity->
uMeanTime() <<
"\n";
544 out <<
"cpu_user_RMS = " << entity->
uRMSTime() <<
"\n";
545 out <<
"cpu_user_max = " << entity->
uMaximalTime() <<
"\n";
550 out <<
"cpu_system_total = " << entity->
kTotalTime() <<
"\n";
551 out <<
"cpu_system_min = " << entity->
kMinimalTime() <<
"\n";
552 out <<
"cpu_system_mean = " << entity->
kMeanTime() <<
"\n";
553 out <<
"cpu_system_RMS = " << entity->
kRMSTime() <<
"\n";
554 out <<
"cpu_system_max = " << entity->
kMaximalTime() <<
"\n";
559 out <<
"cpu_real_total = " << entity->
eTotalTime() <<
"\n";
560 out <<
"cpu_real_min = " << entity->
eMinimalTime() <<
"\n";
561 out <<
"cpu_real_mean = " << entity->
eMeanTime() <<
"\n";
562 out <<
"cpu_real_RMS = " << entity->
eRMSTime() <<
"\n";
563 out <<
"cpu_real_max = " << entity->
eMaximalTime() <<
"\n";
604 { tmpCont.
push_back( SPair( &(it->second) , &(it->first) ) ) ; }
618 for ( SCont::iterator iter = tmpCont.begin() ; tmpCont.end() != iter ; ++iter )
622 if ( 0 == entity ) { continue ; }
623 const StatTag* tag = iter->second ;
624 if ( 0 == tag ) { continue ; }