Skip to content

Commit d1a63aa

Browse files
authored
Merge pull request #955 from intel/push-2025-06-05
Push 2025 06 05
2 parents b9f9c57 + 1f8f43e commit d1a63aa

12 files changed

+55
-26
lines changed

.github/workflows/ci-cov-linux-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
ci-cov-linux-report.sh PCM.linux.and.python
3838
3939
- name: upload-artifact
40-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
40+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
4141
with:
4242
name: coverity-linux-and-python-report-${{ github.sha }}
4343
path: "*-Report.pdf"

.github/workflows/ci-cov-windows-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
c:\pcm\ci-cov-windows-report.ps1 PCM.windows-all
4949
5050
- name: upload-artifact
51-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
51+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
5252
with:
5353
name: coverity-windows-all-report-${{ github.sha }}
5454
path: "*-Report.pdf"

.github/workflows/ci-fuzz-micro.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
echo "Fuzzing completed"
4040
4141
- name: upload-artifact
42-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
42+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
4343
with:
4444
name: fuzz-log-${{ github.sha }}
4545
path: "build/fuzz-log.txt"

.github/workflows/ci-fuzz-short.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
echo "Fuzzing completed"
3939
4040
- name: upload-artifact
41-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
41+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
4242
with:
4343
name: fuzz-log-${{ github.sha }}
4444
path: "build/fuzz-log.txt"

.github/workflows/ci-fuzz.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
echo "Fuzzing completed"
4242
4343
- name: upload-artifact
44-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
44+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
4545
with:
4646
name: fuzz-log-${{ github.sha }}
4747
path: "build/fuzz-log.txt"

.github/workflows/ci-test.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,55 +41,55 @@ jobs:
4141
bash ${{ github.workspace }}/tests/test.sh 2>&1 | tee test-log.txt
4242
4343
- name: upload-artifact
44-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
44+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
4545
with:
4646
name: test-log-${{ github.sha }}
4747
path: test-log.txt
4848

4949
- name: upload-artifact
50-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
50+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
5151
with:
5252
name: test-log-raw-tr-wo_ext-${{ github.sha }}
5353
path: build/bin/raw_tr_wo_ext.csv
5454

5555
- name: upload-artifact
56-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
56+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
5757
with:
5858
name: test-log-raw-tr-wi_ext-${{ github.sha }}
5959
path: build/bin/raw_tr_wi_ext.csv
6060

6161
- name: upload-artifact
62-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
62+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
6363
with:
6464
name: pcm-csv-${{ github.sha }}
6565
path: build/bin/pcm.csv
6666

6767
- name: upload-artifact
68-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
68+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
6969
with:
7070
name: pcm-memory-csv-${{ github.sha }}
7171
path: build/bin/pcm-memory.csv
7272

7373
- name: upload-artifact
74-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
74+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
7575
with:
7676
name: test-log-raw-tr-wi_ext-single_header-${{ github.sha }}
7777
path: build/bin/raw_tr_wi_ext_single_header.csv
7878

7979
- name: upload-artifact
80-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
80+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
8181
with:
8282
name: test-log-raw-edp-${{ github.sha }}
8383
path: build/bin/raw_edp.txt
8484

8585
- name: upload-artifact
86-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
86+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
8787
with:
8888
name: test-log-raw-json-${{ github.sha }}
8989
path: build/bin/raw_json.json
9090

9191
- name: upload-artifact
92-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
92+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
9393
with:
9494
name: test-log-raw-edp-offlined-cores-${{ github.sha }}
9595
path: build/bin/raw_edp_offlined_cores.txt

.github/workflows/ci-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
chdir ${{github.workspace}}\src\WinMSRDriver
4242
msbuild MSR.vcxproj /p:Configuration=Release,Platform=x64 /t:Clean,Build /m
4343
- name: upload-artifact
44-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
44+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
4545
with:
4646
name: PCMforWindows
4747
path: build/bin/**/*

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6666
# format to the repository Actions tab.
6767
- name: "Upload artifact"
68-
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
68+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
6969
with:
7070
name: SARIF file
7171
path: results.sarif

src/cpucounters.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,7 @@ bool initRootBusMap(std::map<int, int> &rootbus_map)
18051805
for (auto & s2bus : socket2MSMbus)
18061806
{
18071807
uint32 cpuBusValid = 0x0;
1808-
int cpuBusPackageId;
1808+
int cpuBusPackageId = 0;
18091809
std::vector<uint32> cpuBusNo;
18101810

18111811
if (get_cpu_bus(s2bus.first, s2bus.second, SPR_MSM_DEV_ADDR, SPR_MSM_FUNC_ADDR, cpuBusValid, cpuBusNo, cpuBusPackageId) == false)
@@ -10283,6 +10283,7 @@ uint32 PCM::getMaxNumOfCBoxesInternal() const
1028310283
break;
1028410284
case SNOWRIDGE:
1028510285
num = (uint32)num_phys_cores_per_socket / 4;
10286+
maxNumOfCBoxesBasedOnCoreCount = true;
1028610287
break;
1028710288
default:
1028810289
/*
@@ -10291,6 +10292,7 @@ uint32 PCM::getMaxNumOfCBoxesInternal() const
1029110292
* value to be returned.
1029210293
*/
1029310294
num = (uint32)num_phys_cores_per_socket;
10295+
maxNumOfCBoxesBasedOnCoreCount = true;
1029410296
}
1029510297
#ifdef PCM_USE_PERF
1029610298
if (num <= 0)

