6 #pragma warning( disable : 4786 )
51 : public
std::binary_function<
56 inline bool operator()
62 const ChronoEntity*
e1 = p1.first;
63 const ChronoEntity* e2 = p2.
first;
64 return ( ( 0 == e1 || 0 == e2 ) ?
true : (*e1)<(*e2) ) ;
72 const std::pair<const StatEntity*,const IChronoStatSvc::StatTag*> ,
73 const std::pair<const StatEntity*,const IChronoStatSvc::StatTag*> , bool >
77 inline bool operator()
85 return ( 0 == se1 || 0 == se2 ) ?
true : (*se1)<(*se2) ;
100 , m_header (
" Counter | # | sum | mean/eff^* | rms/err^* | min | max |")
102 , m_format1 (
" %|-15.15s|%|17t||%|10d| |%|11.7g| |%|#11.5g| |%|#11.5g| |%|#12.5g| |%|#12.5g| |" )
104 , m_format2 (
"*%|-15.15s|%|17t||%|10d| |%|11.5g| |(%|#9.7g| +- %|-#9.7g|)%%| ------- | ------- |" )
106 , m_useEffFormat (
true )
109 declareProperty (
"ChronoPrintOutTable" ,
110 m_chronoTableFlag =
true );
112 declareProperty (
"ChronoDestinationCout" ,
113 m_chronoCoutFlag =
false );
115 declareProperty (
"ChronoPrintLevel" ,
119 declareProperty (
"ChronoTableToBeOrdered" ,
120 m_chronoOrderFlag =
true );
122 declareProperty (
"PrintUserTime" ,
123 m_printUserTime =
true );
125 declareProperty (
"PrintSystemTime" ,
126 m_printSystemTime =
false );
128 declareProperty (
"PrintEllapsedTime" ,
129 m_printEllapsedTime =
false );
132 declareProperty (
"StatPrintOutTable" ,
133 m_statTableFlag =
true );
135 declareProperty (
"StatDestinationCout" ,
136 m_statCoutFlag =
false );
138 declareProperty (
"StatPrintLevel" ,
142 declareProperty (
"StatTableToBeOrdered" ,
143 m_statOrderFlag =
true );
147 declareProperty (
"NumberOfSkippedEventsForMemStat" ,
148 m_numberOfSkippedEventsForMemStat = -1 ) ;
150 declareProperty(
"AsciiStatsOutputFile",
151 m_statsOutFileName =
"",
152 "Name of the output file storing the stats. If empty, no"
153 " statistics will be saved (default)" );
156 (
"StatTableHeader" , m_header ,
157 "The header row for the output Stat-table" ) ;
159 (
"RegularRowFormat" , m_format1 ,
160 "The format for the regular row in the output Stat-table" ) ;
162 (
"EfficiencyRowFormat" , m_format2 ,
163 "The format for the regular row in the output Stat-table" ) ;
165 (
"UseEfficiencyRowFormat" , m_useEffFormat ,
166 "Use the special format for printout of efficiency counters" ) ;
169 (
"PerEventFile", m_perEventFile=
"",
170 "File name for per-event deltas" );
204 if (!
m_ofd.is_open()) {
205 log <<
MSG::ERROR <<
"unable to open per-event output file \""
218 log <<
MSG::INFO <<
" Number of skipped events for MemStat"
260 if (
m_ofd.is_open()) {
267 alg.
erase(alg.length()-8,8);
270 for (itt=itr->second.
begin(); itt!=itr->second.
end(); ++itt) {
291 std::cout << local <<
" The Final CPU consumption (Chrono) Table "
300 <<
" The Final CPU consumption ( Chrono ) Table "
311 { tmpCont.
push_back( MPair( &(it->second) , &(it->first) ) ) ; }
320 for( MCont::iterator iter = tmpCont.begin() ; tmpCont.end() != iter ; ++iter )
323 ChronoEntity* entity = iter->
first ;
if( 0 == entity ) { continue ; }
324 const ChronoTag* tag = iter->second ;
if( 0 == tag ) { continue ; }
348 for( MCont::iterator iter = tmpCont.begin() ; tmpCont.end() != iter ; ++iter )
351 ChronoEntity* entity = iter->
first ;
if( 0 == entity ) { continue ; }
352 const ChronoTag* tag = iter->second ;
if( 0 == tag ) { continue ; }
376 for( MCont::iterator iter = tmpCont.begin() ; tmpCont.end() != iter ; ++iter )
379 ChronoEntity* entity = iter->
first ;
if( 0 == entity ) { continue ; }
380 const ChronoTag* tag = iter->second ;
if( 0 == tag ) { continue ; }
420 (
const ChronoTag& chronoTag )
422 ChronoEntity& entity = m_chronoEntities [ chronoTag ] ;
433 ChronoEntity& entity = m_chronoEntities [ chronoTag ] ;
445 return m_chronoEntities[ chronoTag ].delta( theType );
454 if( m_printUserTime ) {
456 << m_chronoEntities[ chronoTag ].outputUserTime ()
459 if( m_printSystemTime ) {
461 << m_chronoEntities[ chronoTag ].outputSystemTime()
471 {
return m_chronoEntities[ chronoTag ].status(); }
483 if (theIter==m_statEntities.end()){
485 StatEntity& theSe = m_statEntities[ statTag ];
492 theStat=&((*theIter).second);
495 theStat->
addFlag ( statFlag ) ;
504 log << (
MSG::Level) m_statPrintLevel << m_statEntities[ statTag ] <<
endmsg;
517 if ( m_chronoEntities.end() != it ) {
return &(it->second) ; }
531 if ( m_statEntities.end() != it ) {
return &(it->second) ; }
544 <<
"Could not open the output file for writing chrono statistics ["
560 chronos.
push_back( MPair( &(it->second) , &(it->first) ) ) ;
569 for( MCont::iterator iter = chronos.begin() ;
570 chronos.end() != iter;
573 const ChronoEntity* entity = iter->
first;
574 if( 0 == entity ) { continue ; }
576 const ChronoTag* tag = iter->second ;
577 if( 0 == tag ) { continue ; }
580 out <<
"\n[" << *tag <<
"]\n";
583 out <<
"cpu_user_total = " << entity->
uTotalTime() <<
"\n";
584 out <<
"cpu_user_min = " << entity->
uMinimalTime() <<
"\n";
585 out <<
"cpu_user_mean = " << entity->
uMeanTime() <<
"\n";
586 out <<
"cpu_user_RMS = " << entity->
uRMSTime() <<
"\n";
587 out <<
"cpu_user_max = " << entity->
uMaximalTime() <<
"\n";
592 out <<
"cpu_system_total = " << entity->
kTotalTime() <<
"\n";
593 out <<
"cpu_system_min = " << entity->
kMinimalTime() <<
"\n";
594 out <<
"cpu_system_mean = " << entity->
kMeanTime() <<
"\n";
595 out <<
"cpu_system_RMS = " << entity->
kRMSTime() <<
"\n";
596 out <<
"cpu_system_max = " << entity->
kMaximalTime() <<
"\n";
601 out <<
"cpu_real_total = " << entity->
eTotalTime() <<
"\n";
602 out <<
"cpu_real_min = " << entity->
eMinimalTime() <<
"\n";
603 out <<
"cpu_real_mean = " << entity->
eMeanTime() <<
"\n";
604 out <<
"cpu_real_RMS = " << entity->
eRMSTime() <<
"\n";
605 out <<
"cpu_real_max = " << entity->
eMaximalTime() <<
"\n";
646 { tmpCont.
push_back( SPair( &(it->second) , &(it->first) ) ) ; }
660 for ( SCont::iterator iter = tmpCont.begin() ; tmpCont.end() != iter ; ++iter )
664 if ( 0 == entity ) { continue ; }
665 const StatTag* tag = iter->second ;
666 if ( 0 == tag ) { continue ; }
695 if (!
m_ofd.is_open())
return;
700 if (itr->first.find(
":Execute") == std::string::npos)
continue;