Skip to content

Commit a7d5308

Browse files
committed
correct hardcoded QPI strings
1 parent bea1459 commit a7d5308

File tree

7 files changed

+40
-29
lines changed

7 files changed

+40
-29
lines changed

src/client/main.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int main(int argc, char* argv[])
6464
printTitle("Num. of online sockets");
6565
std::cout << counters.system.numOfOnlineSockets << "\n";
6666

67-
printTitle("QPI links per socket");
67+
printTitle("QPI/UPI links per socket");
6868
std::cout << counters.system.numOfQPILinksPerSocket << "\n";
6969

7070
std::cout << "\n\n";
@@ -331,23 +331,23 @@ int main(int argc, char* argv[])
331331
std::cout << "\n\n";
332332

333333
// Display QPI counters
334-
printTitle("QPI in. Avail.");
334+
printTitle("QPI/UPI in. Avail.");
335335
std::cout << std::setprecision(coutPrecision) << counters.qpi.incomingQPITrafficMetricsAvailable << " ";
336336
std::cout << "\n";
337337

338338
if (counters.qpi.incomingQPITrafficMetricsAvailable)
339339
{
340-
printTitle("QPI No. of Links");
340+
printTitle("QPI/UPI No. of Links");
341341
std::cout << std::setprecision(coutPrecision) << counters.system.numOfQPILinksPerSocket << "\n";
342342

343-
printTitle("QPI in. p/Sock");
343+
printTitle("QPI/UPI in. p/Sock");
344344
for (PCMDaemon::uint32 i = 0; i < counters.system.numOfOnlineSockets; ++i)
345345
{
346346
std::cout << std::setprecision(coutPrecision) << counters.qpi.incoming[i].total << " ";
347347
}
348348
std::cout << "\n";
349349

350-
printTitle("QPI in. p/Link/Sock");
350+
printTitle("QPI/UPI in. p/Link/Sock");
351351
for (PCMDaemon::uint32 i = 0; i < counters.system.numOfOnlineSockets; ++i)
352352
{
353353
std::cout << "Socket: " << i << " (bytes)\t\t";
@@ -368,28 +368,28 @@ int main(int argc, char* argv[])
368368
}
369369
std::cout << "\n";
370370

371-
printTitle("QPI in. Total");
371+
printTitle("QPI/UPI in. Total");
372372
std::cout << std::setprecision(coutPrecision) << counters.qpi.incomingTotal << " ";
373373
std::cout << "\n\n";
374374
}
375375

376-
printTitle("QPI out. Avail.");
376+
printTitle("QPI/UPI out. Avail.");
377377
std::cout << std::setprecision(coutPrecision) << counters.qpi.outgoingQPITrafficMetricsAvailable << " ";
378378
std::cout << "\n";
379379

380380
if (counters.qpi.outgoingQPITrafficMetricsAvailable)
381381
{
382-
printTitle("QPI No. of Links");
382+
printTitle("QPI/UPI No. of Links");
383383
std::cout << std::setprecision(coutPrecision) << counters.system.numOfQPILinksPerSocket << "\n";
384384

385-
printTitle("QPI out. p/Sock");
385+
printTitle("QPI/UPI out. p/Sock");
386386
for (PCMDaemon::uint32 i = 0; i < counters.system.numOfOnlineSockets; ++i)
387387
{
388388
std::cout << std::setprecision(coutPrecision) << counters.qpi.outgoing[i].total << " ";
389389
}
390390
std::cout << "\n";
391391

392-
printTitle("QPI out. p/Link/Sock");
392+
printTitle("QPI/UPI out. p/Link/Sock");
393393
for (PCMDaemon::uint32 i = 0; i < counters.system.numOfOnlineSockets; ++i)
394394
{
395395
std::cout << "Socket: " << i << " (bytes)\t\t";
@@ -410,7 +410,7 @@ int main(int argc, char* argv[])
410410
}
411411
std::cout << "\n";
412412

413-
printTitle("QPI out. Total");
413+
printTitle("QPI/UPI out. Total");
414414
std::cout << std::setprecision(coutPrecision) << counters.qpi.outgoingTotal << " ";
415415
std::cout << "\n";
416416
}

