Skip to content

Commit 0f3bdfc

Browse files
authored
Merge pull request #979 from intel/push-2025-10-31
Push 2025 10 31
2 parents 03f3aed + c66d390 commit 0f3bdfc

28 files changed

+2959
-2332
lines changed

.github/workflows/freebsd_build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ jobs:
3232
operating_system: freebsd
3333
version: '14.2'
3434
run: |
35+
export IGNORE_OSVERSION=yes
3536
sudo mkdir -p /usr/local/etc/pkg/repos
3637
sudo sh -c 'echo "FreeBSD: { url: \"https://pkg.FreeBSD.org/\${ABI}/quarterly\", mirror_type: \"srv\", enabled: yes }" > /usr/local/etc/pkg/repos/FreeBSD.conf'
37-
sudo pkg update -f
38-
sudo pkg upgrade -y
39-
sudo pkg install -y curl gmake cmake
38+
sudo -E pkg update -f
39+
sudo -E pkg upgrade -y
40+
sudo -E pkg install -y curl gmake cmake
4041
pwd
4142
ls -lah
4243
whoami

.github/workflows/freebsd_scan_build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ jobs:
3232
operating_system: freebsd
3333
version: '14.2'
3434
run: |
35+
export IGNORE_OSVERSION=yes
3536
sudo mkdir -p /usr/local/etc/pkg/repos
3637
sudo sh -c 'echo "FreeBSD: { url: \"https://pkg.FreeBSD.org/\${ABI}/quarterly\", mirror_type: \"srv\", enabled: yes }" > /usr/local/etc/pkg/repos/FreeBSD.conf'
37-
sudo pkg update -f
38-
sudo pkg upgrade -y
39-
sudo pkg install -y curl gmake cmake devel/llvm llvm
38+
sudo -E pkg update -f
39+
sudo -E pkg upgrade -y
40+
sudo -E pkg install -y curl gmake cmake devel/llvm llvm
4041
pwd
4142
ls -lah
4243
whoami

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ latex/
3434
build
3535
src/simdjson
3636
.vscode/
37+
_codeql_build_dir/

