Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

intel/PerTaskMemBWMonitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DISCONTINUATION OF PROJECT

This project will no longer be maintained by Intel.

Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.

Intel no longer accepts patches to this project.

If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the open source software community, please create your own fork of this project.

Contact: webadmin@linux.intel.com

Per-Task Memory Bandwidth Monitoring

The Python scripts are created to provide a way for monitoring and reporting per-task memory read/write bandwidth consumption on Linux.

Examples

  1. Monitoring memory bandwidth consumption of specfied task(s):

  2. Monitoring memory bandwidth consumption of all tasks:

How it works

Using Linux profiling tool "perf", related PMU counters are read out from core/uncore/offcore registers and saved to log files(by bw-collect.py), then per-task memory read/write bandwidth are calculated out from the saved statistic data and printed out(by bw-report.py).

Per-task read bandwidth

Per-task read bandwidth are calculated as(MB/s):

per-task memory read BW(MB/s) = all cache line reads from offcore_rsp * 64 / measure time / 1024*1024

where bit definitions for offcore_rsp MSR can be found in Chapter 18.3.2 of Intel SDM.

Per-task write bandwidth

Since there's no direct PMU counts available so far for per-task write bandwidth, we are estimating it with the total memory write operations(UNC_M_WPA_INSERTS) and ratio of per-task/total memory write instructions retired, which translates into:

per-task write BW(MB/s) = (Per-task MEM_INST_RETIRED.ALL_STORES / total MEM_INST_RETIRED.ALL_STORES) * all UNC_M_WPQ_INSERTS * 64 / measure time / 1024*1024

Setup

Prerequisites

  • perf
  • Python2 or Python3

Python2(>=2.7) or Python3(>=3.6), and Linux profiling tool perf are needed to work with these scripts. Make sure both are installed.

Download scripts and run as root

Note that root priviledge is needed to run these scripts. To get help info:

# ./bw-report.py -h
usage: bw-report.py [-h] [-p [PID [PID ...]]] [-t TIME] [-i INTERVAL]

Report per-task memory read/write bandwidth.

optional arguments:
  -h, --help            show this help message and exit
  -p [PID [PID ...]], --pid [PID [PID ...]]
                        task PID to monitor, multi PIDs with space in between,
                        default -1 for all tasks
  -t TIME, --time TIME  measure time in seconds, 0 for infinite, default 1000s
  -i INTERVAL, --interval INTERVAL
                        refresh interval in seconds, default 5s

Supported CPUs

CPU Family Micro Architecture Family/Model Support Verified
Xeon-SP Sky Lake 06/85 YES
Xeon-SP Cascade Lake 06/85 YES

Verified Linux Release

About

No description or website provided.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages