Skip to content
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 .github/workflows/ci-cov-linux-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
ci-cov-linux-report.sh PCM.linux.and.python

- name: upload-artifact
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: coverity-linux-and-python-report-${{ github.sha }}
path: "*-Report.pdf"
2 changes: 1 addition & 1 deletion .github/workflows/ci-cov-windows-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
c:\pcm\ci-cov-windows-report.ps1 PCM.windows-all

- name: upload-artifact
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: coverity-windows-all-report-${{ github.sha }}
path: "*-Report.pdf"
2 changes: 1 addition & 1 deletion .github/workflows/ci-fuzz-micro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
echo "Fuzzing completed"

- name: upload-artifact
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: fuzz-log-${{ github.sha }}
path: "build/fuzz-log.txt"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-fuzz-short.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
echo "Fuzzing completed"

- name: upload-artifact
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: fuzz-log-${{ github.sha }}
path: "build/fuzz-log.txt"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
echo "Fuzzing completed"

- name: upload-artifact
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: fuzz-log-${{ github.sha }}
path: "build/fuzz-log.txt"
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,55 +41,55 @@ jobs:
bash ${{ github.workspace }}/tests/test.sh 2>&1 | tee test-log.txt

- name: upload-artifact
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: test-log-${{ github.sha }}
path: test-log.txt

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

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

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

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

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

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

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

- name: upload-artifact
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: test-log-raw-edp-offlined-cores-${{ github.sha }}
path: build/bin/raw_edp_offlined_cores.txt
2 changes: 1 addition & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
chdir ${{github.workspace}}\src\WinMSRDriver
msbuild MSR.vcxproj /p:Configuration=Release,Platform=x64 /t:Clean,Build /m
- name: upload-artifact
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: PCMforWindows
path: build/bin/**/*
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: SARIF file
path: results.sarif
Expand Down
4 changes: 3 additions & 1 deletion src/cpucounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,7 @@ bool initRootBusMap(std::map<int, int> &rootbus_map)
for (auto & s2bus : socket2MSMbus)
{
uint32 cpuBusValid = 0x0;
int cpuBusPackageId;
int cpuBusPackageId = 0;
std::vector<uint32> cpuBusNo;

if (get_cpu_bus(s2bus.first, s2bus.second, SPR_MSM_DEV_ADDR, SPR_MSM_FUNC_ADDR, cpuBusValid, cpuBusNo, cpuBusPackageId) == false)
Expand Down Expand Up @@ -10283,6 +10283,7 @@ uint32 PCM::getMaxNumOfCBoxesInternal() const
break;
case SNOWRIDGE:
num = (uint32)num_phys_cores_per_socket / 4;
maxNumOfCBoxesBasedOnCoreCount = true;
break;
default:
/*
Expand All @@ -10291,6 +10292,7 @@ uint32 PCM::getMaxNumOfCBoxesInternal() const
* value to be returned.
*/
num = (uint32)num_phys_cores_per_socket;
maxNumOfCBoxesBasedOnCoreCount = true;
}
#ifdef PCM_USE_PERF
if (num <= 0)
Expand Down
14 changes: 12 additions & 2 deletions src/cpucounters.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,11 @@ typedef SimpleCounterState IDXCounterState;

typedef std::vector<uint64> eventGroup_t;

inline constexpr int PCM_CPU_FAMILY_MODEL(int family_, int model_)
{
return ((family_) << 8) + (model_);
}

class PerfVirtualControlRegister;

/*!
Expand Down Expand Up @@ -619,6 +624,7 @@ class PCM_API PCM
int32 num_phys_cores_per_socket;
int32 num_online_cores;
int32 num_online_sockets;
mutable bool maxNumOfCBoxesBasedOnCoreCount{false};
uint32 accel;
uint32 accel_counters_num_max;
uint32 core_gen_counter_num_max;
Expand Down Expand Up @@ -1881,6 +1887,12 @@ class PCM_API PCM
*/
bool isSomeCoreOfflined();

//! \brief Returns true if the CBox or CHA PMU count detection relies on physical core count
bool isMaxNumOfCBoxesBasedOnCoreCount() const
{
return maxNumOfCBoxesBasedOnCoreCount;
}

/*! \brief Returns the maximum number of custom (general-purpose) core events supported by CPU
*/
int32 getMaxCustomCoreEvents();
Expand All @@ -1896,8 +1908,6 @@ class PCM_API PCM
*/
static int getCPUFamilyModelFromCPUID();

#define PCM_CPU_FAMILY_MODEL(family_, model_) (((family_) << 8) + (model_))

//! \brief Identifiers of supported CPU models
enum SupportedCPUModels
{
Expand Down
20 changes: 18 additions & 2 deletions src/pcm-pcie.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,25 @@ void IPlatform::init()
{
print_cpu_details();

if (m_pcm->isSomeCoreOfflined())
if (m_pcm->getMaxNumOfUncorePMUs(PCM::CBO_PMU_ID) == 0) // CHAs (CBoxes) PMUs are not available
{
cerr << "Core offlining is not supported. Program aborted\n";
cerr << "Your processor/system does not support CHA PCIe performance counters. Program aborted\n";
exit(EXIT_FAILURE);
}

if (m_pcm->isMaxNumOfCBoxesBasedOnCoreCount() && m_pcm->isSomeCoreOfflined())
{
/*
The bandwwidth metrics can be calculated correctly only if we aggregate
the event counts from all CHAs (CBoxes) in the socket. For this need to
know the number of CBoxes in the socket. For some processors we do not
have access to a register containing the CHA count but on those processors
the number of CBoxes is equal to the number of cores. On such systems if
the cores are offlined then the number of CBoxes can't be determined.
pcm-pcie does not support such systems because the bandwidth can't be
computed correctly.
*/
cerr << "Core offlining is not supported on your processor. Program aborted\n";
exit(EXIT_FAILURE);
}
}
Expand Down
11 changes: 6 additions & 5 deletions src/pcm-sensor-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4065,11 +4065,12 @@ int mainThrows(int argc, char * argv[]) {
PCIeEventNameMap_t nameMap;

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

// Now that everything is set we can start the http(s) server
#if defined (USE_SSL)
Expand Down
Loading