Skip to content

Commit 01bd88d

Browse files
committed
pcm-raw: implement simplified edp option
Change-Id: Ifd6253987fd00b2ebddbe5244d0899a77e731647
1 parent b4998fb commit 01bd88d

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

src/cpucounters.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,7 +2207,12 @@ PCM::PCM() :
22072207

22082208
showSpecControlMSRs();
22092209

2210-
printDetailedSystemTopology();
2210+
#ifndef PCM_DEBUG_TOPOLOGY
2211+
if (safe_getenv("PCM_PRINT_TOPOLOGY") == "1")
2212+
#endif
2213+
{
2214+
printDetailedSystemTopology();
2215+
}
22112216

22122217
initEnergyMonitoring();
22132218

@@ -2232,9 +2237,7 @@ PCM::PCM() :
22322237
void PCM::printDetailedSystemTopology()
22332238
{
22342239
// produce debug output similar to Intel MPI cpuinfo
2235-
#ifndef PCM_DEBUG_TOPOLOGY
2236-
if (safe_getenv("PCM_PRINT_TOPOLOGY") == "1")
2237-
#endif
2240+
if (true)
22382241
{
22392242
std::cerr << "\n===== Processor topology =====\n";
22402243
std::cerr << "OS_Processor Thread_Id Core_Id Tile_Id Package_Id Core_Type Native_CPU_Model\n";

src/cpucounters.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,6 @@ class PCM_API PCM
938938
bool initMSR();
939939
bool detectNominalFrequency();
940940
void showSpecControlMSRs();
941-
void printDetailedSystemTopology();
942941
void initEnergyMonitoring();
943942
void initUncoreObjects();
944943
/*!
@@ -1057,6 +1056,9 @@ class PCM_API PCM
10571056
return *systemTopology;
10581057
}
10591058

1059+
//! prints detailed system topology
1060+
void printDetailedSystemTopology();
1061+
10601062
/*!
10611063
\brief checks if QOS monitoring support present
10621064

src/pcm-raw.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#endif
4444

4545
#include <vector>
46-
#define PCM_DELAY_DEFAULT 1.0 // in seconds
4746
#define PCM_DELAY_MIN 0.015 // 15 milliseconds is practical on most modern CPUs
4847
#define MAX_CORES 4096
4948

@@ -82,6 +81,7 @@ void print_usage(const string progname)
8281
cerr << " -el event_list.txt | /el event_list.txt => read event list from event_list.txt file, \n";
8382
cerr << " each line represents an event,\n";
8483
cerr << " event groups are separated by a semicolon\n";
84+
cerr << " -edp | /edp => 'edp' output mode\n";
8585
print_help_force_rtm_abort_mode(41);
8686
cerr << " Examples:\n";
8787
cerr << " " << progname << " 1 => print counters every second without core and socket output\n";
@@ -91,6 +91,7 @@ void print_usage(const string progname)
9191
}
9292

9393
bool verbose = false;
94+
double defaultDelay = 1.0; // in seconds
9495

9596
PCM::RawEventConfig initCoreConfig()
9697
{
@@ -1871,6 +1872,16 @@ int main(int argc, char* argv[])
18711872
argc--;
18721873
continue;
18731874
}
1875+
else if (
1876+
strncmp(*argv, "-edp", 4) == 0 ||
1877+
strncmp(*argv, "/edp", 4) == 0)
1878+
{
1879+
sampleSeparator = true;
1880+
defaultDelay = 0.1;
1881+
transpose = true;
1882+
m->printDetailedSystemTopology();
1883+
continue;
1884+
}
18741885
else if (strncmp(*argv, "-el", 3) == 0 || strncmp(*argv, "/el", 3) == 0)
18751886
{
18761887
argv++;
@@ -2016,8 +2027,7 @@ int main(int argc, char* argv[])
20162027
m->setBlocked(false);
20172028
}
20182029

2019-
2020-
if (delay <= 0.0) delay = PCM_DELAY_DEFAULT;
2030+
if (delay <= 0.0) delay = defaultDelay;
20212031

20222032
cerr << "Update every " << delay << " seconds\n";
20232033

0 commit comments

Comments
 (0)