src/cpucounters.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,11 @@ typedef SimpleCounterState IDXCounterState;
584584

585585
typedef std::vector<uint64> eventGroup_t;
586586

587+
inline constexpr int PCM_CPU_FAMILY_MODEL(int family_, int model_)
588+
{
589+
return ((family_) << 8) + (model_);
590+
}
591+
587592
class PerfVirtualControlRegister;
588593

589594
/*!
@@ -619,6 +624,7 @@ class PCM_API PCM
619624
int32 num_phys_cores_per_socket;
620625
int32 num_online_cores;
621626
int32 num_online_sockets;
627+
mutable bool maxNumOfCBoxesBasedOnCoreCount{false};
622628
uint32 accel;
623629
uint32 accel_counters_num_max;
624630
uint32 core_gen_counter_num_max;
@@ -1881,6 +1887,12 @@ class PCM_API PCM
18811887
*/
18821888
bool isSomeCoreOfflined();
18831889

1890+
//! \brief Returns true if the CBox or CHA PMU count detection relies on physical core count
1891+
bool isMaxNumOfCBoxesBasedOnCoreCount() const
1892+
{
1893+
return maxNumOfCBoxesBasedOnCoreCount;
1894+
}
1895+
18841896
/*! \brief Returns the maximum number of custom (general-purpose) core events supported by CPU
18851897
*/
18861898
int32 getMaxCustomCoreEvents();
@@ -1896,8 +1908,6 @@ class PCM_API PCM
18961908
*/
18971909
static int getCPUFamilyModelFromCPUID();
18981910

1899-
#define PCM_CPU_FAMILY_MODEL(family_, model_) (((family_) << 8) + (model_))
1900-
19011911
//! \brief Identifiers of supported CPU models
19021912
enum SupportedCPUModels
19031913
{

src/pcm-pcie.h

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,25 @@ void IPlatform::init()
7070
{
7171
print_cpu_details();
7272

73-
if (m_pcm->isSomeCoreOfflined())
73+
if (m_pcm->getMaxNumOfUncorePMUs(PCM::CBO_PMU_ID) == 0) // CHAs (CBoxes) PMUs are not available
7474
{
75-
cerr << "Core offlining is not supported. Program aborted\n";
75+
cerr << "Your processor/system does not support CHA PCIe performance counters. Program aborted\n";
76+
exit(EXIT_FAILURE);
77+
}
78+
79+
if (m_pcm->isMaxNumOfCBoxesBasedOnCoreCount() && m_pcm->isSomeCoreOfflined())
80+
{
81+
/*
82+
The bandwwidth metrics can be calculated correctly only if we aggregate
83+
the event counts from all CHAs (CBoxes) in the socket. For this need to
84+
know the number of CBoxes in the socket. For some processors we do not
85+
have access to a register containing the CHA count but on those processors
86+
the number of CBoxes is equal to the number of cores. On such systems if
87+
the cores are offlined then the number of CBoxes can't be determined.
88+
pcm-pcie does not support such systems because the bandwidth can't be
89+
computed correctly.
90+
*/
91+
cerr << "Core offlining is not supported on your processor. Program aborted\n";
7692
exit(EXIT_FAILURE);
7793
}
7894
}

src/pcm-sensor-server.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4065,11 +4065,12 @@ int mainThrows(int argc, char * argv[]) {
40654065
PCIeEventNameMap_t nameMap;
40664066

40674067
// TODO: add check for IIO support before trying to initialize the pmu
4068-
if ( !initializeIIOCounters( iios, evt_ctx, nameMap ) )
4069-
{
4070-
std::cerr << "Error: IIO is NOT supported with this platform! Program aborted\n";
4071-
exit(EXIT_FAILURE);
4072-
}
4068+
// Otto: re-add this check when there is support for IIO and do it properly, seems to fail for some reason, see #788
4069+
// if ( !initializeIIOCounters( iios, evt_ctx, nameMap ) )
4070+
// {
4071+
// std::cerr << "Error: IIO is NOT supported with this platform! Program aborted\n";
4072+
// exit(EXIT_FAILURE);
4073+
// }
40734074

40744075
// Now that everything is set we can start the http(s) server
40754076
#if defined (USE_SSL)

0 commit comments

Comments
 (0)