Giter Club home page Giter Club logo

intel / pcm Goto Github PK

View Code? Open in Web Editor NEW
2.5K 93.0 449.0 5.18 MB

Intel® Performance Counter Monitor (Intel® PCM)

License: BSD 3-Clause "New" or "Revised" License

C++ 94.31% C 2.78% Makefile 0.01% Shell 1.10% Python 0.71% Dockerfile 0.02% CMake 1.03% Awk 0.02% Gnuplot 0.02%
monitor-performance processor performance-monitoring energy performance-analysis performance-metrics performance-dashboard performance-visualization processor-architecture cpu

pcm's Introduction


Intel® Performance Counter Monitor (Intel® PCM)

PCM Tools | Building PCM | Downloading Pre-Compiled PCM | FAQ | API Documentation | Environment Variables | Compilation Options

Intel® Performance Counter Monitor (Intel® PCM) is an application programming interface (API) and a set of tools based on the API to monitor performance and energy metrics of Intel® Core™, Xeon®, Atom™ and Xeon Phi™ processors. PCM works on Linux, Windows, Mac OS X, FreeBSD, DragonFlyBSD and ChromeOS operating systems.

Github repository statistics: Custom badge Custom badge Custom badge

We welcome bug reports and enhancement requests, which can be submitted via the "Issues" section on GitHub. For those interested in contributing to the code, please refer to the guidelines outlined in the CONTRIBUTING.md file.


Current Build Status

  • Linux: GitHub Workflow Status
  • Windows: Build status
  • FreeBSD: GitHub Workflow Status
  • OS X: GitHub Workflow Status
  • Docker container: GitHub Workflow Status

PCM Tools

PCM provides a number of command-line utilities for real-time monitoring:

pcm-iio output

  • pcm-numa : monitor local and remote memory accesses
  • pcm-power : monitor sleep and energy states of processor, Intel(r) Quick Path Interconnect, DRAM memory, reasons of CPU frequency throttling and other energy-related metrics
  • pcm-tsx: monitor performance metrics for Intel(r) Transactional Synchronization Extensions
  • pcm-core and pmu-query: query and monitor arbitrary processor core events
  • pcm-raw: program arbitrary core and uncore events by specifying raw register event ID encoding
  • pcm-bw-histogram: collect memory bandwidth utilization histogram

Graphical front ends:

  • pcm Grafana dashboard : front-end for Grafana (in scripts/grafana directory). Full Grafana Readme is here pcm grafana output
  • pcm-sensor : front-end for KDE KSysGuard
  • pcm-service : front-end for Windows perfmon

There are also utilities for reading/writing model specific registers (pcm-msr), PCI configuration registers (pcm-pcicfg), memory mapped registers (pcm-mmio) and TPMI registers (pcm-tpmi) supported on Linux, Windows, Mac OS X and FreeBSD.

And finally a daemon that stores core, memory and QPI counters in shared memory that can be be accessed by non-root users.


Building PCM Tools

Clone PCM repository with submodules:

git clone --recursive https://github.com/opcm/pcm.git

or clone the repository first, and then update submodules with:

git submodule update --init --recursive

Install cmake then:

mkdir build
cd build
cmake ..
cmake --build .

You will get all the utilities (pcm, pcm-memory, etc) in build/bin directory. '--parallel' can be used for faster building:

cmake --build . --parallel

Debug is default on Windows. Specify config to build Release:

cmake --build . --config Release

On Windows and MacOs additional drivers and steps are required. Please find instructions here: WINDOWS_HOWTO.md and MAC_HOWTO.txt.

FreeBSD/DragonFlyBSD-specific details can be found in FREEBSD_HOWTO.txt

pcm-build-run-2


Downloading Pre-Compiled PCM Tools


Executing PCM tools under non-root user on Linux

Executing PCM tools under an unprivileged user on a Linux operating system is feasible. However, there are certain prerequisites that need to be met, such as having Linux perf_event support for your processor in the Linux kernel version you are currently running. To successfully run the PCM tools, you need to set the /proc/sys/kernel/perf_event_paranoid setting to -1 as root once:

echo -1 > /proc/sys/kernel/perf_event_paranoid

and configure two specific environment variables when running the tools under a non-root user:

export PCM_NO_MSR=1
export PCM_KEEP_NMI_WATCHDOG=1

For instance, you can execute the following commands to set the environment variables and run pcm:

export PCM_NO_MSR=1
export PCM_KEEP_NMI_WATCHDOG=1
pcm

or (to run the pcm sensor server as non-root):

PCM_NO_MSR=1 PCM_KEEP_NMI_WATCHDOG=1 pcm-sensor-server

Please keep in mind that when executing PCM tools under an unprivileged user on Linux, certain PCM metrics may be unavailable. This limitation specifically affects metrics that rely solely on direct MSR (Model-Specific Register) register access. Due to the restricted privileges of the user, accessing these registers is not permitted, resulting in the absence of corresponding metrics.


Frequently Asked Questions (FAQ)

PCM's frequently asked questions (FAQ) are located here.


PCM API documentation

PCM API documentation is embedded in the source code and can be generated into html format from source using Doxygen (www.doxygen.org).


PCM environment variables

The list of PCM environment variables is located here


Custom compilation options

The list of custom compilation options is located here


Packaging

Packaging with CPack is supported on Debian and Redhat/SUSE system families. To create DEB of RPM package need to call cpack after building in build folder:

cd build
cpack

This creates package:

  • "pcm-VERSION-Linux.deb" on Debian family systems;
  • "pcm-VERSION-Linux.rpm" on Redhat/SUSE-family systems. Packages contain pcm-* binaries and required for usage opCode-* files.

pcm's People

Contributors

agorneanu avatar anurag-daware avatar ashmrtn avatar bigstream-dmytro avatar cimes-isi avatar dependabot[bot] avatar gangdeng-intel avatar harry-van-haaren avatar hexchain avatar ilia-kurakin avatar immanuelhaffner avatar ivadasz avatar jgasparakis avatar kilobyte avatar markovamaria avatar mjguzik avatar nealsid avatar ogbrugge avatar ogbrugge-work avatar oldwhite81 avatar opcm avatar pavithranp avatar rdementi avatar rdobrowo avatar riseofthechronicler avatar rsudarik avatar soramichi avatar step-security-bot avatar stevenbriscoe avatar twillhal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pcm's Issues

Possible to collect > 4 custom events?

I am interested in collecting more than 4 custom counter events at once. Is the current limitation of 4 in psx-core.x a limitation of the HW (I am using Skylake, for reference) or of the software?

I tried to take a gander myself and see that BasicCounterState defines Event0, Event1, Event2, and Event3, but grepping does not reveal where those values are set, so I can't easily asses why BasicCounterState only supports 4 events.

Build in VS 2017 fails

  • when updating projects to VS 2017 there are dozens of errors (issues with clr ...)
  • when leaving the projects untouched "Release" target compiles fine; "Debug" target needs manual modifications (project properties ...) in order to make it compile

Regarding output of pcm.exe

Hi
I am running pcm.exe and it dumps output to console window, I have some doubts regarding the output-
".....
C1 core residency: 1.27 %; C3 core residency: 0.00 %; C6 core residency: 0.00 %; C7 core residency: 95.40 %;
C2 package residency: 22.54 %; C3 package residency: 0.06 %; C6 package residency: 0.01 %; C7 package residency: 62.43 %; C8 package residency: 0.00 %; C9 package residency: 0.00 %; C10 package residency: 0.00 %;
"

  1. Looking the quoted output from pcm.exe, I can understand that package residencies are per core per what about core residency, when it dumps core residency, where does it specific for which core this residency is dumped for?
  2. Is there any command line option which can only dump C state residency unless I want to change the code and build new binary to dump only C state.

Thank you

k1om-mpss-linux error: 'struct perf_event_attr' has no member named 'config1'

Hello,
I'm trying to compile for k1om-mpss-linux environment and I get the following error messages:

cpucounters.cpp: In member function 'PCM::ErrorCode PCM::program(PCM::ProgramMode, const void*)':
cpucounters.cpp:2100:23: error: 'struct perf_event_attr' has no member named 'config1'
e.config1 = pExtDesc->OffcoreResponseMsrValue[0];
^
cpucounters.cpp:2102:23: error: 'struct perf_event_attr' has no member named 'config1'
e.config1 = pExtDesc->OffcoreResponseMsrValue[1];
^
Makefile:65: recipe for target 'cpucounters.o' failed
make: *** [cpucounters.o] Error 1

My environment is defined by using:
source /opt/mpss/3.8.4/environment-setup-k1om-mpss-linux

Is PCM supported within k1om-mpss-linux environment? If so, can you suggest how to fix?
Thanks in advance.

VS2010: pcm-core.cpp

ERROR 21 error C2059: Syntaxerror: ')' 70 1 pcm-core-win
ERROR 29 error C2059: Syntaxerror: ')' 110 1 pcm-core-win

It seems that there is a problem with the include paths or something like that, since VS2010 highlight, that etc. are not available. I don't really know, what the problem is, since I use in general Linux and make, cmake or something like that and not VisualStudio on Windows.

I just want to compile the project to thest it with my i7-920 CPU to see, if it works fine with games.

