• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/workflows/H13-Oct-2021-158124

MacMSRDriver/H13-Oct-2021-2,5952,076

PCM-Core_Win/H13-Oct-2021-227202

PCM-IIO_Win/H13-Oct-2021-227202

PCM-LSPCI_Win/H13-Oct-2021-227202

PCM-Latency_Win/H13-Oct-2021-227202

PCM-Lib_Win/H03-May-2022-357256

PCM-MMIO_Win/H13-Oct-2021-229204

PCM-MSR_Win/H13-Oct-2021-227202

PCM-Memory_Win/H13-Oct-2021-227202

PCM-NUMA_Win/H13-Oct-2021-227202

PCM-PCICFG_Win/H13-Oct-2021-227202

PCM-PCIE_Win/H13-Oct-2021-227202

PCM-Power_Win/H03-May-2022-227202

PCM-Raw_Win/H13-Oct-2021-230205

PCM-Service_Win/H03-May-2022-1,4911,049

PCM-TSX_Win/H13-Oct-2021-224199

PCM_Win/H03-May-2022-556399

PMURegisterDeclarations/H13-Oct-2021-386382

WinMSRDriver/H13-Oct-2021-662505

daemon/H13-Oct-2021-2,5872,026

exceptions/H13-Oct-2021-238

fedora/H13-Oct-2021-7762

freegetopt/H13-Oct-2021-431241

grafana/H13-Oct-2021-315251

winpmem/H03-May-2022-301193

winring0/H03-May-2022-1,167678

.bdsignore.allH A D13-Oct-2021342 3433

.codedocsH A D13-Oct-20214.8 KiB197188

.gitattributesH A D13-Oct-2021117 75

.gitignoreH A D13-Oct-2021225 3433

CUSTOM-COMPILE-OPTIONS.mdH A D13-Oct-2021772 1610

DOCKER_README.mdH A D13-Oct-20211 KiB139

DockerfileH A D13-Oct-2021269 128

DoxyfileH A D13-Oct-202149.9 KiB1,238879

ENVVAR_README.mdH A D13-Oct-2021395 84

FAQ.mdH A D13-Oct-20213.3 KiB7342

LICENSEH A D13-Oct-20211.5 KiB3023

MakefileH A D13-Oct-20215.1 KiB161116

PCM-EXPORTER.mdH A D13-Oct-20211.8 KiB3222

PCM-SENSOR-SERVER-README.mdH A D13-Oct-20213.9 KiB4738

PCM_RAW_README.mdH A D13-Oct-202110.2 KiB130108

README.mdH A D13-Oct-20217.8 KiB9671

WINDOWS_HOWTO.mdH A D13-Oct-20213.5 KiB5227

build_solution.batH A D13-Oct-2021512 137

bw.cppH A D13-Oct-20216.5 KiB180144

bw.hH A D13-Oct-20213 KiB7947

c_example.cH A D13-Oct-20213.6 KiB127107

convert_edp_list.shH A D13-Oct-202151 51

cppcheck.shH A D13-Oct-2021188 127

cpuasynchcounter.hH A D13-Oct-20217.2 KiB214159

cpucounters.cppH A D13-Oct-2021275.3 KiB7,6226,548

cpucounters.hH A D13-Oct-2021142.5 KiB3,8832,508

dashboard.cppH A D03-May-202224.1 KiB743702

dashboard.hH A D13-Oct-20211.7 KiB236

dashboardtest.cppH A D13-Oct-20211.6 KiB227

debug.cppH A D13-Oct-20211.7 KiB438

debug.hH A D13-Oct-20213.5 KiB9148

docker-compose.ymlH A D13-Oct-2021446 1716

favicon.ico.hH A D13-Oct-20211.8 KiB2120

lspci.hH A D13-Oct-202115.8 KiB465416

memoptest.cppH A D13-Oct-20214.1 KiB149109

mmio.cppH A D13-Oct-20218.8 KiB281229

mmio.hH A D13-Oct-20214.8 KiB161127

msr.cppH A D13-Oct-20217.2 KiB268204

msr.hH A D13-Oct-20214.3 KiB154106

msrtest.cppH A D13-Oct-20214 KiB9364

mutex.hH A D13-Oct-20211.1 KiB7163

pci.cppH A D03-May-202219.1 KiB721551

pci.hH A D13-Oct-20214.6 KiB171104

pcm-all.slnH A D13-Oct-202112.5 KiB182180

pcm-bw-histogram.shH A D13-Oct-20212.3 KiB6648

