Skip to content

Commit

Permalink
Enable P2P traffic
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Antonov committed Nov 17, 2023
1 parent 4478918 commit a47d48a
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/pcm-iio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,9 @@ void print_usage(const string& progname)
<< " to a file, in case filename is provided\n";
cout << " -csv-delimiter=<value> | /csv-delimiter=<value> => set custom csv delimiter\n";
cout << " -human-readable | /human-readable => use human readable format for output (for csv only)\n";
cout << " -iommu | /iommu => collect VT-d IOMMU data";
cout << " -p2p | /p2p => measure Peer to Peer traffic";
cout << " -list | /list => print the topology information";
cout << " -root-port | /root-port => add root port devices to output (for csv only)\n";
cout << " -i[=number] | /i[=number] => allow to determine number of iterations\n";
cout << " Examples:\n";
Expand Down Expand Up @@ -1475,6 +1478,8 @@ int mainThrows(int argc, char * argv[])
bool csv = false;
bool human_readable = false;
bool show_root_port = false;
bool iommu = false;
bool p2p = false;
std::string csv_delimiter = ",";
std::string output_file;
double delay = PCM_DELAY_DEFAULT;
Expand Down Expand Up @@ -1511,7 +1516,13 @@ int mainThrows(int argc, char * argv[])
else if (check_argument_equals(*argv, {"-human-readable", "/human-readable"})) {
human_readable = true;
}
else if (check_argument_equals(*argv, {"--list"})) {
else if (check_argument_equals(*argv, {"-iommu", "/iommu"})) {
iommu = true;
}
else if (check_argument_equals(*argv, {"-p2p", "/p2p"})) {
p2p = true;
}
else if (check_argument_equals(*argv, {"-list", "/list"})) {
list = true;
}
else if (check_argument_equals(*argv, {"-root-port", "/root-port"})) {
Expand Down Expand Up @@ -1592,6 +1603,16 @@ int mainThrows(int argc, char * argv[])
try
{
load_events(ev_file_name, opcodeFieldMap, iio_evt_parse_handler, (void *)&evt_ctx, nameMap);

if (p2p) {
ev_file_name = "opCode-" + std::to_string(m->getCPUModel()) + "-p2p.txt";
load_events(ev_file_name, opcodeFieldMap, iio_evt_parse_handler, (void *)&evt_ctx, nameMap);
}

if (iommu) {
ev_file_name = "opCode-" + std::to_string(m->getCPUModel()) + "-iommu.txt";
load_events(ev_file_name, opcodeFieldMap, iio_evt_parse_handler, (void *)&evt_ctx, nameMap);
}
}
catch (std::exception & e)
{
Expand Down

0 comments on commit a47d48a

Please sign in to comment.