2 #pragma warning( disable : 4786 )
46 : public
std::binary_function<
51 inline bool operator()
57 const ChronoEntity*
e1 = p1.first;
58 const ChronoEntity* e2 = p2.
first;
59 return ( ( 0 == e1 || 0 == e2 ) ?
true : (*e1)<(*e2) ) ;
67 const std::pair<const StatEntity*,const IChronoStatSvc::StatTag*> ,
68 const std::pair<const StatEntity*,const IChronoStatSvc::StatTag*> , bool >
72 inline bool operator()
80 return ( 0 == se1 || 0 == se2 ) ?
true : (*se1)<(*se2) ;
95 , m_header (
" Counter | # | sum | mean/eff^* | rms/err^* | min | max |")
97 , m_format1 (
" %|-15.15s|%|17t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |" )
99 , m_format2 (
"*%|-15.15s|%|17t||%|10d| |%|11.5g| |(%|#9.7g| +- %|-#9.7g|)%%| ------- | ------- |" )
101 , m_useEffFormat (
true )
104 declareProperty (
"ChronoPrintOutTable" ,
105 m_chronoTableFlag =
true );
107 declareProperty (
"ChronoDestinationCout" ,
108 m_chronoCoutFlag =
false );
110 declareProperty (
"ChronoPrintLevel" ,
114 declareProperty (
"ChronoTableToBeOrdered" ,
115 m_chronoOrderFlag =
true );
117 declareProperty (
"PrintUserTime" ,
118 m_printUserTime =
true );
120 declareProperty (
"PrintSystemTime" ,
121 m_printSystemTime =
false );
123 declareProperty (
"PrintEllapsedTime" ,
124 m_printEllapsedTime =
false );
127 declareProperty (
"StatPrintOutTable" ,
128 m_statTableFlag =
true );
130 declareProperty (
"StatDestinationCout" ,
131 m_statCoutFlag =
false );
133 declareProperty (
"StatPrintLevel" ,
137 declareProperty (
"StatTableToBeOrdered" ,
138 m_statOrderFlag =
true );
142 declareProperty (
"NumberOfSkippedEventsForMemStat" ,
143 m_numberOfSkippedEventsForMemStat = -1 ) ;
145 declareProperty(
"AsciiStatsOutputFile",
146 m_statsOutFileName =
"",
147 "Name of the output file storing the stats. If empty, no"
148 " statistics will be saved (default)" );
151 (
"StatTableHeader" , m_header ,
152 "The header row for the output Stat-table" ) ;
154 (
"RegularRowFormat" , m_format1 ,
155 "The format for the regular row in the output Stat-table" ) ;
157 (
"EfficiencyRowFormat" , m_format2 ,
158 "The format for the regular row in the output Stat-table" ) ;
160 (
"UseEfficiencyRowFormat" , m_useEffFormat ,
161 "Use the special format for printout of efficiency counters" ) ;
164 (
"PerEventFile", m_perEventFile=
"",
165 "File name for per-event deltas" );
199 if (!
m_ofd.is_open()) {
200 log <<
MSG::ERROR <<
"unable to open per-event output file \""
213 log <<
MSG::INFO <<
" Number of skipped events for MemStat"
255 if (
m_ofd.is_open()) {
262 alg.
erase(alg.length()-8,8);
265 for (itt=itr->second.
begin(); itt!=itr->second.
end(); ++itt) {
286 std::cout << local <<
" The Final CPU consumption (Chrono) Table "
295 <<
" The Final CPU consumption ( Chrono ) Table "
306 { tmpCont.
push_back( MPair( &(it->second) , &(it->first) ) ) ; }
315 for( MCont::iterator iter = tmpCont.begin() ; tmpCont.end() != iter ; ++iter )
318 ChronoEntity* entity = iter->
first ;
if( 0 == entity ) { continue ; }
319 const ChronoTag* tag = iter->second ;
if( 0 == tag ) { continue ; }
343 for( MCont::iterator iter = tmpCont.begin() ; tmpCont.end() != iter ; ++iter )
346 ChronoEntity* entity = iter->
first ;
if( 0 == entity ) { continue ; }
347 const ChronoTag* tag = iter->second ;
if( 0 == tag ) { continue ; }
371 for( MCont::iterator iter = tmpCont.begin() ; tmpCont.end() != iter ; ++iter )
374 ChronoEntity* entity = iter->
first ;
if( 0 == entity ) { continue ; }
375 const ChronoTag* tag = iter->second ;
if( 0 == tag ) { continue ; }
415 (
const ChronoTag& chronoTag )
417 ChronoEntity& entity = m_chronoEntities [ chronoTag ] ;
428 ChronoEntity& entity = m_chronoEntities [ chronoTag ] ;
440 return m_chronoEntities[ chronoTag ].delta( theType );
449 if( m_printUserTime ) {
451 << m_chronoEntities[ chronoTag ].outputUserTime ()
454 if( m_printSystemTime ) {
456 << m_chronoEntities[ chronoTag ].outputSystemTime()
466 {
return m_chronoEntities[ chronoTag ].status(); }
478 if (theIter==m_statEntities.end()){
480 StatEntity& theSe = m_statEntities[ statTag ];
487 theStat=&((*theIter).second);
490 theStat->
addFlag ( statFlag ) ;
499 log << (
MSG::Level) m_statPrintLevel << m_statEntities[ statTag ] <<
endmsg;
512 if ( m_chronoEntities.end() != it ) {
return &(it->second) ; }
526 if ( m_statEntities.end() != it ) {
return &(it->second) ; }
539 <<
"Could not open the output file for writing chrono statistics ["
555 chronos.
push_back( MPair( &(it->second) , &(it->first) ) ) ;
564 for( MCont::iterator iter = chronos.begin() ;
565 chronos.end() != iter;
568 const ChronoEntity* entity = iter->
first;
569 if( 0 == entity ) { continue ; }
571 const ChronoTag* tag = iter->second ;
572 if( 0 == tag ) { continue ; }
575 out <<
"\n[" << *tag <<
"]\n";
578 out <<
"cpu_user_total = " << entity->
uTotalTime() <<
"\n";
579 out <<
"cpu_user_min = " << entity->
uMinimalTime() <<
"\n";
580 out <<
"cpu_user_mean = " << entity->
uMeanTime() <<
"\n";
581 out <<
"cpu_user_RMS = " << entity->
uRMSTime() <<
"\n";
582 out <<
"cpu_user_max = " << entity->
uMaximalTime() <<
"\n";
587 out <<
"cpu_system_total = " << entity->
kTotalTime() <<
"\n";
588 out <<
"cpu_system_min = " << entity->
kMinimalTime() <<
"\n";
589 out <<
"cpu_system_mean = " << entity->
kMeanTime() <<
"\n";
590 out <<
"cpu_system_RMS = " << entity->
kRMSTime() <<
"\n";
591 out <<
"cpu_system_max = " << entity->
kMaximalTime() <<
"\n";
596 out <<
"cpu_real_total = " << entity->
eTotalTime() <<
"\n";
597 out <<
"cpu_real_min = " << entity->
eMinimalTime() <<
"\n";
598 out <<
"cpu_real_mean = " << entity->
eMeanTime() <<
"\n";
599 out <<
"cpu_real_RMS = " << entity->
eRMSTime() <<
"\n";
600 out <<
"cpu_real_max = " << entity->
eMaximalTime() <<
"\n";
641 { tmpCont.
push_back( SPair( &(it->second) , &(it->first) ) ) ; }
655 for ( SCont::iterator iter = tmpCont.begin() ; tmpCont.end() != iter ; ++iter )
659 if ( 0 == entity ) { continue ; }
660 const StatTag* tag = iter->second ;
661 if ( 0 == tag ) { continue ; }
690 if (!
m_ofd.is_open())
return;
695 if (itr->first.find(
":Execute") == std::string::npos)
continue;