pcm-core.cppH A D13-Oct-202117.6 KiB583492

pcm-exporterH A D13-Oct-202139 51

pcm-iio.cppH A D13-Oct-202148.6 KiB1,2631,087

pcm-latency.cppH A D13-Oct-202118.3 KiB544457

pcm-lspci.cppH A D13-Oct-20215.2 KiB12196

pcm-memory.cppH A D13-Oct-202151.5 KiB1,2331,113

pcm-mmio.cppH A D13-Oct-20214.7 KiB127100

pcm-msr.cppH A D13-Oct-20215.1 KiB147119

pcm-numa.cppH A D13-Oct-202111.4 KiB315245

pcm-pcicfg.cppH A D13-Oct-20214.6 KiB11990

pcm-pcie.cppH A D13-Oct-202110.7 KiB270213

pcm-pcie.hH A D13-Oct-202124.3 KiB813689

pcm-power.cppH A D13-Oct-202125.6 KiB500428

pcm-raw.cppH A D13-Oct-202152.3 KiB1,2851,167

pcm-sensor-server.cppH A D13-Oct-2021126.5 KiB3,2532,703

pcm-sensor.cppH A D13-Oct-202131.5 KiB685607

pcm-tsx.cppH A D13-Oct-202129.8 KiB601518

pcm.cppH A D13-Oct-202156.6 KiB1,3801,197

pcm.specH A D13-Oct-20211.8 KiB7362

pmu-query.pyH A D13-Oct-20214.1 KiB123110

readmem.cppH A D13-Oct-20212.9 KiB9055

readmem.shH A D13-Oct-2021615 1612

realtime.cppH A D13-Oct-20218.4 KiB286192

resctrl.cppH A D13-Oct-20216.1 KiB146129

resctrl.hH A D13-Oct-20212.3 KiB5330

simdjson_wrapper.cppH A D13-Oct-2021114 64

simdjson_wrapper.hH A D13-Oct-2021600 2118

threadpool.cppH A D13-Oct-20211.7 KiB4611

threadpool.hH A D13-Oct-20214 KiB15294

topology.cppH A D13-Oct-20215.1 KiB13167

topology.hH A D13-Oct-202116.6 KiB573416

types.hH A D13-Oct-202144.5 KiB1,267941

utils.cppH A D13-Oct-202118.5 KiB594434

utils.hH A D13-Oct-202112 KiB451370

version.hH A D13-Oct-202162 21

width_extender.hH A D13-Oct-20216.6 KiB179127

README.md

1--------------------------------------------------------------------------------
2Processor Counter Monitor (PCM)
3--------------------------------------------------------------------------------
4
5[PCM Tools](#pcm-tools) | [Building PCM](#building-pcm-tools) | [Downloading Pre-Compiled PCM](#downloading-pre-compiled-pcm-tools) | [FAQ](#frequently-asked-questions-faq) | [API Documentation](#pcm-api-documentation) | [Environment Variables](#pcm-environment-variables) | [Compilation Options](#custom-compilation-options)
6
7Processor Counter Monitor (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 and DragonFlyBSD operating systems.
8
9*Github repository statistics:* ![Custom badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fhetthbszh0.execute-api.us-east-2.amazonaws.com%2Fdefault%2Fpcm-clones) ![Custom badge](https://img.shields.io/endpoint?url=https%3A%2F%2F5urjfrshcd.execute-api.us-east-2.amazonaws.com%2Fdefault%2Fpcm-yesterday-clones) ![Custom badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fcsqqh18g3l.execute-api.us-east-2.amazonaws.com%2Fdefault%2Fpcm-today-clones)
10
11--------------------------------------------------------------------------------
12Current Build Status
13--------------------------------------------------------------------------------
14
15- Linux and OSX: [![Build Status](https://travis-ci.com/opcm/pcm.svg?branch=master)](https://travis-ci.com/opcm/pcm)
16- Windows: [![Build status](https://ci.appveyor.com/api/projects/status/github/opcm/pcm?branch=master&svg=true)](https://ci.appveyor.com/project/opcm/pcm)
17- FreeBSD: [![Build Status](https://api.cirrus-ci.com/github/opcm/pcm.svg)](https://cirrus-ci.com/github/opcm/pcm)
18- Docker Hub: [![Build status](https://img.shields.io/docker/cloud/build/opcm/pcm.svg)](https://github.com/opcm/pcm/blob/master/DOCKER_README.md) [![pulls](https://img.shields.io/docker/pulls/opcm/pcm.svg)](https://github.com/opcm/pcm/blob/master/DOCKER_README.md)
19
20--------------------------------------------------------------------------------
21PCM Tools
22--------------------------------------------------------------------------------
23
24PCM provides a number of command-line utilities for real-time monitoring:
25
26- **pcm** : basic processor monitoring utility (instructions per cycle, core frequency (including Intel(r) Turbo Boost Technology), memory and Intel(r) Quick Path Interconnect bandwidth, local and remote memory bandwidth, cache misses, core and CPU package sleep C-state residency, core and CPU package thermal headroom, cache utilization, CPU and memory energy consumption)
27![pcm output](https://raw.githubusercontent.com/wiki/opcm/pcm/pcm.x.jpg)
28- **pcm-sensor-server** : pcm collector exposing metrics over http in JSON or Prometheus (exporter text based) format ([how-to](https://github.com/opcm/pcm/blob/master/PCM-EXPORTER.md)). Also available as a [docker container](https://github.com/opcm/pcm/blob/master/DOCKER_README.md)
29- **pcm-memory** : monitor memory bandwidth (per-channel and per-DRAM DIMM rank)
30![pcm-memory output](https://raw.githubusercontent.com/wiki/opcm/pcm/pcm-memory.x.JPG)
31- **pcm-latency** : monitor L1 cache miss and DDR/PMM memory latency
32- **pcm-pcie** : monitor PCIe bandwidth per-socket
33- **pcm-iio** : monitor PCIe bandwidth per PCIe device
34![pcm-iio output](https://raw.githubusercontent.com/wiki/opcm/pcm/pcm-iio.png)
35- **pcm-numa** : monitor local and remote memory accesses
36- **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
37- **pcm-tsx**: monitor performance metrics for Intel(r) Transactional Synchronization Extensions
38- **pcm-core** and **pmu-query**: query and monitor arbitrary processor core events
39- **pcm-raw**: [program arbitrary **core** and **uncore** events by specifying raw register event ID encoding](https://github.com/opcm/pcm/blob/master/PCM_RAW_README.md)
40- **pcm-bw-histogram**: collect memory bandwidth utilization histogram
41
42Graphical front ends:
43- **pcm Grafana dashboard** :  front-end for Grafana (in [grafana](https://github.com/opcm/pcm/tree/master/grafana) directory)
44![pcm grafana output](https://raw.githubusercontent.com/wiki/opcm/pcm/pcm-dashboard.png)
45- **pcm-sensor** :  front-end for KDE KSysGuard
46- **pcm-service** :  front-end for Windows perfmon
47
48There are also utilities for reading/writing model specific registers (**pcm-msr**), PCI configuration registers (**pcm-pcicfg**) and memory mapped registers (**pcm-mmio**) supported on Linux, Windows, Mac OS X and FreeBSD.
49
50And finally a daemon that stores core, memory and QPI counters in shared memory that can be be accessed by non-root users.
51
52--------------------------------------------------------------------------------
53Building PCM Tools
54--------------------------------------------------------------------------------
55
56- Linux: just type 'make'. You will get all the utilities (pcm.x, pcm-memory.x, etc) built in the main PCM directory.
57- FreeBSD/DragonFlyBSD: just type 'gmake'. You will get all the utilities (pcm.x, pcm-memory.x, etc) built in the main PCM directory. If the 'gmake' command is not available, you need to install GNU make from ports (for example with 'pkg install gmake').
58- Windows: follow the steps in [WINDOWS_HOWTO.md](https://github.com/opcm/pcm/blob/master/WINDOWS_HOWTO.md) (will need to build or download additional drivers).
59- Mac OS X: follow instructions in [MAC_HOWTO.txt](https://github.com/opcm/pcm/blob/master/MAC_HOWTO.txt)
60
61--------------------------------------------------------------------------------
62Downloading Pre-Compiled PCM Tools
63--------------------------------------------------------------------------------
64
65- Linux:
66  * openSUSE: `sudo zypper install pcm`
67  * Fedora: `sudo yum install pcm`
68  * RPMs and DEBs with the *latest* PCM version for RHEL/SLE/Ubuntu/Debian/openSUSE/etc distributions (binary and source) are available [here](https://software.opensuse.org/download/package?package=pcm&project=home%3Aopcm)
69- Windows: download PCM binaries as [appveyor build service](https://ci.appveyor.com/project/opcm/pcm/history) artifacts and required Visual C++ Redistributable from [www.microsoft.com](https://www.microsoft.com/en-us/download/details.aspx?id=48145). Additional drivers are needed, see [WINDOWS_HOWTO.md](https://github.com/opcm/pcm/blob/master/WINDOWS_HOWTO.md).
70- Docker: see [instructions on how to use pcm-sensor-server pre-compiled container from docker hub](https://github.com/opcm/pcm/blob/master/DOCKER_README.md).
71
72--------------------------------------------------------------------------------
73Frequently Asked Questions (FAQ)
74--------------------------------------------------------------------------------
75
76PCM's frequently asked questions (FAQ) are located [here](https://github.com/opcm/pcm/blob/master/FAQ.md).
77
78--------------------------------------------------------------------------------
79PCM API documentation
80--------------------------------------------------------------------------------
81
82PCM API documentation is embedded in the source code and can be generated into html format from source using Doxygen (www.doxygen.org).
83
84--------------------------------------------------------------------------------
85PCM environment variables
86--------------------------------------------------------------------------------
87
88The list of PCM environment variables is located [here](https://github.com/opcm/pcm/blob/master/ENVVAR_README.md)
89
90--------------------------------------------------------------------------------
91Custom compilation options
92--------------------------------------------------------------------------------
93The list of custom compilation options is located [here](https://github.com/opcm/pcm/blob/master/CUSTOM-COMPILE-OPTIONS.md)
94
95
96

readmem.cpp

1 /*
2 Copyright (c) 2009-2012, Intel Corporation
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6 
7     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9     * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10 
11 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12 */
13 // written by Roman Dementiev
14 //
15 
16 #include "cpucounters.h"
17 #include <iostream>
18 #include <algorithm>
19 #include <list>
20 #include <vector>
21 #include <sys/time.h>
22 
23 using std::cout;
24 
my_timestamp()25 inline double my_timestamp()
26 {
27     struct timeval tp;
28     gettimeofday(&tp, NULL);
29     return double(tp.tv_sec) + tp.tv_usec / 1000000.;
30 }
31 
32 struct T
33 {
34     int key[1] = { 0 };
35     int data[15] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
36 
TT37     T() { }
TT38     T(int a) { key[0] = a; }
39 
operator ==T40     bool operator == (const T & k) const
41     {
42         return k.key[0] == key[0];
43     }
44 };
45 
46 template <class DS>
Memory_intensive_task(DS & ds)47 void Memory_intensive_task(DS & ds)
48 {
49     // cppcheck-suppress ignoredReturnValue
50     std::find(ds.begin(), ds.end(), ds.size());
51 }
52 
53 
main(int argc,char * argv[])54 int main(int argc, char * argv[])
55 {
56     std::vector<T> vector;
57     int nelements = 13000000;
58 
59     int i = 0;
60     int delay = atoi(argv[1]);
61 
62     cout << "Elements data size: " << sizeof(T) * nelements / 1024 << " KB\n";
63 
64     for ( ; i < nelements; ++i)
65     {
66         vector.push_back(i);
67     }
68 
69     double before_ts, after_ts;
70 
71 
72     while (1)
73     {
74         before_ts = my_timestamp();
75         cout << "Reading memory for " << delay << " seconds\n" << flush;
76         do
77         {
78             Memory_intensive_task(vector);
79             after_ts = my_timestamp();
80         } while ((after_ts - before_ts) < delay);
81 
82 
83         cout << "Sleeping for " << delay << " seconds\n" << flush;
84         sleep(delay);
85     }
86 
87 
88     return 0;
89 }
90 

readmem.sh

1
2
3numactl --cpunodebind=0 --membind=0 ./readmem 10 &
4numactl --cpunodebind=1 --membind=1 ./readmem 10 &
5numactl --cpunodebind=0 --membind=0 ./readmem 10 &
6numactl --cpunodebind=1 --membind=1 ./readmem 10 &
7numactl --cpunodebind=0 --membind=0 ./readmem 10 &
8numactl --cpunodebind=1 --membind=1 ./readmem 10 &
9numactl --cpunodebind=0 --membind=0 ./readmem 10 &
10numactl --cpunodebind=1 --membind=1 ./readmem 10 &
11numactl --cpunodebind=0 --membind=0 ./readmem 10 &
12numactl --cpunodebind=1 --membind=1 ./readmem 10 &
13numactl --cpunodebind=0 --membind=0 ./readmem 10 &
14numactl --cpunodebind=1 --membind=1 ./readmem 10 &
15
16