-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code refactor #408
base: master
Are you sure you want to change the base?
Code refactor #408
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,9 +81,9 @@ bool anyPmem(const ServerUncoreMemoryMetrics & metrics) | |
|
||
bool skipInactiveChannels = true; | ||
|
||
void print_help(const string prog_name) | ||
void print_help(const string & progname) | ||
{ | ||
cerr << "\n Usage: \n " << prog_name | ||
cerr << "\n Usage: \n " << progname | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you merge this change into the previous change? I would like each change to compile on its own and it is clear that this cannot compile on its own and needs both changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the change of the parameter name is not necessary and requires changing the name in other code lines. Could you please keep the old name? |
||
<< " --help | [delay] [options] [-- external_program [external_program_options]]\n"; | ||
cerr << " <delay> => time interval to sample performance counters.\n"; | ||
cerr << " If not specified, or 0, with external program given\n"; | ||
|
@@ -107,9 +107,9 @@ void print_help(const string prog_name) | |
cerr << " --uninstallDriver | --installDriver=> (un)install driver\n"; | ||
#endif | ||
cerr << " Examples:\n"; | ||
cerr << " " << prog_name << " 1 => print counters every second without core and socket output\n"; | ||
cerr << " " << prog_name << " 0.5 -csv=test.log => twice a second save counter values to test.log in CSV format\n"; | ||
cerr << " " << prog_name << " /csv 5 2>/dev/null => one sampe every 5 seconds, and discard all diagnostic output\n"; | ||
cerr << " " << progname << " 1 => print counters every second without core and socket output\n"; | ||
cerr << " " << progname << " 0.5 -csv=test.log => twice a second save counter values to test.log in CSV format\n"; | ||
cerr << " " << progname << " /csv 5 2>/dev/null => one sampe every 5 seconds, and discard all diagnostic output\n"; | ||
cerr << "\n"; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,9 +79,9 @@ double getAverageUncoreFrequencyGhz(const UncoreStateType& before, const UncoreS | |
return getAverageUncoreFrequency(before, after) / 1e9; | ||
} | ||
|
||
void print_help(const string prog_name) | ||
void print_help(const string & progname) | ||
{ | ||
cerr << "\n Usage: \n " << prog_name | ||
cerr << "\n Usage: \n " << progname | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you merge this change into the previous change? I would like each change to compile on its own and it is clear that this cannot compile on its own and needs both changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here. Please keep the old name. |
||
<< " --help | [delay] [options] [-- external_program [external_program_options]]\n"; | ||
cerr << " <delay> => time interval to sample performance counters.\n"; | ||
cerr << " If not specified, or 0, with external program given\n"; | ||
|
@@ -103,10 +103,10 @@ void print_help(const string prog_name) | |
cerr << " -i[=number] | /i[=number] => allow to determine number of iterations\n"; | ||
print_help_force_rtm_abort_mode(37); | ||
cerr << " Examples:\n"; | ||
cerr << " " << prog_name << " 1 -nc -ns => print counters every second without core and socket output\n"; | ||
cerr << " " << prog_name << " 1 -i=10 => print counters every second 10 times and exit\n"; | ||
cerr << " " << prog_name << " 0.5 -csv=test.log => twice a second save counter values to test.log in CSV format\n"; | ||
cerr << " " << prog_name << " /csv 5 2>/dev/null => one sampe every 5 seconds, and discard all diagnostic output\n"; | ||
cerr << " " << progname << " 1 -nc -ns => print counters every second without core and socket output\n"; | ||
cerr << " " << progname << " 1 -i=10 => print counters every second 10 times and exit\n"; | ||
cerr << " " << progname << " 0.5 -csv=test.log => twice a second save counter values to test.log in CSV format\n"; | ||
cerr << " " << progname << " /csv 5 2>/dev/null => one sampe every 5 seconds, and discard all diagnostic output\n"; | ||
cerr << "\n"; | ||
} | ||
|
||
|
@@ -185,14 +185,22 @@ void print_output(PCM * m, | |
cout << " L3MPI : number of L3 (read) cache misses per instruction\n"; | ||
if (m->isL2CacheMissesAvailable()) | ||
cout << " L2MPI : number of L2 (read) cache misses per instruction\n"; | ||
if (m->memoryTrafficMetricsAvailable()) cout << " READ : bytes read from main memory controller (in GBytes)\n"; | ||
if (m->memoryTrafficMetricsAvailable()) cout << " WRITE : bytes written to main memory controller (in GBytes)\n"; | ||
if (m->localMemoryRequestRatioMetricAvailable()) cout << " LOCAL : ratio of local memory requests to memory controller in %\n"; | ||
if (m->LLCReadMissLatencyMetricsAvailable()) cout << "LLCRDMISSLAT: average latency of last level cache miss for reads and prefetches (in ns)\n"; | ||
if (m->PMMTrafficMetricsAvailable()) cout << " PMM RD : bytes read from PMM memory (in GBytes)\n"; | ||
if (m->PMMTrafficMetricsAvailable()) cout << " PMM WR : bytes written to PMM memory (in GBytes)\n"; | ||
if (m->MCDRAMmemoryTrafficMetricsAvailable()) cout << " MCDRAM READ : bytes read from MCDRAM controller (in GBytes)\n"; | ||
if (m->MCDRAMmemoryTrafficMetricsAvailable()) cout << " MCDRAM WRITE : bytes written to MCDRAM controller (in GBytes)\n"; | ||
if (m->memoryTrafficMetricsAvailable()) { | ||
cout << " READ : bytes read from main memory controller (in GBytes)\n"; | ||
cout << " WRITE : bytes written to main memory controller (in GBytes)\n"; | ||
} | ||
if (m->localMemoryRequestRatioMetricAvailable()) { | ||
cout << " LOCAL : ratio of local memory requests to memory controller in %\n"; | ||
cout << "LLCRDMISSLAT: average latency of last level cache miss for reads and prefetches (in ns)\n"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the availability of LLCRDMISSLAT metric should be checked with m->LLCReadMissLatencyMetricsAvailable() and not with m->localMemoryRequestRatioMetricAvailable() |
||
} | ||
if (m->PMMTrafficMetricsAvailable()) { | ||
cout << " PMM RD : bytes read from PMM memory (in GBytes)\n"; | ||
cout << " PMM WR : bytes written to PMM memory (in GBytes)\n"; | ||
} | ||
if (m->MCDRAMmemoryTrafficMetricsAvailable()) { | ||
cout << " MCDRAM READ : bytes read from MCDRAM controller (in GBytes)\n"; | ||
cout << " MCDRAM WRITE : bytes written to MCDRAM controller (in GBytes)\n"; | ||
} | ||
if (m->memoryIOTrafficMetricAvailable()) { | ||
cout << " IO : bytes read/written due to IO requests to memory controller (in GBytes); this may be an over estimate due to same-cache-line partial requests\n"; | ||
cout << " IA : bytes read/written due to IA requests to memory controller (in GBytes); this may be an over estimate due to same-cache-line partial requests\n"; | ||
|
@@ -437,12 +445,11 @@ void print_output(PCM * m, | |
cout << " PMM RD | PMM WR |"; | ||
if (m->MCDRAMmemoryTrafficMetricsAvailable()) | ||
cout << " MCDRAM READ | MCDRAM WRITE |"; | ||
if (m->memoryIOTrafficMetricAvailable()) | ||
if (m->memoryIOTrafficMetricAvailable()) { | ||
cout << " IO |"; | ||
if (m->memoryIOTrafficMetricAvailable()) | ||
cout << " IA |"; | ||
if (m->memoryIOTrafficMetricAvailable()) | ||
cout << " GT |"; | ||
} | ||
if (m->packageEnergyMetricsAvailable()) | ||
cout << " CPU energy |"; | ||
if (m->dramEnergyMetricsAvailable()) | ||
|
@@ -547,13 +554,13 @@ void print_basic_metrics_csv_header(const PCM * m) | |
cout << "Frontend_bound(%),Bad_Speculation(%),Backend_Bound(%),Retiring(%),"; | ||
} | ||
|
||
void print_csv_header_helper(string header, int count=1){ | ||
void print_csv_header_helper(const string & header, int count=1){ | ||
for(int i = 0; i < count; i++){ | ||
cout << header << ","; | ||
} | ||
} | ||
|
||
void print_basic_metrics_csv_semicolons(const PCM * m, string header) | ||
void print_basic_metrics_csv_semicolons(const PCM * m, const string & header) | ||
{ | ||
print_csv_header_helper(header, 3); // EXEC;IPC;FREQ; | ||
if (m->isActiveRelativeFrequencyAvailable()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer if you keep " *ctrl = MC_CH_PCI_PMON_CTL_EN;" because IIRC some PMU docs suggested that the PMU control register needs to be written without the event/umask and then in the next write the event/umask needs to be written.