Skip to content
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

Push 2024 08 09 #809

Merged
merged 22 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
55720f1
Bump step-security/harden-runner from 2.6.1 to 2.8.1
dependabot[bot] Jul 14, 2024
106d729
Bump actions/checkout from 3.6.0 to 4.1.7
dependabot[bot] Jul 14, 2024
c3d9d93
Fix double free (#790)
artiomn Jul 17, 2024
3da43d8
add a test for pcm --color
rdementi Jul 17, 2024
00f200b
Merge remote-tracking branch 'opcm-github/master'
rdementi Jul 17, 2024
91018e2
Merge branch 'rdementi-2024-07-17'
rdementi Jul 17, 2024
7973264
fuzz every monday at midnight
rdementi Jul 20, 2024
066ed22
pcm-tpmi: add -i instances option
rdementi Jul 20, 2024
9f151d2
Merge remote-tracking branch 'opcm-github/master'
rdementi Jul 21, 2024
11b9d97
Bump actions/upload-artifact from 3.1.3 to 4.3.4
dependabot[bot] Jul 21, 2024
136abb2
grafana: don't show unsupported metrics in prometheus
rdementi Jul 23, 2024
81ff4c7
grafana: add local/remote access ratio metric
rdementi Jul 23, 2024
d6d3596
grafana: add TMA metrics
rdementi Jul 23, 2024
94f160a
link 1 does not have own speed register only on QPI
rdementi Jul 24, 2024
297131a
addition of a fuzzing client and subsequent rewrite of parts of the n…
rdementi Aug 7, 2024
2a0efaf
Bump fedora from `4e007f2` to `5ce8497`
dependabot[bot] Jun 2, 2024
a3f7d16
Options prefix add. Executables build option add: #794
Jul 28, 2024
8b68509
NO_STATIC_LIBASAN replaced with option. pcm.spec fixed: #794
Jul 30, 2024
12d80ad
pass CMAKE_INSTALL_PREFIX to the compile units on UNIX like systems
rdementi Aug 7, 2024
9062348
avoid using the hard-coded /usr/share/pcm/ path
rdementi Aug 7, 2024
23eead4
pcm-raw: really use the alt_path if it exists (a bug fix)
rdementi Aug 8, 2024
4635f40
Merge tag '2024-08-09' into push-2024-08-09
rdementi Aug 9, 2024
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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 @@ -40,55 +40,55 @@ jobs:
bash ${{ github.workspace }}/tests/test.sh 2>&1 | tee test-log.txt

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

- name: upload-artifact
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: pcm-csv-${{ github.sha }}
path: build/bin/pcm.csv

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

- name: upload-artifact
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: test-log-raw-edp-${{ github.sha }}
path: build/bin/raw_edp.txt

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

- name: upload-artifact
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: SARIF file
path: results.sarif
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if(UNIX) # APPLE, LINUX, FREE_BSD
message(STATUS "initial CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")

# required PCM common flags
set (PCM_COMMON_FLAGS "-Wno-unknown-pragmas -fPIC")
set (PCM_COMMON_FLAGS "-Wno-unknown-pragmas -fPIC -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\"")

if(LINUX)
set (PCM_COMMON_FLAGS "${PCM_COMMON_FLAGS} -Wextra -DPCM_USE_PERF")
Expand Down
4 changes: 2 additions & 2 deletions src/cpucounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9485,7 +9485,7 @@ uint64 ServerUncorePMUs::computeQPISpeed(const uint32 core_nr, const int cpumode
qpi_speed.resize(getNumQPIPorts());

auto getSpeed = [&] (size_t i) {
if (i == 1) return 0ULL; // link 1 should have the same speed as link 0, skip it
if (PCM::hasUPI(cpumodel) == false && i == 1) return 0ULL; // link 1 should have the same speed as link 0, skip it
uint64 result = 0;
if (PCM::hasUPI(cpumodel) == false && i < XPIRegisterLocation.size())
{
Expand Down Expand Up @@ -9571,7 +9571,7 @@ uint64 ServerUncorePMUs::computeQPISpeed(const uint32 core_nr, const int cpumode
getSpeedsAsync.push_back(std::async(std::launch::async, getSpeed, i));
}
for (size_t i = 0; i < getNumQPIPorts(); ++i) {
qpi_speed[i] = (i==1)? qpi_speed[0] : getSpeedsAsync[i].get(); // link 1 does not have own speed register, it runs with the speed of link 0
qpi_speed[i] = (PCM::hasUPI(cpumodel) == false && i==1)? qpi_speed[0] : getSpeedsAsync[i].get(); // link 1 does not have own speed register, it runs with the speed of link 0
}
if (PCM::hasUPI(cpumodel))
{
Expand Down
52 changes: 49 additions & 3 deletions src/dashboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,10 @@ std::string getPCMDashboardJSON(const PCMDashboardType type, int ns, int nu, int
dashboard.push(panel1);
}
};
scaled("Core Frequency", "GHz", "/1000000000");
for (size_t s = 0; s < NumSockets; ++s)
if (type == InfluxDB) {
scaled("Core Frequency", "GHz", "/1000000000");
}
for (size_t s = 0; type == InfluxDB && s < NumSockets; ++s)
{
const char * op = "/1000000000";
const auto S = std::to_string(s);
Expand Down Expand Up @@ -771,7 +773,34 @@ std::string getPCMDashboardJSON(const PCMDashboardType type, int ns, int nu, int
}
dashboard.push(panel);
dashboard.push(panel1);

auto stacked = [&] (const char * m, std::vector<const char *> metrics, size_t s, const bool core = false)
{
const auto S = std::to_string(s);
auto my_height = 3 * height / 2;
auto panel = std::make_shared<TimeSeriesPanel>(0, y, width, my_height, "Socket" + S + " " + std::string(m), "stacked %", true);
auto panel1 = std::make_shared<BarGaugePanel>(width, y, max_width - width, my_height, std::string("Current ") + m + " (%)");
y += my_height;
for (auto & metric : metrics)
{
std::shared_ptr<pcm::Target> t;
if (core)
{
t = createTarget(metric, influxDBCore_Aggregate_Core_Counters(S, metric), "");
}
else
{
t = createTarget(metric, influxDBUncore_Uncore_Counters(S, metric), "");
}
panel->push(t);
panel1->push(t);
}
dashboard.push(panel);
dashboard.push(panel1);
};
for (size_t s = 0; type == InfluxDB && s < NumSockets; ++s)
{
stacked("Memory Request Ratio", {"Local Memory Request Ratio", "Remote Memory Request Ratio"}, s);
}
auto upi = [&](const std::string & m, const bool utilization)
{
for (size_t s = 0; s < NumSockets; ++s)
Expand Down Expand Up @@ -871,6 +900,23 @@ std::string getPCMDashboardJSON(const PCMDashboardType type, int ns, int nu, int
dashboard.push(panel1);
};
derived("Instructions Per Cycle", "IPC", "Instructions Retired Any", "Clock Unhalted Thread");
for (size_t s = 0; type == InfluxDB && s < NumSockets; ++s)
{
stacked("Core Stalls", {
"Frontend Bound",
"Bad Speculation",
"Backend Bound",
"Retiring",
"Fetch Latency Bound",
"Fetch Bandwidth Bound",
"Branch Misprediction Bound",
"Machine Clears Bound",
"Memory Bound",
"Core Bound",
"Heavy Operations Bound",
"Light Operations Bound"
}, s, true);
}
derived("Active Frequency Ratio", "AFREQ", "Clock Unhalted Thread", "Clock Unhalted Ref");
derived("L3 Cache Misses Per Instruction", "L3 MPI", "L3 Cache Misses", "Instructions Retired Any");
derived("L2 Cache Misses Per Instruction", "L2 MPI", "L2 Cache Misses", "Instructions Retired Any");
Expand Down
5 changes: 3 additions & 2 deletions src/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ namespace debug {
template<typename LVL, typename PF, typename F, typename L, typename... Args>
void dyn_debug_output( std::ostream& out, LVL level, PF pretty_function, F file, L line, Args... args ) {
std::stringstream ss;
auto now = time(nullptr);
ss << "DBG(" << std::dec << level << "): File '" << file << "', line '" << std::dec << line << "' :\n";
ss << "DBG(" << std::dec << level << "): " << pretty_function << ":\n";
ss << "DBG(" << std::dec << level << "): "; // Next code line will continue printing on this output line
ss << "DBG(" << std::dec << level << ") " << std::put_time( localtime(&now), "%F_%T: " ); // Next code line will continue printing on this output line
dyn_debug_output_helper( ss, args... );
out << ss.str() << std::flush;
}
Expand All @@ -57,6 +58,6 @@ namespace debug {

#define DBG( level, ... ) \
if ( debug::currentDebugLevel >= level ) \
debug::dyn_debug_output( std::cout, level, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
debug::dyn_debug_output( std::cerr, level, __PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)

} // namespace pcm
3 changes: 2 additions & 1 deletion src/pcm-raw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,13 +561,14 @@ AddEventStatus addEventFromDB(PCM::RawPMUConfigs& curPMUConfigs, string fullEven
std::ifstream in(path);
if (!in.is_open())
{
const auto alt_path = std::string("/usr/share/pcm/") + path;
const auto alt_path = getInstallPathPrefix() + path;
in.open(alt_path);
if (!in.is_open())
{
err_msg = std::string("event file ") + path + " or " + alt_path + " is not available.";
throw std::invalid_argument(err_msg);
}
path = alt_path;
}
in.close();
break;
Expand Down
Loading