Skip to content
Merged
2 changes: 1 addition & 1 deletion Intel-PMT
2 changes: 2 additions & 0 deletions doc/ENVVAR_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
`PCM_NO_MAIN_EXCEPTION_HANDLER=1` : don't catch exceptions in the main function of pcm tools (a debugging option)

`PCM_ENFORCE_MBM=1` : force-enable Memory Bandwidth Monitoring (MBM) metrics (LocalMemoryBW = LMB) and (RemoteMemoryBW = RMB) on processors with RDT/MBM errata

`PCM_DEBUG_LEVEL=x` : x is an integer defining debug output level. level = 0 (default): minimal or no debug info, > 0 increases verbosity
2 changes: 1 addition & 1 deletion perfmon
Submodule perfmon updated 35 files
+10 −0 .github/dependabot.yml
+3 −3 .github/workflows/bandit.yml
+2 −2 .github/workflows/create-perf-json.yml
+1 −1 .github/workflows/scorecard.yml
+1 −1 .github/workflows/verify-mapfile.yml
+183 −183 ADL/metrics/perf/alderlake_metrics_goldencove_core_perf.json
+3 −3 ARL/events/arrowlake_crestmont_core.json
+57 −3 ARL/events/arrowlake_lioncove_core.json
+6 −6 ARL/events/arrowlake_skymont_core.json
+3 −3 ARL/events/arrowlake_uncore.json
+41 −0 ARL/events/arrowlake_uncore_experimental.json
+189 −189 ARL/metrics/perf/arrowlake_metrics_lioncove_core_perf.json
+79 −4 GNR/events/graniterapids_core.json
+47 −11 GNR/events/graniterapids_uncore.json
+40 −40 GNR/events/graniterapids_uncore_experimental.json
+6 −6 GNR/metrics/perf/graniterapids_metrics_perf.json
+93 −12 LNL/events/lunarlake_lioncove_core.json
+23 −23 LNL/events/lunarlake_skymont_core.json
+3 −3 LNL/events/lunarlake_uncore.json
+41 −0 LNL/events/lunarlake_uncore_experimental.json
+191 −191 LNL/metrics/perf/lunarlake_metrics_lioncove_core_perf.json
+196 −196 MTL/metrics/perf/meteorlake_metrics_redwoodcove_core_perf.json
+515 −15 SRF/events/sierraforest_core.json
+59 −5 SRF/events/sierraforest_uncore.json
+58 −58 SRF/events/sierraforest_uncore_experimental.json
+ TMA_Metrics-4.5-full.xlsx
+391 −348 TMA_Metrics-full.csv
+ TMA_Metrics-full.xlsx
+0 −159 TMA_Metrics.csv
+ TMA_Metrics.xlsx
+22 −19 mapfile.csv
+1 −1 requirements.txt
+14 −34 scripts/config/replacements_config.json
+33 −13 scripts/create_perf_json.py
+129 −63 scripts/perf_format_converter.py
169 changes: 83 additions & 86 deletions src/cpucounters.cpp

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/pcm-tpmi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int mainThrows(int argc, char * argv[])
{
case 'w':
write = true;
value = (pcm::uint32)read_number(optarg);
value = read_number(optarg);
break;
case 'd':
dec = true;
Expand Down Expand Up @@ -126,7 +126,7 @@ int mainThrows(int argc, char * argv[])
continue;
}
TPMIHandle h(i, requestedID, requestedRelativeOffset, !write);
auto one = [&](const size_t p)
auto one = [&](const size_t p, uint64 value)
{
if (!dec)
std::cout << std::hex << std::showbase;
Expand All @@ -152,7 +152,7 @@ int mainThrows(int argc, char * argv[])
{
if (p < h.getNumEntries())
{
one(p);
one(p, value);
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ extern char ** environ;
#include <glob.h>
#endif

#include "debug.h"

namespace pcm {


Expand All @@ -46,6 +48,17 @@ bool isInKeepList(const StringType& varName, const std::vector<StringType>& keep
return false;
}

void setDefaultDebugLevel()
{
auto strDebugLevel = pcm::safe_getenv("PCM_DEBUG_LEVEL");
if (strDebugLevel.empty() == false)
{
auto intDebugLevel = std::stoi(strDebugLevel);
debug::dyn_debug_level(intDebugLevel);
DBG(0, "Debug level set to ", intDebugLevel);
}
}

#if defined(_MSC_VER)

void eraseEnvironmentVariables(const std::vector<std::wstring>& keepList) {
Expand Down
3 changes: 3 additions & 0 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#ifdef __linux__
#include <unistd.h>
#endif

namespace pcm {

template <class T>
Expand Down Expand Up @@ -81,6 +82,7 @@ namespace pcm {
#define PCM_STRING(x) (x)
#endif
void eraseEnvironmentVariables(const std::vector<StringType>& keepList);
void setDefaultDebugLevel();
}

#ifdef _MSC_VER
Expand All @@ -103,6 +105,7 @@ int main(int argc, char * argv[]) \
PCM_SET_DLL_DIR \
if (pcm::safe_getenv("PCM_NO_MAIN_EXCEPTION_HANDLER") == std::string("1")) return mainThrows(argc, argv); \
try { \
setDefaultDebugLevel(); \
return mainThrows(argc, argv); \
} catch(const std::runtime_error & e) \
{ \
Expand Down
7 changes: 7 additions & 0 deletions tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ if [ "$?" -ne "0" ]; then
exit 1
fi

echo Testing pcm with PCM_DEBUG_LEVEL=100
PCM_DEBUG_LEVEL=100 ./pcm -r -- sleep 1
if [ "$?" -ne "0" ]; then
echo "Error in pcm"
exit 1
fi

echo Testing pcm w/o env vars
./pcm -r -- sleep 1
if [ "$?" -ne "0" ]; then
Expand Down
Loading