|
| 1 | +# Ampere System Profiler |
| 2 | + |
| 3 | +The Ampere System Profiler (ASP) is a system-level analysis profiler that can be used to look for common platform-level problems while running workloads. It also includes a visualizer in the form of Plotly graphs and tables in an HTML report. |
| 4 | +ASP can be used for workload characterization at a system level, a first step towards a balanced platform. |
| 5 | + |
| 6 | +## System pre-Requisites |
| 7 | +Required Commands |
| 8 | + - sar |
| 9 | + - sensors |
| 10 | + - route |
| 11 | + - numastat |
| 12 | + - perf |
| 13 | + - python3 |
| 14 | + |
| 15 | +YUM Packages for RHEL based systems: |
| 16 | +```shell |
| 17 | +sudo yum install lm_sensors perf sysstat numactl net-tools python3 |
| 18 | +``` |
| 19 | + |
| 20 | +APT Packages for Ubuntu or Debian: |
| 21 | +```shell |
| 22 | +sudo apt install lm-sensors sysstat numactl net-tools linux-tools-common linux-tools-$(uname -r) python3 |
| 23 | +``` |
| 24 | + |
| 25 | +Python Modules: |
| 26 | +```shell |
| 27 | +sudo python3 -m pip install plotly pandas argparse |
| 28 | +``` |
| 29 | + |
| 30 | +## Output |
| 31 | +ASP will generate a html format report under the root directory of ASP. |
| 32 | +The report includes: |
| 33 | +- CPU Utilization |
| 34 | +- Per-Core Utilization |
| 35 | +- CPU Power |
| 36 | +- CPU Frequencies |
| 37 | +- Disk I/O |
| 38 | +- Network Utilization |
| 39 | +- NUMA Stats |
| 40 | +- Top CPU Hotspots |
| 41 | + |
| 42 | +## Getting Started |
| 43 | + |
| 44 | +### 1. Clone the Repository |
| 45 | + |
| 46 | +## 2. Run Setup |
| 47 | +```bash |
| 48 | +source setup.sh |
| 49 | +``` |
| 50 | + |
| 51 | +## Building the Wheel |
| 52 | +This project uses Poetry for packaging and dependency management. |
| 53 | + |
| 54 | +### Step 1: Build the Wheel |
| 55 | +```bash |
| 56 | +poetry build |
| 57 | +``` |
| 58 | +This will generate a .whl file and .tar.gz source distribution in the dist/ directory. |
| 59 | + |
| 60 | +## Installing the Package Locally |
| 61 | +After building the wheel: |
| 62 | + |
| 63 | +```bash |
| 64 | +pip install dist/system_metrics_collector-<version>-py3-none-any.whl |
| 65 | +``` |
| 66 | +Replace <version> with the actual version number shown in the wheel filename. |
| 67 | + |
| 68 | +## Usage |
| 69 | +```bash |
| 70 | +asp [OPTIONS] |
| 71 | +``` |
| 72 | + |
| 73 | +### Examples |
| 74 | + |
| 75 | +#### Output Help Message |
| 76 | +```bash |
| 77 | +asp --help |
| 78 | +``` |
| 79 | + |
| 80 | +#### Sample Commands |
| 81 | + |
| 82 | +```bash |
| 83 | +#Supported Collectors: |
| 84 | +#cpu,cpu_freq,cpu_power,io,irq_affinity,network,numastat,perf |
| 85 | + |
| 86 | +# generate 20 samples at 2 seconds interval, all collectors |
| 87 | +asp -n 20 -i 2 -N $NETWORK_INTERFACE |
| 88 | + |
| 89 | +# generate 20 samples at 1 seconds interval, only collect cpu utilization,cpu_freq and cpu_power |
| 90 | +asp -n 20 -i 1 -c cpu,cpu_freq,cpu_power |
| 91 | + |
| 92 | + |
| 93 | +# generate 20 samples at 2 seconds interval, all collectors execept perf |
| 94 | +asp -n 20 -i 2 -f |
| 95 | + |
| 96 | + |
| 97 | +# generate 20 samples at 1 seconds interval, only collect cpu utilization, cpu_freq, io, network, and perf with lower frequency rate of 99 |
| 98 | +asp -n 20 -i 1 -c cpu,cpu_freq,io,network,perf -F 99 |
| 99 | +``` |
| 100 | + |
| 101 | +## CLI Options |
| 102 | +| Option | Description | |
| 103 | +| ------------ | ---------------------------------------------------------- | |
| 104 | +| `-n INTEGER` | Number of samples to take | |
| 105 | +| `-i INTEGER` | Interval in seconds between samples | |
| 106 | +| `-o TEXT` | Output directory for collected data | |
| 107 | +| `-c TEXT` | Comma-separated list of collectors to use | |
| 108 | +| `-f` | Disable `perf` collection | |
| 109 | +| `-p` | Disable plotting of results | |
| 110 | +| `-F INTEGER` | Sampling frequency for `perf` collector (default: 4000 Hz) | |
| 111 | +| `-N TEXT` | Network interface to monitor (e.g., eth0) | |
| 112 | +| `-h, --help` | Show help message and exit | |
| 113 | + |
| 114 | +## Output |
| 115 | + - Data is stored as .dat files in the specified output directory. |
| 116 | + - If plotting is enabled, an report.html file is generated after collection. |
| 117 | + |
| 118 | +## Tested on |
| 119 | + - Ubuntu 20.04 |
| 120 | + - Ubuntu 22.04 |
| 121 | + - Ubuntu 24.04 |
| 122 | + - Ubuntu 25.04 |
| 123 | + - Fedora 40 |
| 124 | + - Fedora 41 |
| 125 | + - Fedora 42 |
| 126 | + - Debian 12 |
| 127 | + - Debian 13 |
| 128 | + - Oracle Linux 9 |
| 129 | + |
| 130 | +## FAQ |
| 131 | + - For non standard kernels, ensure perf is installed to see hotspots. |
| 132 | + - For runs on the cloud, readings from Frequency and Perf Hotspots might not show up. |
| 133 | + - Cloud runs will not show power. |
0 commit comments