Skip to content

Commit 4ead1ad

Browse files
authored
Merge pull request #721 from intel/push-2024-04-13
Push 2024 04 13
2 parents 6ab94d9 + bd94897 commit 4ead1ad

File tree

8 files changed

+35
-11
lines changed

8 files changed

+35
-11
lines changed

scripts/grafana/clean.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

2-
2+
sh stop.sh
33
rm -rf provisioning/datasources
44
rm -rf *_volume

scripts/grafana/start-prometheus.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -e
44

scripts/grafana/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -e
44

src/cpucounters.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ class PCM_API PCM
591591
friend class UncoreCounterState;
592592
friend class Socket;
593593
friend class ServerUncore;
594+
friend class ClientUncore;
594595
friend class PerfVirtualControlRegister;
595596
friend class Aggregator;
596597
friend class ServerUncorePMUs;

src/dashboard.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ std::string getPCMDashboardJSON(const PCMDashboardType type, int ns, int nu, int
823823
auto panel = std::make_shared<GraphPanel>(0, y, width, height, std::string("Socket") + S + " Energy Consumption", "Watt", false);
824824
auto panel1 = std::make_shared<BarGaugePanel>(width, y, max_width - width, height, std::string("Current Socket") + S + " Energy Consumption (Watt)");
825825
y += height;
826-
for (auto &m : {"Package Joules Consumed", "DRAM Joules Consumed"})
826+
for (auto &m : {"Package Joules Consumed", "DRAM Joules Consumed", "PP0 Joules Consumed", "PP1 Joules Consumed"})
827827
{
828828
auto t = createTarget(m, influxDBUncore_Uncore_Counters(S, m), prometheusCounters(S, m, false));
829829
panel->push(t);

src/pcm-sensor-server.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,11 @@ class JSONPrinter : Visitor
311311
printUncoreCounterState( before, after );
312312
}
313313

314-
virtual void dispatch( ClientUncore* ) override {
314+
virtual void dispatch( ClientUncore* cu) override {
315315
printCounter( "Object", "ClientUncore" );
316+
SocketCounterState before = getSocketCounter( aggPair_.first, cu->socketID() );
317+
SocketCounterState after = getSocketCounter( aggPair_.second, cu->socketID() );
318+
printUncoreCounterState( before, after );
316319
}
317320

318321
virtual void dispatch( Core* c ) override {
@@ -427,8 +430,12 @@ class JSONPrinter : Visitor
427430
printCounter( "Persistent Memory Reads", getBytesReadFromPMM ( before, after ) );
428431
printCounter( "Embedded DRAM Writes", getBytesWrittenToEDC ( before, after ) );
429432
printCounter( "Embedded DRAM Reads", getBytesReadFromEDC ( before, after ) );
433+
printCounter( "Memory Controller IA Requests", getIARequestBytesFromMC( before, after ) );
434+
printCounter( "Memory Controller GT Requests", getGTRequestBytesFromMC( before, after ) );
430435
printCounter( "Memory Controller IO Requests", getIORequestBytesFromMC( before, after ) );
431436
printCounter( "Package Joules Consumed", getConsumedJoules ( before, after ) );
437+
printCounter( "PP0 Joules Consumed", getConsumedJoules ( 0, before, after ) );
438+
printCounter( "PP1 Joules Consumed", getConsumedJoules ( 1, before, after ) );
432439
printCounter( "DRAM Joules Consumed", getDRAMConsumedJoules ( before, after ) );
433440
uint32 i = 0;
434441
for ( ; i < ( PCM::MAX_C_STATE ); ++i ) {
@@ -597,7 +604,11 @@ class PrometheusPrinter : Visitor
597604
printUncoreCounterState( before, after );
598605
}
599606

600-
virtual void dispatch( ClientUncore* ) override {
607+
virtual void dispatch( ClientUncore* cu) override {
608+
printComment( std::string( "Uncore Counters Socket " ) + std::to_string( cu->socketID() ) );
609+
SocketCounterState before = getSocketCounter( aggPair_.first, cu->socketID() );
610+
SocketCounterState after = getSocketCounter( aggPair_.second, cu->socketID() );
611+
printUncoreCounterState( before, after );
601612
}
602613

603614
virtual void dispatch( Core* c ) override {
@@ -700,8 +711,12 @@ class PrometheusPrinter : Visitor
700711
printCounter( "Persistent Memory Reads", getBytesReadFromPMM ( before, after ) );
701712
printCounter( "Embedded DRAM Writes", getBytesWrittenToEDC ( before, after ) );
702713
printCounter( "Embedded DRAM Reads", getBytesReadFromEDC ( before, after ) );
714+
printCounter( "Memory Controller IA Requests", getIARequestBytesFromMC( before, after ) );
715+
printCounter( "Memory Controller GT Requests", getGTRequestBytesFromMC( before, after ) );
703716
printCounter( "Memory Controller IO Requests", getIORequestBytesFromMC( before, after ) );
704717
printCounter( "Package Joules Consumed", getConsumedJoules ( before, after ) );
718+
printCounter( "PP0 Joules Consumed", getConsumedJoules ( 0, before, after ) );
719+
printCounter( "PP1 Joules Consumed", getConsumedJoules ( 1, before, after ) );
705720
printCounter( "DRAM Joules Consumed", getDRAMConsumedJoules ( before, after ) );
706721
uint32 i = 0;
707722
for ( ; i <= ( PCM::MAX_C_STATE ); ++i ) {

src/topology.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ UncoreCounterState ServerUncore::uncoreCounterState( void ) const
1818
return ucs;
1919
}
2020

21+
UncoreCounterState ClientUncore::uncoreCounterState( void ) const
22+
{
23+
UncoreCounterState ucs;
24+
// Fill the ucs
25+
PCM* pcm = PCM::getInstance();
26+
pcm->readAndAggregateUncoreMCCounters( socketID(), ucs );
27+
pcm->readAndAggregateEnergyCounters( socketID(), ucs );
28+
pcm->readAndAggregatePackageCStateResidencies( refCore()->msrHandle(), ucs );
29+
30+
return ucs;
31+
}
32+
2133
Socket::Socket( PCM* m, int32 apicID, int32 logicalID )
2234
: pcm_(m), refCore_(nullptr), apicID_(apicID), logicalID_(logicalID)
2335
{

src/topology.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,7 @@ class ClientUncore : public Uncore
261261
v.dispatch( this );
262262
}
263263

264-
virtual UncoreCounterState uncoreCounterState( void ) const override {
265-
UncoreCounterState ucs;
266-
// TODO: Fill the ucs
267-
return ucs;
268-
}
264+
virtual UncoreCounterState uncoreCounterState( void ) const override;
269265
};
270266

271267
class Socket : public SystemObject {

0 commit comments

Comments
 (0)