I also tried the precompiled binaries, but it seems, that the don't work.

How to build msr.sys in production sign mode in VS2015

I have 3-4 systems, where I am running pcm.exe with msr.sys built with vs2015.
It is running fine, today I setup new system with Windows1064-RS2 RTM
and I am getting error -
You must have signed msr.sys driver in your current directory and have administrator rights to run this program
Any idea why on one single machine it is giving signature error?

Windows .exe files depend on MSVCP140.dll

The Windows binaries on https://ci.appveyor.com/project/opcm/pcm/build/artifacts result in this error on a clean Windows system:

pcm-memory.exe - System Error
The code execution cannot proceed because MSVCP140.dll was not found. Reinstalling the program may fix this problem.

That is apparently looking for Visual C++ Redistributable for Visual Studio 2015. However, there is no .msi installer program to help distribute the necessary DLLs. Perhaps there is there a compiler option to make these .exe files work on their own?

pcm.x, pcm-memory.x have inconsistent behavior when reporting to CSV

When pcm-memory.x is reporting metrics to csv file you have two headers

  1. socket header, telling this stat is for X socket
  • header will have skX where X is the corresponding socket.
    Looks something like this
 ;;SKT0;SKT0;SKT0;SKT0;SKT0;SKT0;SKT0;SKT0;SK
 ```
2. The data header, telling you what data is reported in the column

when pcm.x is reporting metrics to csv file you also have two headers
1. socket header, telling this stat is for X socket
-  The socket header lines are empty if they repeat
looks something like this

System;;;;;;;;;;;;;;;;;;;;;;System Core C-States;;;;;System Pack C-States;;;;;;Socket0;;;;;;;;;;;;;;;;Socket1;;;;;;;;;;;;;;;;S

2. The data header, telling you what data is reported in the column

The Issue:

I need consistency. I would rather have the socket/system header repeat over and over even if it's a repeat header because it involves less over head on my part. 

pcm-power doesn't support Skylake

When I run pcm-power on my Skylake CPU I get:

 Power Monitoring Utility
Number of physical cores: 4
Number of logical cores: 4
Number of online logical cores: 4
Threads (logical cores) per physical core: 1
Num sockets: 1
Physical cores per socket: 4
Core PMU (perfmon) version: 4
Number of core PMU generic (programmable) counters: 8
Width of generic (programmable) counters: 48 bits
Number of core PMU fixed counters: 3
Width of fixed counters: 48 bits
Nominal core frequency: 2600000000 Hz
Package thermal spec power: 45 Watt; Package minimum power: 0 Watt; Package maximum power: 0 Watt; 
Unsupported processor model (94).
Cleaning up

SystemAccessViolation Exception while running pcm.exe

I have tried to compile WinMSRDriver under Windows 10 within VS 2015 with 14393 DDK.
I created new VS 2015 KMDF Project, then manually added all h and c files and compiled it. It worked fine and generated msr.sys file.
After that I generated pcm.exe but when I run pcm.exe I get this error - SystemAccessViolation Exception
Platform - win1064 RS1 14393 + Kabylake
log as below

D:\PCM>pcm.exe
DEBUG: Setting Ctrl+C done.

Processor Counter Monitor (2017-03-24 23:15:23 +0100 ID=ea6ef86)

Starting MSR service failed with error 1275 This driver has been blocked from loading
Trying to load winring0.dll/winring0.sys driver...

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at mainCRTStartup()
DEBUG: Unhandled Exception event

Command line error D8016: '/clr' and '/RTC1' command-line options are incompatible

Hi, I am trying to build WinMSR with sdk=V10, and ndk10, but then I got the following error. Can anyone explain why? Any help is much appreciated.

  Generating Code...
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /Zi /nologo /W3 /WX- /Od /D WIN32 /D _
  DEBUG /D _WINDOWS /D _USRDLL /D PCM_EXPORTS /D _WINDLL /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Z
  c:wchar_t /Zc:forScope /Zc:inline /Fo"x64\Debug\\" /Fd"x64\Debug\vc140.pdb" /Gd /TP /errorReport:queue dllmain.cpp
  dllmain.cpp
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /AI"C:\Program Files (x86)\Reference A
  ssemblies\Microsoft\Framework\.NETFramework\v4.0" /AI"C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfig
  uration\Neutral" /Zi /clr /nologo /W3 /WX- /Od /D WIN32 /D _DEBUG /D _WINDOWS /D _USRDLL /D PCM_EXPORTS /D _WINDLL /D
   _UNICODE /D UNICODE /Gm /EHa /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"x64\Debug\\" /Fd"x64
  \Debug\vc140.pdb" /Gd /TP /FU"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\msco
  rlib.dll" /errorReport:queue /clr:nostdlib ..\PCM_Win\restrictDriverAccess.cpp
cl : Command line error D8016: '/clr' and '/Gm' command-line options are incompatible [E:\github\pcm\PCM-Lib_Win\PCM-Li
b.vcxproj]

Power Measurement may be wrong

Dear developers,

I have a Knights Landing processor and I measured power getting contradictory data.

Package minimum power: 98 Watt [..]
Watts: 43.79 [..] Consumed DRAM Joules: 1.69

Added together the total wattage is 45.48W which is less than the package minimum power 98W. Or is there a missing component whose power-data (with about 52W) is not shown ?

Thanks in advance. Below you can find the complete output.

./pcm-power.x 1

Intel(r) Performance Counter Monitor V2.11.1 (2017-01-24 15:51:44 +0100 ID=4b0c8f7)

Power Monitoring Utility
Copyright (c) 2009-2016 Intel Corporation
Number of physical cores: 64
Number of logical cores: 256
Number of online logical cores: 256
Threads (logical cores) per physical core: 4
Num sockets: 1
Physical cores per socket: 64
Core PMU (perfmon) version: 3
Number of core PMU generic (programmable) counters: 2
Width of generic (programmable) counters: 40 bits
Number of core PMU fixed counters: 3
Width of fixed counters: 40 bits
Nominal core frequency: 1300000000 Hz
Package thermal spec power: 215 Watt; Package minimum power: 98 Watt; Package maximum power: 258 Watt;
On the socket detected 2 memory controllers with total number of 6 channels.

MC counter group: 0
PCU counter group: 0
Freq bands [0/1/2]: 1200 MHz; 2000 MHz; 4000 MHz;

Time elapsed: 1000 ms
Called sleep function for 1000 ms
S0CH0; DRAMClocks: 0; Rank0 CKE Off Residency: inf%; Rank0 CKE Off Average Cycles: -1; Rank0 Cycles per transition: -1
S0CH0; DRAMClocks: 0; Rank1 CKE Off Residency: inf%; Rank1 CKE Off Average Cycles: -1; Rank1 Cycles per transition: -1
S0CH1; DRAMClocks: 0; Rank0 CKE Off Residency: inf%; Rank0 CKE Off Average Cycles: -1; Rank0 Cycles per transition: -1
S0CH1; DRAMClocks: 0; Rank1 CKE Off Residency: inf%; Rank1 CKE Off Average Cycles: -1; Rank1 Cycles per transition: -1
S0CH2; DRAMClocks: 0; Rank0 CKE Off Residency: inf%; Rank0 CKE Off Average Cycles: -1; Rank0 Cycles per transition: -1
S0CH2; DRAMClocks: 0; Rank1 CKE Off Residency: inf%; Rank1 CKE Off Average Cycles: -1; Rank1 Cycles per transition: -1
S0CH3; DRAMClocks: 0; Rank0 CKE Off Residency: inf%; Rank0 CKE Off Average Cycles: -1; Rank0 Cycles per transition: -1
S0CH3; DRAMClocks: 0; Rank1 CKE Off Residency: inf%; Rank1 CKE Off Average Cycles: -1; Rank1 Cycles per transition: -1
S0CH4; DRAMClocks: 0; Rank0 CKE Off Residency: inf%; Rank0 CKE Off Average Cycles: -1; Rank0 Cycles per transition: -1
S0CH4; DRAMClocks: 0; Rank1 CKE Off Residency: inf%; Rank1 CKE Off Average Cycles: -1; Rank1 Cycles per transition: -1
S0CH5; DRAMClocks: 0; Rank0 CKE Off Residency: inf%; Rank0 CKE Off Average Cycles: -1; Rank0 Cycles per transition: -1
S0CH5; DRAMClocks: 0; Rank1 CKE Off Residency: inf%; Rank1 CKE Off Average Cycles: -1; Rank1 Cycles per transition: -1
S0; PCUClocks: 1100949255; Freq band 0/1/2 cycles: 0.00%; 0.00%; 0.00%
S0; Consumed energy units: 717516; Consumed Joules: 43.79; Watts: 43.79; Thermal headroom below TjMax: 62
S0; Consumed DRAM energy units: 110760; Consumed DRAM Joules: 1.69; DRAM Watts: 1.69

Duplicate symbols for architecture x86_64 - MacOS 10.12.4

Duplicate symbol errors occur when the pcm utilities from the root directory are compiled:

make
c++ -Wall -g -O3 -Wno-unknown-pragmas -I/usr/include -IMacMSRDriver -std=c++0x -c pcm-numa.cpp -o pcm-numa.o
c++ -MM -Wall -g -O3 -Wno-unknown-pragmas -I/usr/include -IMacMSRDriver -std=c++0x pcm-numa.cpp > pcm-numa.d
c++ -Wall -g -O3 -Wno-unknown-pragmas -I/usr/include -IMacMSRDriver -std=c++0x -c msr.cpp -o msr.o

[...]

duplicate symbol std::vector<TopologyEntry, std::allocator<TopologyEntry> >::operator=(std::initializer_list<TopologyEntry>) in:
    pcm-numa.o
    utils.o
duplicate symbol std::vector<TopologyEntry, std::allocator<TopologyEntry> >::assign(std::initializer_list<TopologyEntry>) in:
    pcm-numa.o
    utils.o
duplicate symbol std::vector<TopologyEntry, std::allocator<TopologyEntry> >::insert(__gnu_cxx::__normal_iterator<TopologyEntry const*, std::vector<TopologyEntry, std::allocator<TopologyEntry> > >, std::initializer_list<TopologyEntry>) in:
    pcm-numa.o
    utils.o
ld: 522 duplicate symbols for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [pcm-numa.x] Error 1

For some reason the following lines are defined in cpucounters.h and must be removed in order to compile the utilities without duplicate symbol errors:

#ifndef HACK_TO_REMOVE_DUPLICATE_ERROR
template class PCM_API std::allocator<TopologyEntry>;
template class PCM_API std::vector<TopologyEntry>;
template class PCM_API std::allocator<CounterWidthExtender *>;
template class PCM_API std::vector<CounterWidthExtender *>;
template class PCM_API std::allocator<uint32>;
template class PCM_API std::vector<uint32>;
template class PCM_API std::allocator<char>;
#endif

Alternatively HACK_TO_REMOVE_DUPLICATE_ERROR must be defined somewhere for these lines to be silent during compilation (which is actually something already in place when compiling MacMSRDriver lib and driver).

When the above lines are removed (AFTER compiling the libPcmMsr.dylib from the MacMSRDriver directory) the utilities are compiled successfully.

ar: daemon-binaries: No such file or directory

Running make lib on Linux causes the following error:

make -C daemon/daemon/Debug
make[1]: Entering directory '/home/bhyoo/projects/dirigent/pcm/daemon/daemon/Debug'
make[1]: Nothing to be done for 'daemon.d'.
make[1]: Leaving directory '/home/bhyoo/projects/dirigent/pcm/daemon/daemon/Debug'
make -C daemon/client/Debug
make[1]: Entering directory '/home/bhyoo/projects/dirigent/pcm/daemon/client/Debug'
make[1]: Nothing to be done for 'client.d'.
make[1]: Leaving directory '/home/bhyoo/projects/dirigent/pcm/daemon/client/Debug'
ar -rcs libPCM.a msr.o cpucounters.o pci.o client_bw.o utils.o pcm.o pcm-numa.o pcm-power.o pcm-sensor.o pcm-msr.o pcm-memory.o pcm-tsx.o pcm-pcie.o pcm-core.o pcm-iio.o pcm-lspci.o pcm-pcicfg.o daemon-binaries
ar: daemon-binaries: No such file or directory
Makefile:58: recipe for target 'libPCM.a' failed
make: *** [libPCM.a] Error 1

Include doxygen in gitignore

Hey, this is just a minor thing. Can you please include the output directories of doxygen in the gitignore file? Thanks & regards.

diff --git a/.gitignore b/.gitignore
index 6f5b269..6f63201 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,3 +24,5 @@ Release
Debug64
Release64
.metadata/
+html/
+latex/

Option to silence informational output

Hello,

I'm trying to create a prometheus.io exporter for opcm, starting with specifically pcm-memory.x.

It'd be good to have a option to silence this bit of the output:

 Processor Counter Monitor: Memory Bandwidth Monitoring Utility  ($Format:%ci ID=%h$)

 This utility measures memory bandwidth per channel or per DIMM rank in real-time

Number of physical cores: 32
Number of logical cores: 64
Number of online logical cores: 64
Threads (logical cores) per physical core: 2
Num sockets: 2
Physical cores per socket: 16
Core PMU (perfmon) version: 4
Number of core PMU generic (programmable) counters: 4
Width of generic (programmable) counters: 48 bits
Number of core PMU fixed counters: 3
Width of fixed counters: 48 bits
Nominal core frequency: 2100000000 Hz
Package thermal spec power: 125 Watt; Package minimum power: 69 Watt; Package maximum power: 264 Watt; 
Socket 0: 2 memory controllers detected with total number of 6 channels. 3 QPI ports detected.
Socket 1: 2 memory controllers detected with total number of 6 channels. 3 QPI ports detected.

How could I use "memoptest" to do UPI stress and make the total percentage of UPI bandwidth up to 100% ?

Hi Developers,
I'd like to use PCM Tools to monitor UPI traffic and execute UPI stress on my server. There are two processors (Intel Xeon Gold 5115 2.4GHz) and 16 x 8 GB DDR4 2400 on my server.
I use ./pcm.x to launch the UPI monitor, and use "numactl --cpunodebind=0 --membind=1 ./memoptest 2" "numactl --cpunodebind=1 --membind=0 ./memoptest 2 to run memory bandwidth test.
memoptest

 I have some questions that need your help.

Q1. When I use this two commands to run memory bandwidth test, the pcm.x show some data numbers in UPI0 and UPI1 columns. What's the meaning about 13G and 55% ?
Q2. If the 55% is the total Percentage of UPI bandwidth, how could I do to make the UPI bandwidth up to 100% ?
stress

Thanks.

failed to load PcmMsrDriver.kext on OS X

I am able to build pcm now. However, the kext will not load. I am running 10.12.4 on a 2014 MacBook Pro, XCode 8.3. I generally compile with llvm and nasm. So my XCode configuration is out of the box stock.

After sudo sh:

./kextload.sh

/System/Library/Extensions/PcmMsrDriver.kext failed to load - (libkern/kext) not loadable (reason unspecified); check the system/kernel logs for errors or try kextutil(8).

Also,

kextutil -i /System/Library/Extensions/PcmMsrDriver.kext
Diagnostics for /System/Library/Extensions/PcmMsrDriver.kext:
Code Signing Failure: not code signed
/System/Library/Extensions/PcmMsrDriver.kext appears to be loadable (not including linkage for on-disk libraries).
Untrusted kexts are not allowed
ERROR: invalid signature for com.intel.driver.PcmMsr, will not load

Nothing of interest in the logs.

Cannot suppress output from the C API

My program links to libpcm.so and uses the C API, which does not provide a way to disable the spurious console output generated by various PCM functions. Of course it's normal for a program to write things on stdout, but as everyone knows, it's never acceptable for a library to do so. The best thing would be to remove all the printf and cout statements from those PCM function that are reachable via library exports.

Can't build on OS X 10.12.4 with XCode 8.3

The kextload.sh script in MacMSRDriver is sincerely wedged.

cp -R Build/Products/Release/PcmMsrDriver.kext /tmp/.

build should be lowercase (my OSX filesystem is case sensitive) and Products should be removed.

cp -R build/Release/PcmMsrDriver.kext /tmp/.

Also, the file is a DOS file meaning that it has carriage returns and linefeeds. This confuses bash.

: command not found 2:
mv: rename /tmp/PcmMsrDriver.kext to /System/Library/Extensions\r: No such file or directory
chown: /System/Library/Extensions/PcmMsrDriver.kext\r: No such file or directory
 failed to load - (libkern/kext) not found; check the system/kernel logs for errors or try kextutil(8).
make: *** [install] Error 71

This is the od -c dump of kextload.sh:

0000000    #   !   /   u   s   r   /   b   i   n   /   e   n   v       b
0000020    a   s   h  \r  \n  \r  \n   c   p       -   R       b   u   i

I do not as yet have a working PCM on OSX compiled from the github zip file.

Support for Intel Coffee Lake processor

Developers,

When I am using this tool on Linux I get the message:
Unsupported processor model (158).

Is there already support (or an workaround) by someone for the Intel Coffee Lake processors? More specific in my case:
Model: 158
Model name: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz

Cheers,

Carlos

Unusual ACPI table setup

It seems I have some unusual setup pcm-memory refuses to work on. Some information about system:

$ uname -a
Linux localhost.localdomain 4.17.3-200.fc28.x86_64 #1 SMP Tue Jun 26 14:17:07 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

$ cat /proc/cpuinfo | tail -28

processor       : 11
vendor_id       : GenuineIntel
cpu family      : 6
model           : 85
model name      : Intel(R) Core(TM) i7-7800X CPU @ 3.50GHz
stepping        : 4
microcode       : 0x2000043
cpu MHz         : 1201.565
cache size      : 8448 KB
physical id     : 0
siblings        : 12
core id         : 5
cpu cores       : 6
apicid          : 11
initial apicid  : 11
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault cat_l3 cdp_l3 invpcid_single pti mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 7000.00
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual

$ lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation Sky Lake-E DMI3 Registers [8086:2020] (rev 04)
00:04.0 System peripheral [0880]: Intel Corporation Sky Lake-E CBDMA Registers [8086:2021] (rev 04)
00:04.1 System peripheral [0880]: Intel Corporation Sky Lake-E CBDMA Registers [8086:2021] (rev 04)
00:04.2 System peripheral [0880]: Intel Corporation Sky Lake-E CBDMA Registers [8086:2021] (rev 04)
00:04.3 System peripheral [0880]: Intel Corporation Sky Lake-E CBDMA Registers [8086:2021] (rev 04)
00:04.4 System peripheral [0880]: Intel Corporation Sky Lake-E CBDMA Registers [8086:2021] (rev 04)
00:04.5 System peripheral [0880]: Intel Corporation Sky Lake-E CBDMA Registers [8086:2021] (rev 04)
00:04.6 System peripheral [0880]: Intel Corporation Sky Lake-E CBDMA Registers [8086:2021] (rev 04)
00:04.7 System peripheral [0880]: Intel Corporation Sky Lake-E CBDMA Registers [8086:2021] (rev 04)
00:05.0 System peripheral [0880]: Intel Corporation Sky Lake-E MM/Vt-d Configuration Registers [8086:2024] (rev 04)
00:05.2 System peripheral [0880]: Intel Corporation Device [8086:2025] (rev 04)
00:05.4 PIC [0800]: Intel Corporation Device [8086:2026] (rev 04)
00:08.0 System peripheral [0880]: Intel Corporation Sky Lake-E Ubox Registers [8086:2014] (rev 04)
00:08.1 Performance counters [1101]: Intel Corporation Sky Lake-E Ubox Registers [8086:2015] (rev 04)
00:08.2 System peripheral [0880]: Intel Corporation Sky Lake-E Ubox Registers [8086:2016] (rev 04)
00:14.0 USB controller [0c03]: Intel Corporation 200 Series PCH USB 3.0 xHCI Controller [8086:a2af]
00:14.2 Signal processing controller [1180]: Intel Corporation 200 Series PCH Thermal Subsystem [8086:a2b1]
00:16.0 Communication controller [0780]: Intel Corporation 200 Series PCH CSME HECI #1 [8086:a2ba]
00:17.0 SATA controller [0106]: Intel Corporation 200 Series PCH SATA controller [AHCI mode] [8086:a282]
00:1c.0 PCI bridge [0604]: Intel Corporation 200 Series PCH PCI Express Root Port #1 [8086:a290] (rev f0)
00:1c.2 PCI bridge [0604]: Intel Corporation 200 Series PCH PCI Express Root Port #3 [8086:a292] (rev f0)
00:1d.0 PCI bridge [0604]: Intel Corporation 200 Series PCH PCI Express Root Port #9 [8086:a298] (rev f0)
00:1f.0 ISA bridge [0601]: Intel Corporation Device [8086:a2d2]
00:1f.2 Memory controller [0580]: Intel Corporation 200 Series PCH PMC [8086:a2a1]
00:1f.3 Audio device [0403]: Intel Corporation 200 Series PCH HD Audio [8086:a2f0]
00:1f.4 SMBus [0c05]: Intel Corporation 200 Series PCH SMBus Controller [8086:a2a3]
00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (2) I219-V [8086:15b8]
01:00.0 USB controller [0c03]: ASMedia Technology Inc. Device [1b21:2142]
02:00.0 USB controller [0c03]: ASMedia Technology Inc. Device [1b21:2142]
03:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller SM961/PM961 [144d:a804]
16:00.0 PCI bridge [0604]: Intel Corporation Sky Lake-E PCI Express Root Port A [8086:2030] (rev 04)
16:05.0 System peripheral [0880]: Intel Corporation Device [8086:2034] (rev 04)
16:05.2 System peripheral [0880]: Intel Corporation Sky Lake-E RAS Configuration Registers [8086:2035] (rev 04)
16:05.4 PIC [0800]: Intel Corporation Device [8086:2036] (rev 04)
16:08.0 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208d] (rev 04)
16:08.1 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208d] (rev 04)
16:08.2 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208d] (rev 04)
16:08.3 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208d] (rev 04)
16:08.4 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208d] (rev 04)
16:08.5 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208d] (rev 04)
16:08.6 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208d] (rev 04)
16:08.7 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208d] (rev 04)
16:09.0 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208d] (rev 04)
16:09.1 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208d] (rev 04)
16:0e.0 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208e] (rev 04)
16:0e.1 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208e] (rev 04)
16:0e.2 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208e] (rev 04)
16:0e.3 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208e] (rev 04)
16:0e.4 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208e] (rev 04)
16:0e.5 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208e] (rev 04)
16:0e.6 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208e] (rev 04)
16:0e.7 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208e] (rev 04)
16:0f.0 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208e] (rev 04)
16:0f.1 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:208e] (rev 04)
16:1d.0 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:2054] (rev 04)
16:1d.1 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:2055] (rev 04)
16:1d.2 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:2056] (rev 04)
16:1d.3 System peripheral [0880]: Intel Corporation Sky Lake-E CHA Registers [8086:2057] (rev 04)
16:1e.0 System peripheral [0880]: Intel Corporation Sky Lake-E PCU Registers [8086:2080] (rev 04)
16:1e.1 System peripheral [0880]: Intel Corporation Sky Lake-E PCU Registers [8086:2081] (rev 04)
16:1e.2 System peripheral [0880]: Intel Corporation Sky Lake-E PCU Registers [8086:2082] (rev 04)
16:1e.3 System peripheral [0880]: Intel Corporation Sky Lake-E PCU Registers [8086:2083] (rev 04)
16:1e.4 System peripheral [0880]: Intel Corporation Sky Lake-E PCU Registers [8086:2084] (rev 04)
16:1e.5 System peripheral [0880]: Intel Corporation Sky Lake-E PCU Registers [8086:2085] (rev 04)
16:1e.6 System peripheral [0880]: Intel Corporation Sky Lake-E PCU Registers [8086:2086] (rev 04)
17:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1)
17:00.1 Audio device [0403]: NVIDIA Corporation GP106 High Definition Audio Controller [10de:10f1] (rev a1)
64:00.0 PCI bridge [0604]: Intel Corporation Sky Lake-E PCI Express Root Port A [8086:2030] (rev 04)
64:05.0 System peripheral [0880]: Intel Corporation Device [8086:2034] (rev 04)
64:05.2 System peripheral [0880]: Intel Corporation Sky Lake-E RAS Configuration Registers [8086:2035] (rev 04)
64:05.4 PIC [0800]: Intel Corporation Device [8086:2036] (rev 04)
64:08.0 System peripheral [0880]: Intel Corporation Device [8086:2066] (rev 04)
64:09.0 System peripheral [0880]: Intel Corporation Device [8086:2066] (rev 04)
64:0a.0 System peripheral [0880]: Intel Corporation Device [8086:2040] (rev 04)
64:0a.1 System peripheral [0880]: Intel Corporation Device [8086:2041] (rev 04)
64:0a.2 System peripheral [0880]: Intel Corporation Device [8086:2042] (rev 04)
64:0a.3 System peripheral [0880]: Intel Corporation Device [8086:2043] (rev 04)
64:0a.4 System peripheral [0880]: Intel Corporation Device [8086:2044] (rev 04)
64:0a.5 System peripheral [0880]: Intel Corporation Device [8086:2045] (rev 04)
64:0a.6 System peripheral [0880]: Intel Corporation Device [8086:2046] (rev 04)
64:0a.7 System peripheral [0880]: Intel Corporation Device [8086:2047] (rev 04)
64:0b.0 System peripheral [0880]: Intel Corporation Device [8086:2048] (rev 04)
64:0b.1 System peripheral [0880]: Intel Corporation Device [8086:2049] (rev 04)
64:0b.2 System peripheral [0880]: Intel Corporation Device [8086:204a] (rev 04)
64:0b.3 System peripheral [0880]: Intel Corporation Device [8086:204b] (rev 04)
64:0c.0 System peripheral [0880]: Intel Corporation Device [8086:2040] (rev 04)
64:0c.1 System peripheral [0880]: Intel Corporation Device [8086:2041] (rev 04)
64:0c.2 System peripheral [0880]: Intel Corporation Device [8086:2042] (rev 04)
64:0c.3 System peripheral [0880]: Intel Corporation Device [8086:2043] (rev 04)
64:0c.4 System peripheral [0880]: Intel Corporation Device [8086:2044] (rev 04)
64:0c.5 System peripheral [0880]: Intel Corporation Device [8086:2045] (rev 04)
64:0c.6 System peripheral [0880]: Intel Corporation Device [8086:2046] (rev 04)
64:0c.7 System peripheral [0880]: Intel Corporation Device [8086:2047] (rev 04)
64:0d.0 System peripheral [0880]: Intel Corporation Device [8086:2048] (rev 04)
64:0d.1 System peripheral [0880]: Intel Corporation Device [8086:2049] (rev 04)
64:0d.2 System peripheral [0880]: Intel Corporation Device [8086:204a] (rev 04)
64:0d.3 System peripheral [0880]: Intel Corporation Device [8086:204b] (rev 04)
65:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP108 [GeForce GT 1030] [10de:1d01] (rev a1)
65:00.1 Audio device [0403]: NVIDIA Corporation GP108 High Definition Audio Controller [10de:0fb8] (rev a1)
b2:05.0 System peripheral [0880]: Intel Corporation Device [8086:2034] (rev 04)
b2:05.2 System peripheral [0880]: Intel Corporation Sky Lake-E RAS Configuration Registers [8086:2035] (rev 04)
b2:05.4 PIC [0800]: Intel Corporation Device [8086:2036] (rev 04)
b2:12.0 Performance counters [1101]: Intel Corporation Sky Lake-E M3KTI Registers [8086:204c] (rev 04)
b2:12.1 Performance counters [1101]: Intel Corporation Sky Lake-E M3KTI Registers [8086:204d] (rev 04)
b2:12.2 System peripheral [0880]: Intel Corporation Sky Lake-E M3KTI Registers [8086:204e] (rev 04)
b2:15.0 System peripheral [0880]: Intel Corporation Sky Lake-E M2PCI Registers [8086:2018] (rev 04)
b2:16.0 System peripheral [0880]: Intel Corporation Sky Lake-E M2PCI Registers [8086:2018] (rev 04)
b2:16.4 System peripheral [0880]: Intel Corporation Sky Lake-E M2PCI Registers [8086:2018] (rev 04)
b2:17.0 System peripheral [0880]: Intel Corporation Sky Lake-E M2PCI Registers [8086:2018] (rev 04)

$ ll /dev/cpu/*/msr
crw------- 1 root root 202,  0 Jul 10 13:39 /dev/cpu/0/msr
crw------- 1 root root 202, 10 Jul 10 13:39 /dev/cpu/10/msr
crw------- 1 root root 202, 11 Jul 10 13:39 /dev/cpu/11/msr
crw------- 1 root root 202,  1 Jul 10 13:39 /dev/cpu/1/msr
crw------- 1 root root 202,  2 Jul 10 13:39 /dev/cpu/2/msr
crw------- 1 root root 202,  3 Jul 10 13:39 /dev/cpu/3/msr
crw------- 1 root root 202,  4 Jul 10 13:39 /dev/cpu/4/msr
crw------- 1 root root 202,  5 Jul 10 13:39 /dev/cpu/5/msr
crw------- 1 root root 202,  6 Jul 10 13:39 /dev/cpu/6/msr
crw------- 1 root root 202,  7 Jul 10 13:39 /dev/cpu/7/msr
crw------- 1 root root 202,  8 Jul 10 13:39 /dev/cpu/8/msr
crw------- 1 root root 202,  9 Jul 10 13:39 /dev/cpu/9/msr

pcm-memory.x refuses to work with following stdout:

$ sudo ./pcm-memory.x 1

 Processor Counter Monitor: Memory Bandwidth Monitoring Utility  ($Format:%ci ID=%h$)

 This utility measures memory bandwidth per channel or per DIMM rank in real-time

Number of physical cores: 6
Number of logical cores: 12
Number of online logical cores: 12
Threads (logical cores) per physical core: 2
Num sockets: 1
Physical cores per socket: 6
Core PMU (perfmon) version: 4
Number of core PMU generic (programmable) counters: 4
Width of generic (programmable) counters: 48 bits
Number of core PMU fixed counters: 3
Width of fixed counters: 48 bits
Nominal core frequency: 3500000000 Hz
Package thermal spec power: 122 Watt; Package minimum power: 45 Watt; Package maximum power: 308 Watt;
PCM Error: Cannot open /sys/firmware/acpi/tables/MCFG
Can not access Jaketown/Ivytown PCI configuration space. Access to uncore counters (memory and QPI bandwidth) is disabled.
You must be root to access these Jaketown/Ivytown counters in PCM.
Access to Processor Counter Monitor has denied (no MSR or PCI CFG space access).
Cleaning up
 Freeing up all RMIDs

When debugging this problem I found that pcm-memory try to read /sys/firmware/acpi/tables/MCFG file which is missing on my OS.

$ ll /sys/firmware/acpi/tables
total 0
-r-------- 1 root root   1822 Jul 10 14:02 APIC
-r-------- 1 root root     56 Jul 10 14:02 BGRT
drwxr-xr-x 2 root root      0 Jul 10 14:02 data
-r-------- 1 root root     84 Jul 10 14:02 DBG2
-r-------- 1 root root     52 Jul 10 14:02 DBGP
-r-------- 1 root root    232 Jul 10 14:02 DMAR
-r-------- 1 root root 123480 Jul 10 14:02 DSDT
drwxr-xr-x 2 root root      0 Jul 10 14:02 dynamic
-r-------- 1 root root    276 Jul 10 14:02 FACP
-r-------- 1 root root     64 Jul 10 14:02 FACS
-r-------- 1 root root    156 Jul 10 14:02 FIDT
-r-------- 1 root root     68 Jul 10 14:02 FPDT
-r-------- 1 root root     56 Jul 10 14:02 HPET
-r-------- 1 root root    148 Jul 10 14:02 LPIT
-r-------- 1 root root     60 Jul 10 14:02 MCFG1
-r-------- 1 root root     60 Jul 10 14:02 MCFG2
-r-------- 1 root root     64 Jul 10 14:02 MIGT
-r-------- 1 root root     78 Jul 10 14:02 MSCT
-r-------- 1 root root    113 Jul 10 14:02 NITR
-r-------- 1 root root  43979 Jul 10 14:02 OEM1
-r-------- 1 root root 170610 Jul 10 14:02 OEM4
-r-------- 1 root root    110 Jul 10 14:02 PCCT
-r-------- 1 root root     48 Jul 10 14:02 RASF
-r-------- 1 root root    108 Jul 10 14:02 SLIT
-r-------- 1 root root   2608 Jul 10 14:02 SRAT
-r-------- 1 root root  54311 Jul 10 14:02 SSDT1
-r-------- 1 root root   3973 Jul 10 14:02 SSDT2
-r-------- 1 root root    671 Jul 10 14:02 SSDT3
-r-------- 1 root root  12290 Jul 10 14:02 SSDT4
-r-------- 1 root root     50 Jul 10 14:02 SVOS
-r-------- 1 root root     66 Jul 10 14:02 UEFI
-r-------- 1 root root    308 Jul 10 14:02 WDAT
-r-------- 1 root root     64 Jul 10 14:02 WDDT
-r-------- 1 root root     40 Jul 10 14:02 WSMT1
-r-------- 1 root root     40 Jul 10 14:02 WSMT2

but I have MCFG1/MCFG2 tables. I have tried to recompile pcm-memory with all mentions of /sys/firmware/acpi/tables/MCFG changed to /sys/firmware/acpi/tables/MCFG1 (and subsequently MCFG2). In both cases it looks like pcm-memory is able to show meaningful data:


 Processor Counter Monitor: Memory Bandwidth Monitoring Utility  ($Format:%ci ID=%h$)

 This utility measures memory bandwidth per channel or per DIMM rank in real-time

Number of physical cores: 6
Number of logical cores: 12
Number of online logical cores: 12
Threads (logical cores) per physical core: 2
Num sockets: 1
Physical cores per socket: 6
Core PMU (perfmon) version: 4
Number of core PMU generic (programmable) counters: 4
Width of generic (programmable) counters: 48 bits
Number of core PMU fixed counters: 3
Width of fixed counters: 48 bits
Nominal core frequency: 3500000000 Hz
Package thermal spec power: 122 Watt; Package minimum power: 45 Watt; Package maximum power: 308 Watt;
On the socket detected 2 memory controllers with total number of 6 channels.

Detected Intel(R) Core(TM) i7-7800X CPU @ 3.50GHz "Intel(r) microarchitecture codename Skylake-SP"
Update every 1 seconds
|---------------------------------------|
|--             Socket 0              --|
|---------------------------------------|
|--     Memory Channel Monitoring     --|
|---------------------------------------|
|--  Mem Ch 0: Reads (MB/s):    1.03  --|
|--            Writes(MB/s):    0.54  --|
|--  Mem Ch 1: Reads (MB/s):    1.03  --|
|--            Writes(MB/s):    0.53  --|
|-- NODE0 Mem Read (MB/s):      2.06  --|
|-- NODE0 Mem Write (MB/s) :    1.07  --|
|-- NODE0 P. Write (T/s) :         0  --|
|-- NODE0 Memory (MB/s):     3.13     --|
|---------------------------------------|
|---------------------------------------||---------------------------------------|
|--                 System Read Throughput(MB/s):          2.06                --|
|--                System Write Throughput(MB/s):          1.07                --|
|--               System Memory Throughput(MB/s):          3.13                --|
|---------------------------------------||---------------------------------------|

Unfortunately I haven't found any mentions of MCFG table could be split in MCFG1/MCFG2.

Here is dump of those tables:

$ sudo hexdump -C MCFG1
00000000  4d 43 46 47 3c 00 00 00  01 81 41 4c 41 53 4b 41  |MCFG<.....ALASKA|
00000010  41 20 4d 20 49 00 00 00  09 20 07 01 4d 53 46 54  |A M I.... ..MSFT|
00000020  97 00 00 00 00 00 00 00  00 00 00 00 00 00 00 60  |...............`|
00000030  00 00 00 00 00 00 00 ff  00 00 00 00              |............|
0000003c

