Skip to content

Commit bf2aab1

Browse files
authored
Extract benchmark functionality into standalone command (#589)
* Extract benchmark functionality into standalone command - Create new 'benchmark' command under cmd/benchmark/ - Implement benchmark flags following telemetry command pattern: * --all (default) - run all benchmarks * --speed, --power, --temperature, --frequency, --memory, --numa, --storage - Move benchmark table definitions and processing functions to new command - Move benchmark HTML renderers to new command - Remove benchmark functionality from report command: * Remove --benchmark flag * Remove benchmark table definitions * Remove benchmark data processing functions * Clean up unused imports - Register benchmark command in root command The benchmark command now provides a cleaner separation of concerns, following the same flag pattern as the telemetry command. Usage: perfspect benchmark # Runs all benchmarks perfspect benchmark --speed --power # Runs specific benchmarks perfspect benchmark --target <ip> # Benchmark remote target * Add system summary table to benchmark command - Add --no-summary flag to optionally exclude system summary - Include Brief System Summary table by default (like telemetry command) - System summary provides quick overview of target system configuration - Follows same pattern as telemetry command for consistency The system summary table shows key system information including: - Host name, time, CPU model, microarchitecture, TDP - Sockets, cores, hyperthreading, CPUs, NUMA nodes - Scaling driver/governor, C-states, frequencies - Energy settings, memory, NIC, disk, OS, kernel * remove duplicate Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * formatting Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * Update documentation for new benchmark command - Add benchmark command to commands table in README.md - Create new Benchmark Command section with detailed descriptions - Remove benchmark subsection from Report Command documentation - Update copilot-instructions.md to include benchmark command - Document --no-summary flag for excluding system summary The benchmark command is now properly documented as a standalone command rather than a flag within the report command. * Add alias 'bench' to benchmark command Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * Extract benchmark functionality into standalone command - Create new 'benchmark' command under cmd/benchmark/ - Implement benchmark flags following telemetry command pattern: * --all (default) - run all benchmarks * --speed, --power, --temperature, --frequency, --memory, --numa, --storage - Move benchmark table definitions and processing functions to new command - Move benchmark HTML renderers to new command - Remove benchmark functionality from report command: * Remove --benchmark flag * Remove benchmark table definitions * Remove benchmark data processing functions * Clean up unused imports - Register benchmark command in root command The benchmark command now provides a cleaner separation of concerns, following the same flag pattern as the telemetry command. Usage: perfspect benchmark # Runs all benchmarks perfspect benchmark --speed --power # Runs specific benchmarks perfspect benchmark --target <ip> # Benchmark remote target * Add system summary table to benchmark command - Add --no-summary flag to optionally exclude system summary - Include Brief System Summary table by default (like telemetry command) - System summary provides quick overview of target system configuration - Follows same pattern as telemetry command for consistency The system summary table shows key system information including: - Host name, time, CPU model, microarchitecture, TDP - Sockets, cores, hyperthreading, CPUs, NUMA nodes - Scaling driver/governor, C-states, frequencies - Energy settings, memory, NIC, disk, OS, kernel * remove duplicate Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * formatting Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * Update documentation for new benchmark command - Add benchmark command to commands table in README.md - Create new Benchmark Command section with detailed descriptions - Remove benchmark subsection from Report Command documentation - Update copilot-instructions.md to include benchmark command - Document --no-summary flag for excluding system summary The benchmark command is now properly documented as a standalone command rather than a flag within the report command. * Add alias 'bench' to benchmark command Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * Update storage command description to reflect new I/O patterns and disk space requirements Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * ref data Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * Filter out anomalous high power and temperature readings in turbostat output parsing Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * Extract benchmark functionality into standalone command - Create new 'benchmark' command under cmd/benchmark/ - Implement benchmark flags following telemetry command pattern: * --all (default) - run all benchmarks * --speed, --power, --temperature, --frequency, --memory, --numa, --storage - Move benchmark table definitions and processing functions to new command - Move benchmark HTML renderers to new command - Remove benchmark functionality from report command: * Remove --benchmark flag * Remove benchmark table definitions * Remove benchmark data processing functions * Clean up unused imports - Register benchmark command in root command The benchmark command now provides a cleaner separation of concerns, following the same flag pattern as the telemetry command. Usage: perfspect benchmark # Runs all benchmarks perfspect benchmark --speed --power # Runs specific benchmarks perfspect benchmark --target <ip> # Benchmark remote target * Add system summary table to benchmark command - Add --no-summary flag to optionally exclude system summary - Include Brief System Summary table by default (like telemetry command) - System summary provides quick overview of target system configuration - Follows same pattern as telemetry command for consistency The system summary table shows key system information including: - Host name, time, CPU model, microarchitecture, TDP - Sockets, cores, hyperthreading, CPUs, NUMA nodes - Scaling driver/governor, C-states, frequencies - Energy settings, memory, NIC, disk, OS, kernel * remove duplicate Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * formatting Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * Update documentation for new benchmark command - Add benchmark command to commands table in README.md - Create new Benchmark Command section with detailed descriptions - Remove benchmark subsection from Report Command documentation - Update copilot-instructions.md to include benchmark command - Document --no-summary flag for excluding system summary The benchmark command is now properly documented as a standalone command rather than a flag within the report command. * Add alias 'bench' to benchmark command Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * Update storage command description to reflect new I/O patterns and disk space requirements Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * ref data Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> * Filter out anomalous high power and temperature readings in turbostat output parsing Signed-off-by: Harper, Jason M <jason.m.harper@intel.com> --------- Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
1 parent 7d153ae commit bf2aab1

File tree

10 files changed

+907
-687
lines changed

10 files changed

+907
-687
lines changed

.github/copilot-instructions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
PerfSpect is a performance analysis tool for Linux systems written in Go. It provides several commands:
66
- `metrics`: Collects CPU performance metrics using hardware performance counters
7-
- `report`: Generates system configuration and health (performance) from collected data
7+
- `report`: Generates system configuration and health reports from collected data
8+
- `benchmark`: Runs performance micro-benchmarks to evaluate system health
89
- `telemetry`: Gathers system telemetry data
910
- `flamegraph`: Creates CPU flamegraphs
1011
- `lock`: Analyzes lock contention

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Usage:
2626
| ------- | ----------- |
2727
| [`metrics`](#metrics-command) | CPU core and uncore metrics |
2828
| [`report`](#report-command) | System configuration and health |
29+
| [`benchmark`](#benchmark-command) | Performance benchmarks |
2930
| [`telemetry`](#telemetry-command) | System telemetry |
3031
| [`flamegraph`](#flamegraph-command) | Software call-stacks as flamegraphs |
3132
| [`lock`](#lock-command) | Software hot spot, cache-to-cache and lock contention |
@@ -87,22 +88,31 @@ Vendor: Intel Corporation
8788
Version: EGSDCRB1.SYS.1752.P05.2401050248
8889
Release Date: 01/05/2024
8990
</pre>
90-
##### Report Benchmarks
91-
To assist in evaluating the health of target systems, the `report` command can run a series of micro-benchmarks by applying the `--benchmark` flag, for example, `perfspect report --benchmark all` The benchmark results will be reported along with the target's configuration details.
91+
92+
#### Benchmark Command
93+
The `benchmark` command runs performance micro-benchmarks to evaluate system health and performance characteristics. All benchmarks are run by default unless specific benchmarks are selected. A brief system summary is included in the output by default.
9294

9395
> [!IMPORTANT]
9496
> Benchmarks should be run on idle systems to ensure accurate measurements and to avoid interfering with active workloads.
9597
96-
| benchmark | Description |
98+
**Examples:**
99+
<pre>
100+
$ ./perfspect benchmark # Run all benchmarks with system summary
101+
$ ./perfspect benchmark --speed --power # Run specific benchmarks
102+
$ ./perfspect benchmark --no-summary # Exclude system summary from output
103+
</pre>
104+
105+
See `perfspect benchmark -h` for all options.
106+
107+
| Benchmark | Description |
97108
| --------- | ----------- |
98-
| all | runs all benchmarks |
99109
| speed | runs each [stress-ng](https://github.com/ColinIanKing/stress-ng) cpu-method for 1s each, reports the geo-metric mean of all results. |
100110
| power | runs stress-ng to load all cpus to 100% for 60s. Uses [turbostat](https://github.com/torvalds/linux/tree/master/tools/power/x86/turbostat) to measure power. |
101111
| temperature | runs the same micro benchmark as 'power', but extracts maximum temperature from turbostat output. |
102112
| frequency | runs [avx-turbo](https://github.com/travisdowns/avx-turbo) to measure scalar and AVX frequencies across processor's cores. **Note:** Runtime increases with core count. |
103113
| memory | runs [Intel(r) Memory Latency Checker](https://www.intel.com/content/www/us/en/download/736633/intel-memory-latency-checker-intel-mlc.html) (MLC) to measure memory bandwidth and latency across a load range. **Note: MLC is not included with PerfSpect.** It can be downloaded from [here](https://www.intel.com/content/www/us/en/download/736633/intel-memory-latency-checker-intel-mlc.html). Once downloaded, extract the Linux executable and place it in the perfspect/tools/x86_64 directory. |
104114
| numa | runs Intel(r) Memory Latency Checker(MLC) to measure bandwidth between NUMA nodes. See Note above about downloading MLC. |
105-
| storage | runs [fio](https://github.com/axboe/fio) for 2 minutes in read/write mode with a single worker to measure single-thread read and write bandwidth. Use the --storage-dir flag to override the default location. Minimum 5GB disk space required to run test. |
115+
| storage | runs [fio](https://github.com/axboe/fio) for 2 minutes across multiple I/O patterns to measure storage latency, IOPs, and bandwidth. Use --storage-dir to override the default location (/tmp). Minimum 32GB disk space required. |
106116

107117
#### Telemetry Command
108118
The `telemetry` command reports CPU utilization, instruction mix, disk stats, network stats, and more on the specified target(s). All telemetry types are collected by default. To choose telemetry types, see the additional command line options (`perfspect telemetry -h`).

0 commit comments

Comments
 (0)