@@ -461,8 +461,8 @@ AddEventStatus addEventFromDB(PCM::RawPMUConfigs& curPMUConfigs, string fullEven
461
461
cerr << " ERROR: PMU Event map can not be initialized\n " ;
462
462
return AddEventStatus::Failed;
463
463
}
464
- // cerr << "Parsing event " << fullEventStr << "\n" ;
465
- // cerr << "size: " << fullEventStr.size() << "\n" ;
464
+ DBG ( 2 , " Parsing event " , fullEventStr) ;
465
+ DBG ( 2 , " size: " , fullEventStr.size ()) ;
466
466
while (fullEventStr.empty () == false && fullEventStr.back () == ' ' )
467
467
{
468
468
fullEventStr.resize (fullEventStr.size () - 1 ); // remove trailing spaces
@@ -482,7 +482,7 @@ AddEventStatus addEventFromDB(PCM::RawPMUConfigs& curPMUConfigs, string fullEven
482
482
483
483
const auto eventStr = EventTokens[0 ];
484
484
485
- // cerr << "size: " << eventStr.size() << "\n" ;
485
+ DBG ( 2 , " size: " , eventStr.size ()) ;
486
486
PCM::RawEventConfig config = { {0 ,0 ,0 ,0 ,0 }, " " };
487
487
std::string pmuName;
488
488
@@ -636,17 +636,17 @@ AddEventStatus addEventFromDB(PCM::RawPMUConfigs& curPMUConfigs, string fullEven
636
636
{
637
637
std::string unit = EventMap::getField (eventStr, " Unit" );
638
638
lowerCase (unit);
639
- // std::cout << eventStr << " is uncore event for unit " << unit << "\n" ;
639
+ DBG ( 2 , eventStr , " is uncore event for unit " , unit) ;
640
640
pmuName = (pmuNameMap.find (unit) == pmuNameMap.end ()) ? unit : pmuNameMap[unit];
641
641
}
642
642
643
643
config.second = fullEventStr;
644
644
645
645
if (1 )
646
646
{
647
- // cerr << "pmuName: " << pmuName << " full event "<< fullEventStr << " \n" ;
647
+ DBG ( 2 , " pmuName: " , pmuName , " full event " , fullEventStr) ;
648
648
std::string CounterStr = EventMap::getField (eventStr, " Counter" );
649
- // cout << "Counter: " << CounterStr << "\n" ;
649
+ DBG ( 2 , " Counter: " , CounterStr) ;
650
650
int fixedCounter = -1 ;
651
651
fixed = (pcm_sscanf (CounterStr) >> s_expect (" Fixed counter " ) >> fixedCounter) ? true : false ;
652
652
if (!fixed){
@@ -720,15 +720,15 @@ AddEventStatus addEventFromDB(PCM::RawPMUConfigs& curPMUConfigs, string fullEven
720
720
};
721
721
for (const auto & registerKeyValue : PMUDeclObj)
722
722
{
723
- // cout << "Setting " << registerKeyValue.key << " : " << registerKeyValue.value << "\n" ;
723
+ DBG ( 2 , " Setting " , registerKeyValue.key , " : " , registerKeyValue.value ) ;
724
724
simdjson::dom::object fieldDescriptionObj = registerKeyValue.value ;
725
- // cout << " config: " << uint64_t(fieldDescriptionObj["Config"]) << "\n" ;
726
- // cout << " Position: " << uint64_t(fieldDescriptionObj["Position"]) << "\n" ;
725
+ DBG ( 2 , " config: " , uint64_t (fieldDescriptionObj[" Config" ])) ;
726
+ DBG ( 2 , " Position: " , uint64_t (fieldDescriptionObj[" Position" ])) ;
727
727
const std::string fieldNameStr{ registerKeyValue.key .begin (), registerKeyValue.key .end () };
728
728
if (fieldNameStr == " MSRIndex" )
729
729
{
730
730
string fieldValueStr = EventMap::getField (eventStr, fieldNameStr);
731
- // cout << "MSR field " << fieldNameStr << " value is " << fieldValueStr << " (" << read_number(fieldValueStr.c_str()) << ") offcore=" << offcore << "\n" ;
731
+ DBG ( 2 , " MSR field " , fieldNameStr , " value is " , fieldValueStr , " (" , read_number (fieldValueStr.c_str ()) , " ) offcore=" , offcore); ;
732
732
lowerCase (fieldValueStr);
733
733
if (fieldValueStr == " 0" || fieldValueStr == " 0x00" )
734
734
{
@@ -745,7 +745,7 @@ AddEventStatus addEventFromDB(PCM::RawPMUConfigs& curPMUConfigs, string fullEven
745
745
}
746
746
MSRIndexStr = MSRIndexes[offcoreEventIndex];
747
747
}
748
- // cout << " MSR field " << fieldNameStr << " value is " << MSRIndexStr << " (" << read_number(MSRIndexStr.c_str()) << ") offcore=" << offcore << "\n" ;
748
+ DBG ( 2 , " MSR field " , fieldNameStr , " value is " , MSRIndexStr , " (" , read_number (MSRIndexStr.c_str ()) , " ) offcore=" , offcore) ;
749
749
MSRObject = registerKeyValue.value [MSRIndexStr];
750
750
const string msrValueStr = EventMap::getField (eventStr, " MSRValue" );
751
751
setMSRValue (msrValueStr);
@@ -758,7 +758,7 @@ AddEventStatus addEventFromDB(PCM::RawPMUConfigs& curPMUConfigs, string fullEven
758
758
}
759
759
if (!EventMap::isField (eventStr, fieldNameStr))
760
760
{
761
- // cerr << fieldNameStr << " not found\n" ;
761
+ DBG ( 2 , fieldNameStr , " not found" ) ;
762
762
if (fieldDescriptionObj[" DefaultValue" ].error () == NO_SUCH_FIELD)
763
763
{
764
764
cerr << " ERROR: DefaultValue not provided for field \" " << fieldNameStr << " \" in " << path << " \n " ;
@@ -786,7 +786,7 @@ AddEventStatus addEventFromDB(PCM::RawPMUConfigs& curPMUConfigs, string fullEven
786
786
}
787
787
fieldValueStr = offcoreCodes[offcoreEventIndex];
788
788
}
789
- // cout << " field " << fieldNameStr << " value is " << fieldValueStr << " (" << read_number(fieldValueStr.c_str()) << ") offcore=" << offcore << "\n" ;
789
+ DBG ( 2 , " field " , fieldNameStr , " value is " , fieldValueStr , " (" , read_number (fieldValueStr.c_str ()) , " ) offcore=" , offcore) ;
790
790
setConfig (config, fieldDescriptionObj, read_number (fieldValueStr.c_str ()), position);
791
791
}
792
792
}
@@ -934,13 +934,6 @@ AddEventStatus addEventFromDB(PCM::RawPMUConfigs& curPMUConfigs, string fullEven
934
934
}
935
935
}
936
936
937
- /*
938
- for (const auto& keyValue : eventObj)
939
- {
940
- cout << keyValue.key << " : " << keyValue.value << "\n";
941
- }
942
- */
943
-
944
937
printEvent (pmuName, fixed, config);
945
938
946
939
return AddEventStatus::OK;
@@ -2749,9 +2742,6 @@ int mainThrows(int argc, char * argv[])
2749
2742
}
2750
2743
m->globalUnfreezeUncoreCounters ();
2751
2744
2752
- // cout << "Time elapsed: " << dec << fixed << AfterTime - BeforeTime << " ms\n";
2753
- // cout << "Called sleep function for " << dec << fixed << delay_ms << " ms\n";
2754
-
2755
2745
printAll (group, m, SysBeforeState, SysAfterState, BeforeState, AfterState, BeforeUncoreState, AfterUncoreState, BeforeSocketState, AfterSocketState, PMUConfigs, groupNr == nGroups);
2756
2746
if (nGroups == 1 )
2757
2747
{
0 commit comments