src/cpuasynchcounter.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ class AsynchronCounterState {
9494
return m->getSocketId(c);
9595
}
9696

97+
const char * getXpi() {
98+
return m->xPI();
99+
}
100+
97101
template <typename T, T func(CoreCounterState const &)>
98102
T get(uint32 core)
99103
{

src/cpucounters.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3276,7 +3276,7 @@ void PCM::reportQPISpeed() const
32763276
if(server_pcicfg_uncore[i].get()) server_pcicfg_uncore[i]->reportQPISpeed();
32773277
}
32783278
} else {
3279-
std::cerr << "Max QPI speed: " << max_qpi_speed / (1e9) << " GBytes/second (" << max_qpi_speed / (1e9*getBytesPerLinkTransfer()) << " GT/second)\n";
3279+
std::cerr << "Max " << xPI() << " speed: " << max_qpi_speed / (1e9) << " GBytes/second (" << max_qpi_speed / (1e9*getBytesPerLinkTransfer()) << " GT/second)\n";
32803280
}
32813281

32823282
}
@@ -5850,7 +5850,7 @@ ServerPCICFGUncore::ServerPCICFGUncore(uint32 socket_, const PCM * pcm) :
58505850

58515851
std::cerr << "Socket " << socket_ << ": " <<
58525852
getNumMC() << " memory controllers detected with total number of " << getNumMCChannels() << " channels. " <<
5853-
getNumQPIPorts() << " QPI ports detected." <<
5853+
getNumQPIPorts() << " " << pcm->xPI() << " ports detected." <<
58545854
" " << m2mPMUs.size() << " M2M (mesh to memory) blocks detected."
58555855
" " << haPMUs.size() << " Home Agents detected."
58565856
" " << m3upiPMUs.size() << " M3UPI blocks detected."
@@ -7544,7 +7544,7 @@ void ServerPCICFGUncore::reportQPISpeed() const
75447544
std::cerr.precision(1);
75457545
std::cerr << std::fixed;
75467546
for (uint32 i = 0; i < (uint32)qpi_speed.size(); ++i)
7547-
std::cerr << "Max QPI link " << i << " speed: " << qpi_speed[i] / (1e9) << " GBytes/second (" << qpi_speed[i] / (1e9 * m->getBytesPerLinkTransfer()) << " GT/second)\n";
7547+
std::cerr << "Max " << m->xPI() << " link " << i << " speed: " << qpi_speed[i] / (1e9) << " GBytes/second (" << qpi_speed[i] / (1e9 * m->getBytesPerLinkTransfer()) << " GT/second)\n";
75487548
}
75497549

75507550
uint64 PCM::CX_MSR_PMON_CTRY(uint32 Cbo, uint32 Ctr) const