_codeql_detected_source_root

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set(PROJECT_NAMES pcm pcm-numa pcm-latency pcm-power pcm-msr pcm-memory pcm-tsx
88

99
set(MINIMUM_OPENSSL_VERSION 1.1.1)
1010

11-
file(GLOB COMMON_SOURCES pcm-accel-common.cpp msr.cpp cpucounters.cpp pci.cpp mmio.cpp tpmi.cpp pmt.cpp bw.cpp utils.cpp topology.cpp debug.cpp threadpool.cpp uncore_pmu_discovery.cpp pcm-iio-pmu.cpp lspci.cpp ${PCM_PUGIXML_CPP})
11+
file(GLOB COMMON_SOURCES pcm-accel-common.cpp msr.cpp cpucounters.cpp pci.cpp mmio.cpp tpmi.cpp pmt.cpp bw.cpp utils.cpp topology.cpp debug.cpp threadpool.cpp uncore_pmu_discovery.cpp pcm-iio-pmu.cpp pcm-iio-topology.cpp lspci.cpp ${PCM_PUGIXML_CPP})
1212

1313
if (APPLE)
1414
file(GLOB UNIX_SOURCES dashboard.cpp)

src/cpucounters.cpp

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ void PCM::initCStateSupportTables()
717717
case MTL:
718718
case LNL:
719719
case ARL:
720+
case PTL:
720721
case SNOWRIDGE:
721722
case ELKHART_LAKE:
722723
case JASPER_LAKE:
@@ -798,6 +799,7 @@ void PCM::initCStateSupportTables()
798799
case MTL:
799800
case LNL:
800801
case ARL:
802+
case PTL:
801803
case SNOWRIDGE:
802804
case ELKHART_LAKE:
803805
case JASPER_LAKE:
@@ -1695,6 +1697,7 @@ bool PCM::detectNominalFrequency()
16951697
|| cpu_family_model == MTL
16961698
|| cpu_family_model == LNL
16971699
|| cpu_family_model == ARL
1700+
|| cpu_family_model == PTL
16981701
|| cpu_family_model == SKX
16991702
|| cpu_family_model == ICX
17001703
|| cpu_family_model == SPR
@@ -1974,6 +1977,7 @@ void PCM::initUncoreObjects()
19741977
case MTL: // TGLClientBW works fine for MTL
19751978
case LNL: // TGLClientBW works fine for LNL
19761979
case ARL: // TGLClientBW works fine for ARL
1980+
case PTL: // TGLClientBW works fine for PTL
19771981
clientBW = std::make_shared<TGLClientBW>();
19781982
break;
19791983
/* Disabled since ADLClientBW requires 2x multiplier for BW on top
@@ -3417,6 +3421,7 @@ bool PCM::isCPUModelSupported(const int model_)
34173421
|| model_ == MTL
34183422
|| model_ == LNL
34193423
|| model_ == ARL
3424+
|| model_ == PTL
34203425
|| model_ == SKX
34213426
|| model_ == ICX
34223427
|| model_ == SPR
@@ -3599,6 +3604,7 @@ PCM::ErrorCode PCM::program(const PCM::ProgramMode mode_, const void * parameter
35993604
|| cpu_family_model == MTL
36003605
|| cpu_family_model == LNL
36013606
|| cpu_family_model == ARL
3607+
|| cpu_family_model == PTL
36023608
))
36033609
{
36043610
canUsePerf = false;
@@ -3688,6 +3694,7 @@ PCM::ErrorCode PCM::program(const PCM::ProgramMode mode_, const void * parameter
36883694
case MTL:
36893695
case LNL:
36903696
case ARL:
3697+
case PTL:
36913698
LLCArchEventInit(hybridAtomEventDesc);
36923699
hybridAtomEventDesc[2].event_number = SKL_MEM_LOAD_RETIRED_L2_MISS_EVTNR;
36933700
hybridAtomEventDesc[2].umask_value = SKL_MEM_LOAD_RETIRED_L2_MISS_UMASK;
@@ -4980,12 +4987,8 @@ bool PCM::PMUinUse()
49804987
return false;
49814988
}
49824989

4983-
const char * PCM::getUArchCodename(const int32 cpu_family_model_param) const
4990+
const char * PCM::cpuFamilyModelToUArchCodename(const int32 cpu_family_model_, const int32 cpu_stepping_)
49844991
{
4985-
auto cpu_family_model_ = cpu_family_model_param;
4986-
if(cpu_family_model_ < 0)
4987-
cpu_family_model_ = this->cpu_family_model;
4988-
49894992
switch(cpu_family_model_)
49904993
{
49914994
case CENTERTON:
@@ -5067,17 +5070,19 @@ const char * PCM::getUArchCodename(const int32 cpu_family_model_param) const
50675070
return "Lunar Lake";
50685071
case ARL:
50695072
return "Arrow Lake";
5073+
case PTL:
5074+
return "Panther Lake";
50705075
case SKX:
5071-
if (cpu_family_model_param >= 0)
5076+
if (cpu_stepping_ < 0)
50725077
{
5073-
// query for specified cpu_family_model_param, stepping not provided
5078+
// Stepping is not provided
50745079
return "Skylake-SP, Cascade Lake-SP";
50755080
}
5076-
if (isCLX())
5081+
if (isCLX(cpu_family_model_, cpu_stepping_))
50775082
{
50785083
return "Cascade Lake-SP";
50795084
}
5080-
if (isCPX())
5085+
if (isCPX(cpu_family_model_, cpu_stepping_))
50815086
{
50825087
return "Cooper Lake";
50835088
}
@@ -5100,6 +5105,18 @@ const char * PCM::getUArchCodename(const int32 cpu_family_model_param) const
51005105
return "unknown";
51015106
}
51025107

5108+
const char * PCM::getUArchCodename(const int32 cpu_family_model_param) const
5109+
{
5110+
auto cpu_family_model_ = cpu_family_model_param;
5111+
auto cpu_stepping_ = -1;
5112+
if (cpu_family_model_ < 0) {
5113+
cpu_family_model_ = this->cpu_family_model;
5114+
cpu_stepping_ = this->cpu_stepping;
5115+
}
5116+
5117+
return cpuFamilyModelToUArchCodename(cpu_family_model_, cpu_stepping_);
5118+
}
5119+
51035120
#ifdef PCM_USE_PERF
51045121
void PCM::closePerfHandles(const bool silent)
51055122
{
@@ -10348,6 +10365,11 @@ uint32 PCM::getMaxNumOfIIOStacks() const
1034810365
return 0;
1034910366
}
1035010367

10368+
uint32 PCM::getMaxNumOfIOStacks() const
10369+
{
10370+
return getMaxNumOfIIOStacks();
10371+
}
10372+
1035110373
void PCM::programCboOpcodeFilter(const uint32 opc0, UncorePMU & pmu, const uint32 nc_, const uint32 opc1, const uint32 loc, const uint32 rem)
1035210374
{
1035310375
if (JAKETOWN == cpu_family_model)

src/cpucounters.h

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ class IDX_PMU
313313
std::vector<HWRegisterPtr> counterFilterENG;
314314
std::vector<HWRegisterPtr> counterFilterTC;
315315
std::vector<HWRegisterPtr> counterFilterPGSZ;
316-
std::vector<HWRegisterPtr> counterFilterXFERSZ;
316+
std::vector<HWRegisterPtr> counterFilterXFERSZ;
317317

318318
IDX_PMU(const bool perfMode_,
319319
const uint32 numaNode_,
@@ -570,7 +570,6 @@ class SimpleCounterState
570570
friend uint64 getNumberOfEvents(const T & before, const T & after);
571571
friend class PCM;
572572
uint64 data;
573-
574573
public:
575574
SimpleCounterState() : data(0)
576575
{ }
@@ -957,6 +956,7 @@ class PCM_API PCM
957956
THRESH,
958957
CH_MASK,
959958
FC_MASK,
959+
UNIT_TYPE,
960960
/* Below are not part of perfmon definition */
961961
H_EVENT_NAME,
962962
V_EVENT_NAME,
@@ -1281,9 +1281,14 @@ class PCM_API PCM
12811281
void programCXLCM(const uint64* events);
12821282
void cleanupUncorePMUs(const bool silent = false);
12831283

1284+
static bool isCLX(int cpu_family_model_, int cpu_stepping_)
1285+
{
1286+
return (PCM::SKX == cpu_family_model_) && (cpu_stepping_ > 4 && cpu_stepping_ < 8);
1287+
}
1288+
12841289
bool isCLX() const // Cascade Lake-SP
12851290
{
1286-
return (PCM::SKX == cpu_family_model) && (cpu_stepping > 4 && cpu_stepping < 8);
1291+
return isCLX(cpu_family_model, cpu_stepping);
12871292
}
12881293

12891294
static bool isCPX(int cpu_family_model_, int cpu_stepping_) // Cooper Lake
@@ -1397,6 +1402,9 @@ class PCM_API PCM
13971402
//! \brief Returns the number of IIO stacks per socket
13981403
uint32 getMaxNumOfIIOStacks() const;
13991404

1405+
//! \brief Returns the number of IO stacks per socket
1406+
uint32 getMaxNumOfIOStacks() const;
1407+
14001408
/*! \brief Returns the number of IDX accel devs
14011409
\param accel index of IDX accel
14021410
*/
@@ -1682,6 +1690,7 @@ class PCM_API PCM
16821690
case MTL:
16831691
case LNL:
16841692
case ARL:
1693+
case PTL:
16851694
if (topology[coreID].core_type == TopologyEntry::Atom)
16861695
{
16871696
return eCoreOCREvent;
@@ -1701,6 +1710,7 @@ class PCM_API PCM
17011710
case MTL:
17021711
case LNL:
17031712
case ARL:
1713+
case PTL:
17041714
useGLCOCREvent = true;
17051715
break;
17061716

@@ -1753,7 +1763,7 @@ class PCM_API PCM
17531763
17541764
One needs to call this method when your program finishes or/and you are not going to use the
17551765
performance counting routines anymore.
1756-
*/
1766+
*/
17571767
void cleanup(const bool silent = false);
17581768

17591769
/*! \brief Forces PMU reset
@@ -1831,7 +1841,7 @@ class PCM_API PCM
18311841
\return Number of sockets in the system
18321842
*/
18331843
uint32 getNumSockets() const;
1834-
1844+
18351845
/*! \brief Reads the accel type in the system
18361846
\return acceltype
18371847
*/
@@ -1849,7 +1859,7 @@ class PCM_API PCM
18491859

18501860
/*! \brief Sets the Number of AccelCounters in the system
18511861
\return number of counters
1852-
*/
1862+
*/
18531863
void setNumberofAccelCounters(uint32 input);
18541864

18551865
/*! \brief Reads number of online sockets (CPUs) in the system
@@ -1960,6 +1970,7 @@ class PCM_API PCM
19601970
LNL = PCM_CPU_FAMILY_MODEL(6, 0xBD),
19611971
ARL = PCM_CPU_FAMILY_MODEL(6, 197),
19621972
ARL_1 = PCM_CPU_FAMILY_MODEL(6, 198),
1973+
PTL = PCM_CPU_FAMILY_MODEL(6, 204),
19631974
BDX = PCM_CPU_FAMILY_MODEL(6, 79),
19641975
KNL = PCM_CPU_FAMILY_MODEL(6, 87),
19651976
SKL = PCM_CPU_FAMILY_MODEL(6, 94),
@@ -2201,6 +2212,7 @@ class PCM_API PCM
22012212
return 6;
22022213
case LNL:
22032214
case ARL:
2215+
case PTL:
22042216
return 12;
22052217
case SNOWRIDGE:
22062218
case ELKHART_LAKE:
@@ -2422,19 +2434,18 @@ class PCM_API PCM
24222434

24232435
//! \brief Control QAT telemetry service
24242436
//! \param dev device index
2425-
//! \param operation control code
2437+
//! \param operation control code
24262438
void controlQATTelemetry(uint32 dev, uint32 operation);
24272439

24282440
//! \brief Program IDX events
24292441
//! \param events config of event to program
2430-
//! \param filters_wq filters(work queue) of event to program
2431-
//! \param filters_eng filters(engine) of event to program
2432-
//! \param filters_tc filters(traffic class) of event to program
2433-
//! \param filters_pgsz filters(page size) of event to program
2434-
//! \param filters_xfersz filters(transfer size) of event to program
2442+
//! \param filters_wq filters(work queue) of event to program
2443+
//! \param filters_eng filters(engine) of event to program
2444+
//! \param filters_tc filters(traffic class) of event to program
2445+
//! \param filters_pgsz filters(page size) of event to program
2446+
//! \param filters_xfersz filters(transfer size) of event to program
24352447
void programIDXAccelCounters(uint32 accel, std::vector<uint64_t> &events, std::vector<uint32> &filters_wq, std::vector<uint32> &filters_eng, std::vector<uint32> &filters_tc, std::vector<uint32> &filters_pgsz, std::vector<uint32> &filters_xfersz);
24362448

2437-
24382449
//! \brief Get the state of IIO counter
24392450
//! \param socket socket of the IIO stack
24402451
//! \param IIOStack id of the IIO stack
@@ -2465,6 +2476,11 @@ class PCM_API PCM
24652476
//! \param cpu_family_model_ cpu model (if no parameter provided the codename of the detected CPU is returned)
24662477
const char * getUArchCodename(const int32 cpu_family_model_ = -1) const;
24672478

2479+
//! \brief Convert CPU Family/Model/Stepping to microarchitecture codename
2480+
//! \param cpu_family_model_ cpu family model
2481+
//! \param cpu_stepping necessary for some CPU models to distinguish between different microarchitectures
2482+
static const char * cpuFamilyModelToUArchCodename(const int32 cpu_family_model_, const int32 cpu_stepping_ = -1);
2483+
24682484
//! \brief Get Brand string of processor
24692485
static std::string getCPUBrandString();
24702486
std::string getCPUFamilyModelString();
@@ -2553,6 +2569,7 @@ class PCM_API PCM
25532569
|| cpu_family_model == PCM::MTL
25542570
|| cpu_family_model == PCM::LNL
25552571
|| cpu_family_model == PCM::ARL
2572+
|| cpu_family_model == PCM::PTL
25562573
|| cpu_family_model == PCM::SPR
25572574
|| cpu_family_model == PCM::EMR
25582575
|| cpu_family_model == PCM::GNR
@@ -2593,6 +2610,7 @@ class PCM_API PCM
25932610
|| cpu_family_model == PCM::MTL
25942611
|| cpu_family_model == PCM::LNL
25952612
|| cpu_family_model == PCM::ARL
2613+
|| cpu_family_model == PCM::PTL
25962614
|| cpu_family_model == PCM::SPR
25972615
|| cpu_family_model == PCM::EMR
25982616
|| cpu_family_model == PCM::GNR
@@ -2668,7 +2686,7 @@ class PCM_API PCM
26682686
|| cpu_family_model == PCM::GNR_D
26692687
);
26702688
}
2671-
2689+
26722690
bool memoryTrafficMetricsAvailable() const
26732691
{
26742692
return (!(isAtom() || cpu_family_model == PCM::CLARKDALE))
@@ -2893,6 +2911,7 @@ class PCM_API PCM
28932911
|| cpu_family_model == MTL
28942912
|| cpu_family_model == LNL
28952913
|| cpu_family_model == ARL
2914+
|| cpu_family_model == PTL
28962915
|| useSKLPath()
28972916
;
28982917
}
@@ -4458,6 +4477,7 @@ uint64 getL2CacheMisses(const CounterStateType & before, const CounterStateType
44584477
|| cpu_family_model == PCM::MTL
44594478
|| cpu_family_model == PCM::LNL
44604479
|| cpu_family_model == PCM::ARL
4480+
|| cpu_family_model == PCM::PTL
44614481
) {
44624482
return after.Event[BasicCounterState::SKLL2MissPos] - before.Event[BasicCounterState::SKLL2MissPos];
44634483
}
@@ -4574,6 +4594,7 @@ uint64 getL3CacheHitsSnoop(const CounterStateType & before, const CounterStateTy
45744594
|| cpu_family_model == PCM::MTL
45754595
|| cpu_family_model == PCM::LNL
45764596
|| cpu_family_model == PCM::ARL
4597+
|| cpu_family_model == PCM::PTL
45774598
)
45784599
{
45794600
const int64 misses = getL3CacheMisses(before, after);

0 commit comments

Comments
 (0)