$  sudo hexdump -C MCFG2
00000000  4d 43 46 47 3c 00 00 00  01 df 41 4c 41 53 4b 41  |MCFG<.....ALASKA|
00000010  41 20 4d 20 49 20 00 00  01 00 00 00 49 4e 54 4c  |A M I ......INTL|
00000020  13 10 09 20 00 00 00 00  00 00 00 00 00 00 00 60  |... ...........`|
00000030  00 00 00 00 00 00 00 ff  00 00 00 00              |............|
0000003c

So the questions are:

  • does pcm-memory supposed to work on single socket systems like I have?
  • is it safe to compile pcm-tools pointing to MCFG1/MCFG2 instead of MCFG and what potential problems you see in this case?

Build a static library for PCM

Hey, could you please extend the makefile to link the produced object files into a static library, e.g. via ar -rcs libPCM.a *.o?
Regards

VS2010 Toolset not available

Hi,

I tried to compile the project with VS2010. I used the pcm-all.sln file to load the project and used the release build.

When I tried to compile it, I got the following error:

Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value is

To fix this problem I have to perform the following tasks:

-Select all the subprojects in the project overview with shift
-Right click on one project
-Select Properties
-Select Configuration Properties
-General
-Platform Toolset
-Choose one of the available versions

Unsupported processor model (158) Intel i7-7820HQ

CPU Info
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz

pcm-power log
Processor Counter Monitor (2018-11-06 11:29:12 +0100 ID=769c8dd)

Power Monitoring Utility
Number of physical cores: 4
Number of logical cores: 8
Number of online logical cores: 8
Threads (logical cores) per physical core: 2
Num sockets: 1
Physical cores per socket: 4
Core PMU (perfmon) version: 4
Number of core PMU generic (programmable) counters: 4
Width of generic (programmable) counters: 48 bits
Number of core PMU fixed counters: 3
Width of fixed counters: 48 bits
Nominal core frequency: 2900000000 Hz
Package thermal spec power: 45 Watt; Package minimum power: 0 Watt; Package maximum power: 0 Watt;
Unsupported processor model (158).
Cleaning up

Support output to machine readable format

Hello,

I'm looking into creating a prometheus.io exporter for opcm, however, I can't find an easy way to take OPCM output which looks like:

|---------------------------------------||---------------------------------------|
|--             Socket  0             --||--             Socket  1             --|
|---------------------------------------||---------------------------------------|
|--     Memory Channel Monitoring     --||--     Memory Channel Monitoring     --|
|---------------------------------------||---------------------------------------|
|-- Mem Ch  0: Reads (MB/s):     0.49 --||-- Mem Ch  0: Reads (MB/s):     0.44 --|
|--            Writes(MB/s):     0.46 --||--            Writes(MB/s):     0.50 --|
|-- Mem Ch  1: Reads (MB/s):     0.48 --||-- Mem Ch  1: Reads (MB/s):     0.44 --|
|--            Writes(MB/s):     0.45 --||--            Writes(MB/s):     0.50 --|
|-- Mem Ch  2: Reads (MB/s):     0.47 --||-- Mem Ch  2: Reads (MB/s):     0.44 --|
|--            Writes(MB/s):     0.45 --||--            Writes(MB/s):     0.49 --|
|-- Mem Ch  3: Reads (MB/s):     0.52 --||-- Mem Ch  3: Reads (MB/s):     0.49 --|
|--            Writes(MB/s):     0.45 --||--            Writes(MB/s):     0.50 --|
|-- Mem Ch  4: Reads (MB/s):     0.51 --||-- Mem Ch  4: Reads (MB/s):     0.49 --|
|--            Writes(MB/s):     0.45 --||--            Writes(MB/s):     0.49 --|
|-- Mem Ch  5: Reads (MB/s):     0.52 --||-- Mem Ch  5: Reads (MB/s):     0.49 --|
|--            Writes(MB/s):     0.45 --||--            Writes(MB/s):     0.50 --|
|-- NODE 0 Mem Read (MB/s) :     2.98 --||-- NODE 1 Mem Read (MB/s) :     2.79 --|
|-- NODE 0 Mem Write(MB/s) :     2.70 --||-- NODE 1 Mem Write(MB/s) :     2.97 --|
|-- NODE 0 P. Write (T/s):      37638 --||-- NODE 1 P. Write (T/s):      37638 --|
|-- NODE 0 Memory (MB/s):        5.68 --||-- NODE 1 Memory (MB/s):        5.76 --|
|---------------------------------------||---------------------------------------|
|---------------------------------------||---------------------------------------|
|--                 System Read Throughput(MB/s):          5.76                --|
|--                System Write Throughput(MB/s):          5.68                --|
|--               System Memory Throughput(MB/s):         11.44                --|
|---------------------------------------||---------------------------------------|

The CSV format kind of helps. but ideally I'd like every key/value to be on its own new line so that I can easily parse the values out and expose them in the exporter.

For instance, the node-exporter1 exposes the following for CPU metrics:

node_cpu{cpu="cpu0",mode="guest"} 180228.76
node_cpu{cpu="cpu0",mode="idle"} 1.2785727e+06
node_cpu{cpu="cpu0",mode="iowait"} 63074.1
node_cpu{cpu="cpu0",mode="irq"} 0
node_cpu{cpu="cpu0",mode="nice"} 2.84
node_cpu{cpu="cpu0",mode="softirq"} 8021.39
node_cpu{cpu="cpu0",mode="steal"} 0
node_cpu{cpu="cpu0",mode="system"} 149479.42
node_cpu{cpu="cpu0",mode="user"} 214962.05

windows_howto.rtf not displaying correctly (encoding issue?)

github shows the raw as a mess of formatting; if you download and open the .rtf with wordpad, it shows the html of the github page.

The way it seems to work is to copypasta the github raw into a plain text document that you rename with the .rtf extension.

I might be doing something dumb here, but this computer is basically fresh out of the box and the howto isn't "just working" for it, so it seems to be a bug in at least some sense.

pcm does not work with secure boot

While using secure boot, PCM returns zeros, but perf still works.

perf stat -e uncore_imc_1/cas_count_read/ -I 1000 -a

time counts unit events

 1.000132123               1.67 MiB  uncore_imc_1/cas_count_read/                                  
 2.000226366               0.91 MiB  uncore_imc_1/cas_count_read/                                  
 3.000350818               2.66 MiB  uncore_imc_1/cas_count_read/                                  
 4.000489773               2.84 MiB  uncore_imc_1/cas_count_read/                                  

...
Secure Boot Enabled

|---------------------------------------||---------------------------------------|
|-- Socket 0 --||-- Socket 1 --|
|---------------------------------------||---------------------------------------|
|-- Memory Channel Monitoring --||-- Memory Channel Monitoring --|
|---------------------------------------||---------------------------------------|
|-- NODE 0 Mem Read (MB/s) : 0.00 --||-- NODE 1 Mem Read (MB/s) : 0.00 --|
|-- NODE 0 Mem Write(MB/s) : 0.00 --||-- NODE 1 Mem Write(MB/s) : 0.00 --|
|-- NODE 0 P. Write (T/s): 0 --||-- NODE 1 P. Write (T/s): 0 --|
|-- NODE 0 Memory (MB/s): 0.00 --||-- NODE 1 Memory (MB/s): 0.00 --|
|---------------------------------------||---------------------------------------|
|---------------------------------------||---------------------------------------|
|-- System Read Throughput(MB/s): 0.00 --|
|-- System Write Throughput(MB/s): 0.00 --|
|-- System Memory Throughput(MB/s): 0.00 --|
|---------------------------------------||---------------------------------------|

Secure Boot Disabled

|---------------------------------------||---------------------------------------|
|-- Socket 0 --||-- Socket 1 --|
|---------------------------------------||---------------------------------------|
|-- Memory Channel Monitoring --||-- Memory Channel Monitoring --|
|---------------------------------------||---------------------------------------|
|-- Mem Ch 0: Reads (MB/s): 0.62 --||-- Mem Ch 0: Reads (MB/s): 0.60 --|
|-- Writes(MB/s): 0.56 --||-- Writes(MB/s): 0.57 --|
|-- Mem Ch 1: Reads (MB/s): 0.57 --||-- Mem Ch 1: Reads (MB/s): 0.59 --|
|-- Writes(MB/s): 0.52 --||-- Writes(MB/s): 0.56 --|
|-- Mem Ch 2: Reads (MB/s): 0.56 --||-- Mem Ch 2: Reads (MB/s): 0.59 --|
|-- Writes(MB/s): 0.52 --||-- Writes(MB/s): 0.56 --|
|-- Mem Ch 3: Reads (MB/s): 0.55 --||-- Mem Ch 3: Reads (MB/s): 0.65 --|
|-- Writes(MB/s): 0.52 --||-- Writes(MB/s): 0.65 --|
|-- Mem Ch 4: Reads (MB/s): 0.56 --||-- Mem Ch 4: Reads (MB/s): 0.68 --|
|-- Writes(MB/s): 0.52 --||-- Writes(MB/s): 0.68 --|
|-- Mem Ch 5: Reads (MB/s): 0.54 --||-- Mem Ch 5: Reads (MB/s): 0.66 --|
|-- Writes(MB/s): 0.50 --||-- Writes(MB/s): 0.66 --|
|-- NODE 0 Mem Read (MB/s) : 3.40 --||-- NODE 1 Mem Read (MB/s) : 3.77 --|
|-- NODE 0 Mem Write(MB/s) : 3.15 --||-- NODE 1 Mem Write(MB/s) : 3.69 --|
|-- NODE 0 P. Write (T/s): 37643 --||-- NODE 1 P. Write (T/s): 37645 --|
|-- NODE 0 Memory (MB/s): 6.55 --||-- NODE 1 Memory (MB/s): 7.46 --|
|---------------------------------------||---------------------------------------|
|---------------------------------------||---------------------------------------|
|-- System Read Throughput(MB/s): 7.16 --|
|-- System Write Throughput(MB/s): 6.84 --|
|-- System Memory Throughput(MB/s): 14.00 --|
|---------------------------------------||---------------------------------------|

Built pcm using visual studio

I Built pcm using visual studio 15 running on ws2012. The build was successful and executable generated on x64/debug folder however when executing, dll error message:

Starting MSR service failed with error 2 The system cannot find the file specified.
Trying to load winring0.dll/winring0.sys driver...
Failed to load winring0.dll/winring0.sys driver.

Cannot access CPU counters
You must have signed msr.sys driver in your current directory and have administrator rights to run this program
Access to Processor Counter Monitor has denied (no MSR or PCI CFG space access).

Support the monitoring of branch misses

Hi Developers,

I'm wondering if there is any plan to support the monitoring of branch misses? It would be great if there is a function like getBranchMisses() since it's really a critical metric to anyone who cares performance.

Thanks

Add absolute timestamp to csv output

Hello,
I'm adding support for PCM to OPPAT (https://patinnc.github.io/) but I need to be able to correlate the pcm csv data with other data. In particular with higher resolution than 1 second. This would let me correlate the PCM data with ETW or ftrace data.
I would like to add an absolute timestamp such as in the attached patch. It uses GetSystemTimeAsFileTime on windows, clock_gettime(CLOCK_MONOTONIC, &tp) on linux. I'm not sure what to do on FreeBSD or Mac.
Thanks
Pat

pcm_20181006_patch.txt

pcm-memory.x Segmentation fault

Hi,
Any idea what may cause pcm-memory.x to have a segmentation fault (running on Broadwell).

Thanks,
Dan

[root@cd6n2 pcm]# ./pcm-memory.x 1

 Processor Counter Monitor: Memory Bandwidth Monitoring Utility  ($Format:%ci ID=%h$)

 This utility measures memory bandwidth per channel or per DIMM rank in real-time

Number of physical cores: 20
Number of logical cores: 40
Number of online logical cores: 40
Threads (logical cores) per physical core: 2
Num sockets: 2
Physical cores per socket: 10
Core PMU (perfmon) version: 3
Number of core PMU generic (programmable) counters: 4
Width of generic (programmable) counters: 48 bits
Number of core PMU fixed counters: 3
Width of fixed counters: 48 bits
Nominal core frequency: 2200000000 Hz
Package thermal spec power: 85 Watt; Package minimum power: 42 Watt; Package maximum power: 170 Watt;
Socket 0: 2 memory controllers detected with total number of 5 channels. 2 QPI ports detected. 0 M2M (mesh to memory) blocks detected.
Socket 1: 2 memory controllers detected with total number of 5 channels. 2 QPI ports detected. 0 M2M (mesh to memory) blocks detected.

Detected Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz "Intel(r) microarchitecture codename Broadwell-EP/EX" stepping 1 microcode level 0xb000021
Update every 1 seconds
DEBUG: caught signal to interrupt (Segmentation fault).
Cleaning up
 Freeing up all RMIDs

Could pcm work on Intel(R) Xeon(R) Silver 4110 CPU @ 2.10GHz "Intel(r) microarchitecture codename Skylake-SP" ?

I run ./pcm.x as rooter on Intel(R) Xeon(R) Silver 4110 CPU @ 2.10GHz "Intel(r) microarchitecture codename Skylake-SP", the information is listed below:
Core (SKT) | EXEC | IPC | FREQ | AFREQ | L3MISS | L2MISS | L3HIT | L2HIT | L3MPI | L2MPI | L3OCC | TEMP

0 0 0.00 -1.00 0.00 -1.00 0 0 1.00 1.00 0.00 0.00 256 58
1 1 0.00 -1.00 0.00 -1.00 0 0 1.00 1.00 0.00 0.00 1024 61
2 0 0.00 -1.00 0.00 -1.00 0 0 1.00 1.00 0.00 0.00 544 60
3 1 0.00 -1.00 0.00 -1.00 0 0 1.00 1.00 0.00 0.00 448 59
4 0 0.00 -1.00 0.00 -1.00 0 0 1.00 1.00 0.00 0.00 96 59
...
Why IPC = -1, LxMISS=0, Lxhit=1?

Cannot measure cycles with Linux 4.11 and -DPCM_USE_PERF

When -DPCM_USE_PERF is enabled with the Linux kernel 4.11, pcm fails to measure the "Cycles", and "IPC" becomes "inf" due to a division by 0. If the line CXXFLAGS += -DPCM_USE_PERF is commented-out, it works perfectly.

My environment is as follows.

  • CPU: Core i5-6400 (Skylake)
  • distro: Debian GNU/Linux testing (code name "buster", next release of the current stable "stretch")
  • kernel: 4.11.0-1-amd64 (distributor's version)
  • gcc: 6.4.0 20170704 (Debian 6.4.0-1)
  • pcm: commit 2851443

Because $ sudo perf stat -e cycles gives correct results in the same environment, I guess the reason is not a bug of the kernel but a mis-configuration from the pcm side, possibly stemming from recent changes to the kernel code.

Possible to measure disk I/O waiting time for active CPUs?

There are already many tools to measure the % of the CPU waiting time during I/O operations, like dstat. Nevertheless, I am looking for a way to measure the waiting time of the active cores, pretty much in a way like pcm.x reports the utilization of cores in the active state.

I am running a compute-intensive map-reduce application, which is using only a few cores. Programs like dstat report only the total I/O waiting time across all cores (active and inactive), but I am suspecting that my active cores may be I/O bottlenecked.

Does PCM support Kabylake CPUs (e.g. Intel i5-7300HQ) ?

D:\CEC\PCM>pcm.exe
DEBUG: Setting Ctrl+C done.

Processor Counter Monitor (2017-03-24 23:15:23 +0100 ID=ea6ef86)

Error: unsupported processor. Only Intel(R) processors are supported (Atom(R) and microarchitecture codename Nehalem/Nehalem-EP, Atom(tm), Westmere/Clarkdale, Sandy Bridge, Westmere-EP, Sandy Bridge-EP/Jaketown, Nehalem-EX, Westmere-EX, Ivy Bridge, Haswell, Broadwell, Ivy Bridge-EP/EN/EX/Ivytown, Haswell-EP/EN/EX, Broadwell-EP/EX, Broadwell-DE, Knights Landing, Skylake). CPU model number: 158 Brand: "Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz"
Access to Processor Counter Monitor has denied (no MSR or PCI CFG space access).

Section "destinationdirs" and "sourcedisksfiles" are defined multiple times

While trying to build MSR driver from the master branch using DDK 10.0.17763 and Visual Studio 2017 15.9.2, I get following errors:

....\pcm\WinMSRDriver\Win7\MSR.inf(13-13): error 1209: Section [destinationdirs] is defined multiple times.
....\pcm\WinMSRDriver\Win7\MSR.inf(28-28): error 1209: Section [sourcedisksfiles] is defined multiple times.

Tried DDK 10.0.15063.0 also. Same issue.

Issues running on Mac OS X when Intel® Hyper-Threading Technology is disabled

Hi Processor Counter Monitor Team,

I am experiencing issues running the pcm.x tool on a Mac OS X machine, when Intel® Hyper-Threading Technology is disabled.

Namely when running pcm.x -r before disabling Intel® Hyper-Threading, I obtain the following:

$ ./pcm.x -r

 Intel(r) Performance Counter Monitor V2.11.1 ($Format:%ci ID=%h$)

 Copyright (c) 2009-2016 Intel Corporation

Number of physical cores: 4
Number of logical cores: 8
Number of online logical cores: 8
Threads (logical cores) per physical core: 2
Num sockets: 1
Physical cores per socket: 4
Core PMU (perfmon) version: 3
Number of core PMU generic (programmable) counters: 4
Width of generic (programmable) counters: 48 bits
Number of core PMU fixed counters: 3
Width of fixed counters: 48 bits
Nominal core frequency: 2800000000 Hz
Package thermal spec power: 47 Watt; Package minimum power: 0 Watt; Package maximum power: 0 Watt; 

 Resetting PMU configuration
 Zeroed PMU registers

Detected Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz "Intel(r) microarchitecture codename Haswell" stepping 1

To disable Intel® Hyper-Threading, I use the following procedure:

  1. Open Instruments app.
  2. Navigate to Preferences and select the CPUs tab.
  3. Deselect Hardware Multi-Threading.

Then, running pcm.x again, I obtain the following:

$ ./pcm.x -r

 Intel(r) Performance Counter Monitor V2.11.1 ($Format:%ci ID=%h$)

 Copyright (c) 2009-2016 Intel Corporation

Number of physical cores: 2
Number of logical cores: 4
Number of online logical cores: 4
Threads (logical cores) per physical core: 2
Num sockets: 1
Physical cores per socket: 2
Core PMU (perfmon) version: 3
Number of core PMU generic (programmable) counters: 4
Width of generic (programmable) counters: 48 bits
Number of core PMU fixed counters: 3
Width of fixed counters: 48 bits
Nominal core frequency: 5200000000 Hz
Package thermal spec power: 23712 Watt; Package minimum power: 23605 Watt; Package maximum power: 32767 Watt; 

 Resetting PMU configuration
 Zeroed PMU registers
WARNING: Core 1 IA32_PERFEVTSEL0_ADDR are not zeroed 140734740421736
Access to Intel(r) Performance Counter Monitor has denied (Performance Monitoring Unit is occupied by other application). Try to stop the application that uses PMU.
Alternatively you can try running Intel PCM with option -r to reset PMU configuration at your own risk.
Cleaning up

As you can see from above, the reported count of physical cores is incorrect, since Intel(R) Core(TM) i7-4980HQ has 4 physical cores, and 8 logical cores. The pcm.x is unable to detect the offline cores, and the execution of the program is interrupted.

I am running pcm.x on a Mac OS X El Capitan 10.11.6, compiled with Apple LLVM version 8.0.0 (clang-800.0.42.1). I have observed the same problem running on macOS Sierra.

Would it be possible to fix this issue?

Precompiled Kext for Mac OS X

Hi Processor Counter Monitor Team,

I was wondering whether it would be possible to distribute a precompiled Kext module, for the Mac OS X driver for Intel PCM?

While on Windows we can access the MSR using winring0 and winpmem, Mac OS X, particularly El Capitan and macOS Sierra, require a Developer ID certificate for signing Kexts. Therefore, to load the Kext, System Integrity Protection has to be disabled, leaving the Mac OS X system vulnerable.

While the code to hangle and interpret the MSR data undergoes improvements overtime, it seems that the interface to read the MSR data from the Mac OS X kernel does not change as often. Most of the files in the MacMSRDriver have copyrights headers dating from 2013. As such would it be possible to have a signed precompiled kernel, so it can be loaded without disabling Mac OS X System Integrity Protection? The users of Intel PCM will eventually have to recompile the client interface only, and work on a stable driver, that will be updated with new releases of Mac OS X.

Greetings,
Alen Stojanov

Can't compile WinMSRDriver

I'm trying to compile WinMSRDriver under Windows 10 within the VS 2015 developer command prompt. When it tries to run nmake it errors with makefile(1) : fatal error U1052: file '\makefile.def' not found. I downloaded WDK 10 in the hope this is compatible (as the instructions mention the DDK).
Otherwise, I could compile the VS solution without problems, it's just the driver which is making trouble.

i5-4570 display only spec power

pcm/pcm.x                                                                                                                  
                                                                                                                                           
 Processor Counter Monitor  ($Format:%ci ID=%h$)                                                                       
                                                                                                                       
                                                                                                                       
Number of physical cores: 4                                                                                            
Number of logical cores: 4                                                                                             
Number of online logical cores: 4                                                                                      
Threads (logical cores) per physical core: 1                                                                           
Num sockets: 1                                                                                    
Physical cores per socket: 4                                                                                          
Core PMU (perfmon) version: 3                                                                                                                                                                
Number of core PMU generic (programmable) counters: 8                                                                  
Width of generic (programmable) counters: 48 bits                                                                      
Number of core PMU fixed counters: 3                                                                                   
Width of fixed counters: 48 bits                                                                                       
Nominal core frequency: 3200000000 Hz                                                                                          
Package thermal spec power: 84 Watt; Package minimum power: 0 Watt; Package maximum power: 0 Watt;                     
                                                                                                             
Detected Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz "Intel(r) microarchitecture codename Haswell" stepping 3               
                                                                                                                                                     
 EXEC  : instructions per nominal CPU cycle                                                                                                
 IPC   : instructions per CPU cycle                                                                   
 FREQ  : relation to nominal CPU frequency='unhalted clock ticks'/'invariant timer ticks' (includes Intel Turbo Boost)
 AFREQ : relation to nominal CPU frequency while in active state (not in power-saving C state)='unhalted clock ticks'/'invariant timer ticks while in C0-state'  (includes Intel Turbo Boost)
 L3MISS: L3 cache misses
 L2MISS: L2 cache misses (including other core's L2 cache *hits*)
 L3HIT : L3 cache hit ratio (0.00-1.00)
 L2HIT : L2 cache hit ratio (0.00-1.00)
 L3MPI : number of L3 cache misses per instruction
 L2MPI : number of L2 cache misses per instruction
 READ  : bytes read from main memory controller (in GBytes)
 WRITE : bytes written to main memory controller (in GBytes)
 IO    : bytes read/written due to IO requests to memory controller (in GBytes); this may be an over estimate due to same-cache-line partial requests
 TEMP  : Temperature reading in 1 degree Celsius relative to the TjMax temperature (thermal headroom): 0 corresponds to the max temperature
 energy: Energy in Joules


 Core (SKT) | EXEC | IPC  | FREQ  | AFREQ | L3MISS | L2MISS | L3HIT | L2HIT | L3MPI | L2MPI | TEMP

   0    0     0.04   0.87   0.04    0.97     337 K    661 K    0.49    0.40    0.00    0.01     57
   1    0     0.04   0.84   0.04    1.04     320 K    614 K    0.48    0.48    0.00    0.01     59
   2    0     0.02   0.65   0.03    1.00     227 K    451 K    0.50    0.36    0.00    0.01     61
   3    0     0.03   0.77   0.04    1.01     206 K    435 K    0.53    0.44    0.00    0.00     58
---------------------------------------------------------------------------------------------------------------
 SKT    0     0.03   0.80   0.04    1.01    1091 K   2162 K    0.50    0.43    0.00    0.01     57
---------------------------------------------------------------------------------------------------------------
 TOTAL  *     0.03   0.80   0.04    1.01    1091 K   2162 K    0.50    0.43    0.00    0.01     N/A

 Instructions retired:  394 M ; Active cycles:  495 M ; Time (TSC): 3228 Mticks ; C0 (active,non-halted) core residency: 3.81 %

 C1 core residency: 96.19 %; C3 core residency: 0.00 %; C6 core residency: 0.00 %; C7 core residency: 0.00 %;
 C2 package residency: 0.00 %; C3 package residency: 0.00 %; C6 package residency: 0.00 %; C7 package residency: 0.00 %;

 PHYSICAL CORE IPC                 : 0.80 => corresponds to 19.91 % utilization for cores in active state
 Instructions per nominal CPU cycle: 0.03 => corresponds to 0.76 % core utilization over time interval
 SMI count: 0
---------------------------------------------------------------------------------------------------------------
MEM (GB)->|  READ |  WRITE |   IO   | CPU energy |
---------------------------------------------------------------------------------------------------------------
 SKT   0     0.55     0.04     0.45       0.79
---------------------------------------------------------------------------------------------------------------

on system with i5-2520M display all counters Package thermal spec power: 35 Watt; Package minimum power: 24 Watt; Package maximum power: 56 Watt;

This utility bug or processor not supported? Another utility have similar problem Yamagi/powermon#1

Replace QPI hardcoded in strings with QPI or UPI detected at runtime

On a system with Skylake CPUs, the inter-socket interface is called UPI, but pcm.x still prints some messages calling it QPI like this:
Max QPI link 0 speed: 23.3 GBytes/second (10.4 GT/second)
Other prints refer to it as UPI:

Intel(r) UPI data traffic estimation in bytes (data traffic coming to CPU/socket through UPI links):
Total UPI outgoing data and non-data traffic:   22 M

Suggestion
Any print that still has QPI hardcoded like:
std::cerr << "Max QPI speed: " << max_qpi_speed / (1e9) << " GBytes/second (" << max_qpi_speed / (1e9*getBytesPerLinkTransfer()) << " GT/second)" << std::endl;
should use m->xPI() like this:
cout << "\n" << "Intel(r) "<< m->xPI() <<" data traffic estimation in bytes (data traffic coming to CPU/socket through "<< m->xPI() <<" links):" << "\n" << "\n";
to print the right name based on the CPU:

    const char * xPI() const
    {
        if (hasUPI())
            return "UPI";

        return "QPI";
    }

macos automatic installation fails

Hi,

On Macos Mojave the installation instructions lead to an error. Namely, when sudo sh ./kextload.sh calls cp -R kextbuild/Release/PcmMsrDriver.kext /tmp/. the file PcmMsrDriver.kext is not found.

When I run make kext, the file gets build. I believe the issue is that when calling make kext library, the build step for library overwrites the generated kext file - I was able to install pcm manually when I backed the kext file before running make library.

I think that a sufficient fix would be to let xcodebuild operate in different directories.

Cheers,
Pavel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.