Skip to content

Push 2024 04 13 #721

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

Merged
merged 2 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/grafana/clean.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


sh stop.sh
rm -rf provisioning/datasources
rm -rf *_volume
2 changes: 1 addition & 1 deletion scripts/grafana/start-prometheus.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

set -e

Expand Down
2 changes: 1 addition & 1 deletion scripts/grafana/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

set -e

Expand Down
1 change: 1 addition & 0 deletions src/cpucounters.h
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ class PCM_API PCM
friend class UncoreCounterState;
friend class Socket;
friend class ServerUncore;
friend class ClientUncore;
friend class PerfVirtualControlRegister;
friend class Aggregator;
friend class ServerUncorePMUs;
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ std::string getPCMDashboardJSON(const PCMDashboardType type, int ns, int nu, int
auto panel = std::make_shared<GraphPanel>(0, y, width, height, std::string("Socket") + S + " Energy Consumption", "Watt", false);
auto panel1 = std::make_shared<BarGaugePanel>(width, y, max_width - width, height, std::string("Current Socket") + S + " Energy Consumption (Watt)");
y += height;
for (auto &m : {"Package Joules Consumed", "DRAM Joules Consumed"})
for (auto &m : {"Package Joules Consumed", "DRAM Joules Consumed", "PP0 Joules Consumed", "PP1 Joules Consumed"})
{
auto t = createTarget(m, influxDBUncore_Uncore_Counters(S, m), prometheusCounters(S, m, false));
panel->push(t);
Expand Down
19 changes: 17 additions & 2 deletions src/pcm-sensor-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,11 @@ class JSONPrinter : Visitor
printUncoreCounterState( before, after );
}

virtual void dispatch( ClientUncore* ) override {
virtual void dispatch( ClientUncore* cu) override {
printCounter( "Object", "ClientUncore" );
SocketCounterState before = getSocketCounter( aggPair_.first, cu->socketID() );
SocketCounterState after = getSocketCounter( aggPair_.second, cu->socketID() );
printUncoreCounterState( before, after );
}

virtual void dispatch( Core* c ) override {
Expand Down Expand Up @@ -427,8 +430,12 @@ class JSONPrinter : Visitor
printCounter( "Persistent Memory Reads", getBytesReadFromPMM ( before, after ) );
printCounter( "Embedded DRAM Writes", getBytesWrittenToEDC ( before, after ) );
printCounter( "Embedded DRAM Reads", getBytesReadFromEDC ( before, after ) );
printCounter( "Memory Controller IA Requests", getIARequestBytesFromMC( before, after ) );
printCounter( "Memory Controller GT Requests", getGTRequestBytesFromMC( before, after ) );
printCounter( "Memory Controller IO Requests", getIORequestBytesFromMC( before, after ) );
printCounter( "Package Joules Consumed", getConsumedJoules ( before, after ) );
printCounter( "PP0 Joules Consumed", getConsumedJoules ( 0, before, after ) );
printCounter( "PP1 Joules Consumed", getConsumedJoules ( 1, before, after ) );
printCounter( "DRAM Joules Consumed", getDRAMConsumedJoules ( before, after ) );
uint32 i = 0;
for ( ; i < ( PCM::MAX_C_STATE ); ++i ) {
Expand Down Expand Up @@ -597,7 +604,11 @@ class PrometheusPrinter : Visitor
printUncoreCounterState( before, after );
}

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

virtual void dispatch( Core* c ) override {
Expand Down Expand Up @@ -700,8 +711,12 @@ class PrometheusPrinter : Visitor
printCounter( "Persistent Memory Reads", getBytesReadFromPMM ( before, after ) );
printCounter( "Embedded DRAM Writes", getBytesWrittenToEDC ( before, after ) );
printCounter( "Embedded DRAM Reads", getBytesReadFromEDC ( before, after ) );
printCounter( "Memory Controller IA Requests", getIARequestBytesFromMC( before, after ) );
printCounter( "Memory Controller GT Requests", getGTRequestBytesFromMC( before, after ) );
printCounter( "Memory Controller IO Requests", getIORequestBytesFromMC( before, after ) );
printCounter( "Package Joules Consumed", getConsumedJoules ( before, after ) );
printCounter( "PP0 Joules Consumed", getConsumedJoules ( 0, before, after ) );
printCounter( "PP1 Joules Consumed", getConsumedJoules ( 1, before, after ) );
printCounter( "DRAM Joules Consumed", getDRAMConsumedJoules ( before, after ) );
uint32 i = 0;
for ( ; i <= ( PCM::MAX_C_STATE ); ++i ) {
Expand Down
12 changes: 12 additions & 0 deletions src/topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ UncoreCounterState ServerUncore::uncoreCounterState( void ) const
return ucs;
}

UncoreCounterState ClientUncore::uncoreCounterState( void ) const
{
UncoreCounterState ucs;
// Fill the ucs
PCM* pcm = PCM::getInstance();
pcm->readAndAggregateUncoreMCCounters( socketID(), ucs );
pcm->readAndAggregateEnergyCounters( socketID(), ucs );
pcm->readAndAggregatePackageCStateResidencies( refCore()->msrHandle(), ucs );

return ucs;
}

Socket::Socket( PCM* m, int32 apicID, int32 logicalID )
: pcm_(m), refCore_(nullptr), apicID_(apicID), logicalID_(logicalID)
{
Expand Down
6 changes: 1 addition & 5 deletions src/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,7 @@ class ClientUncore : public Uncore
v.dispatch( this );
}

virtual UncoreCounterState uncoreCounterState( void ) const override {
UncoreCounterState ucs;
// TODO: Fill the ucs
return ucs;
}
virtual UncoreCounterState uncoreCounterState( void ) const override;
};

class Socket : public SystemObject {
Expand Down