src/dashboard.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ std::string getPCMDashboardJSON(const PCMDashboardType type, int ns, int nu, int
595595
for (size_t s = 0; s < NumSockets; ++s)
596596
{
597597
const auto S = std::to_string(s);
598-
auto panel = std::make_shared<GraphPanel>(0, y, width, height, std::string("Socket") + S + " UPI " + m, utilization?"%": "MByte/sec", false);
598+
auto panel = std::make_shared<GraphPanel>(0, y, width, height, std::string("Socket") + S + " " + pcm->xPI() + " " + m, utilization?"%": "MByte/sec", false);
599599
std::shared_ptr<Panel> panel1;
600600
if (utilization)
601601
panel1 = std::make_shared<GaugePanel>(width, y, max_width - width, height, std::string("Current Socket") + S + " UPI " + m + " (%)");
@@ -606,8 +606,8 @@ std::string getPCMDashboardJSON(const PCMDashboardType type, int ns, int nu, int
606606
for (size_t l = 0; l < NumUPILinksPerSocket; ++l)
607607
{
608608
const auto L = std::to_string(l);
609-
auto t = createTarget("UPI" + std::to_string(l),
610-
"mean(\\\"QPI/UPI Links_QPI Counters Socket " + S + "_" + m + " On Link " + L + "\\\")" + suffix,
609+
auto t = createTarget(pcm->xPI() + std::to_string(l),
610+
"mean(\\\"" + std::string(pcm->xPI()) + " Links_QPI Counters Socket " + S + "_" + m + " On Link " + L + "\\\")" + suffix,
611611
"rate(" + prometheusMetric(m) + "_On_Link_" + L + prometheusSystem(S) + interval + ")" + suffix);
612612
panel->push(t);
613613
panel1->push(t);

src/pcm-power.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ int main(int argc, char * argv[])
384384
for (uint32 port = 0; port < m->getQPILinksPerSocket(); ++port)
385385
{
386386
cout << "S" << socket << "P" << port
387-
<< "; QPIClocks: " << getQPIClocks(port, BeforeState[socket], AfterState[socket])
387+
<< "; " + std::string(m->xPI()) + " Clocks: " << getQPIClocks(port, BeforeState[socket], AfterState[socket])
388388
<< "; L0p Tx Cycles: " << 100. * getNormalizedQPIL0pTxCycles(port, BeforeState[socket], AfterState[socket]) << "%"
389389
<< "; L1 Cycles: " << 100. * getNormalizedQPIL1Cycles(port, BeforeState[socket], AfterState[socket]) << "%"
390390
<< "\n";

src/pcm-sensor.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ int main()
3636
string s;
3737
cin >> s;
3838

39+
const auto xpi = counters.getXpi();
40+
3941
// list counters
4042
if (s == "monitors") {
4143
for (uint32 i = 0; i < counters.getNumCores(); ++i) {
@@ -85,10 +87,10 @@ int main()
8587
}
8688
for (uint32 a = 0; a < counters.getNumSockets(); ++a) {
8789
for (uint32 l = 0; l < counters.getQPILinksPerSocket(); ++l)
88-
cout << "Socket" << a << "/BytesIncomingToQPI" << l << "\tfloat\n";
90+
cout << "Socket" << a << "/BytesIncomingTo" << xpi << l << "\tfloat\n";
8991
}
9092

91-
cout << "QPI_Traffic\tfloat\n";
93+
cout << xpi << "_Traffic\tfloat\n";
9294
cout << "Frequency\tfloat\n";
9395
cout << "IPC\tfloat\n"; //double check output
9496
cout << "L2CacheHitRatio\tfloat\n";
@@ -346,19 +348,19 @@ int main()
346348
for (uint32 l = 0; l < counters.getQPILinksPerSocket(); ++l) {
347349
for (uint32 i = 0; i < counters.getNumSockets(); ++i) {
348350
stringstream c;
349-
c << "Socket" << i << "/BytesIncomingToQPI" << l << "?";
351+
c << "Socket" << i << "/BytesIncomingTo" << xpi << l << "?";
350352
if (s == c.str()) {
351353
//cout << "Socket" << i << "\tBytes incoming to QPI link\t" << l<< "\t\t GB\n";
352-
cout << "incoming to Socket" << i << " QPI Link" << l << "\t0\t\tGB\n";
354+
cout << "incoming to Socket" << i << " " << xpi << " Link" << l << "\t0\t\tGB\n";
353355
}
354356
}
355357
}
356358

357359
{
358360
stringstream c;
359-
c << "QPI_Traffic?";
361+
c << xpi << "_Traffic?";
360362
if (s == c.str()) {
361-
cout << "Traffic on all QPIs\t0\t\tGB\n";
363+
cout << "Traffic on all " << xpi << " links\t0\t\tGB\n";
362364
}
363365
}
364366

@@ -627,7 +629,7 @@ int main()
627629
for (uint32 l = 0; l < counters.getQPILinksPerSocket(); ++l) {
628630
for (uint32 i = 0; i < counters.getNumSockets(); ++i) {
629631
stringstream c;
630-
c << "Socket" << i << "/BytesIncomingToQPI" << l;
632+
c << "Socket" << i << "/BytesIncomingTo" << xpi << l;
631633
if (s == c.str()) {
632634
cout << double(counters.getSocket<uint64, ::getIncomingQPILinkBytes>(i, l)) / 1024 / 1024 / 1024 << "\n";
633635
}
@@ -659,7 +661,8 @@ int main()
659661
OUTPUT_SYSTEM_METRIC("L3CacheHitRatio", (double(counters.getSystem<double, ::getL3CacheHitRatio>())))
660662
OUTPUT_SYSTEM_METRIC("L2CacheMisses", (double(counters.getSystem<uint64, ::getL2CacheMisses>())))
661663
OUTPUT_SYSTEM_METRIC("L3CacheMisses", (double(counters.getSystem<uint64, ::getL3CacheMisses>())))
662-
OUTPUT_SYSTEM_METRIC("QPI_Traffic", (double(counters.getSystem<uint64, ::getAllIncomingQPILinkBytes>()) / 1024 / 1024 / 1024))
664+
OUTPUT_SYSTEM_METRIC(std::string(xpi + std::string("_Traffic")),
665+
(double(counters.getSystem<uint64, ::getAllIncomingQPILinkBytes>()) / 1024 / 1024 / 1024))
663666

664667
// exit
665668
if (s == "quit" || s == "exit" || s == "") {

src/windows/PCMService.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ namespace PCMServiceNS {
6767

6868
log_->WriteEntry(Globals::ServiceName, "PMU Programmed.");
6969

70+
CountersQpi = gcnew String(L"PCM " + gcnew System::String(m_->xPI()) + L" Counters");
71+
MetricQpiBand = gcnew String(gcnew System::String(m_->xPI()) + L" Link Bandwidth");
72+
7073
// This here will only create the necessary registry entries, the actual counters are created later.
7174
// New unified category
7275
if (PerformanceCounterCategory::Exists(CountersCore))
@@ -184,7 +187,7 @@ namespace PCMServiceNS {
184187
if (collectionInformation_->qpi)
185188
{
186189
counterCollection->Clear();
187-
counter = gcnew CounterCreationData(MetricQpiBand, "Displays the incoming bandwidth in bytes/s of this QPI link.", PerformanceCounterType::CounterDelta64);
190+
counter = gcnew CounterCreationData(MetricQpiBand, L"Displays the incoming bandwidth in bytes/s of this " + gcnew System::String(m_->xPI()) + L" link", PerformanceCounterType::CounterDelta64);
188191
counterCollection->Add( counter );
189192
PerformanceCounterCategory::Create(CountersQpi, "Processor Counter Monitor", PerformanceCounterCategoryType::MultiInstance, counterCollection);
190193
}
@@ -627,7 +630,7 @@ namespace PCMServiceNS {
627630
// Counter variable names
628631
initonly String^ CountersCore = gcnew String(L"PCM Core Counters");
629632
initonly String^ CountersSocket = gcnew String(L"PCM Socket Counters");
630-
initonly String^ CountersQpi = gcnew String(L"PCM QPI Counters");
633+
initonly String^ CountersQpi;
631634

632635
initonly String^ MetricCoreClocktick = gcnew String(L"Clockticks");
633636
initonly String^ MetricCoreRetired = gcnew String(L"Instructions Retired");
@@ -670,7 +673,7 @@ namespace PCMServiceNS {
670673
initonly String^ MetricSocketResC9Base = gcnew String(L"package C9-state base");
671674
initonly String^ MetricSocketResC10Base = gcnew String(L"package C10-state base");
672675

673-
initonly String^ MetricQpiBand = gcnew String(L"QPI Link Bandwidth");
676+
initonly String^ MetricQpiBand;
674677

675678
// Configuration values
676679
const int sampleRate_;
@@ -736,6 +739,7 @@ namespace PCMServiceNS {
736739
/// </summary>
737740
virtual void OnStart(array<String^>^ args) override
738741
{
742+
PCM* m_ = PCM::getInstance();
739743
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
740744
// Default values for configuration
741745
int sampleRate = 1000;

0 commit comments

Comments
 (0)