-
Notifications
You must be signed in to change notification settings - Fork 53
Add option to record and restore system configuration through config command #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces configuration recording and restoration capabilities to the perfspect tool, along with significant refactoring of the configuration workflow. Users can now record current system configurations to human-readable files using the --record flag and restore them later with the new config restore subcommand. The changes also include API simplifications by removing goroutines from flag-setting functions, improved SSE frequency configuration with bucketed frequency support, and updates to Go dependencies.
Key Changes
- Added
config restoresubcommand for restoring configurations from recorded files - Refactored flag set functions to be synchronous, returning errors directly instead of using goroutines and channels
- Enhanced SSE frequency configuration with new
--core-sse-freq-bucketsflag for specifying frequencies per core bucket - Split configuration reporting logic into modular
getConfig,processConfig, andprintConfigfunctions
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/build.Dockerfile | Updates Go base image version from 1.25.4 to 1.25.5 |
| builder/build.Dockerfile | Updates Go base image version and SHA256 hash to 1.25.5 |
| internal/report/table_helpers_frequency.go | New file extracting frequency-related helper functions from table_helpers.go |
| internal/report/table_helpers.go | Removes frequency helper functions (moved to separate file) |
| internal/report/table_defs.go | Updates configuration table to use new SSE frequency bucket display function |
| internal/common/targets.go | Adds logic to traverse command hierarchy for finding tempdir flag in subcommands |
| cmd/config/set_test.go | New test file for SSE frequency bucket expansion functionality |
| cmd/config/set.go | Refactors set functions to be synchronous, adds SSE frequency bucket setting support |
| cmd/config/restore_test.go | New test file for configuration restoration functionality |
| cmd/config/restore.go | New file implementing config restore subcommand |
| cmd/config/flag_groups.go | Adds new flags and updates function signatures to synchronous pattern |
| cmd/config/flag.go | Updates type definitions for synchronous set functions |
| cmd/config/config.go | Refactors configuration workflow to support recording and restoration |
| README.md | Documents new recording and restoration features |
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
This pull request introduces several improvements and new features to the configuration workflow for the
perfspecttool, especially around recording and restoring system configurations. It also refactors parts of the codebase for better maintainability and clarity, and updates dependencies. The most important changes are grouped below.New Features: Configuration Recording & Restoration
--recordflag, and restoring configuration from a file with the newconfig restoresubcommand. This is documented inREADME.mdand integrated into the CLI workflow. [1] [2] [3] [4] [5] [6]--targetor--targetsflags.Codebase Refactoring & API Changes
IntSetFunc,FloatSetFunc, etc.) to be synchronous and return errors directly, removing the need for goroutines and channels in flag setting logic. [1] [2]getConfig,processConfig, andprintConfig, improving modularity and testability. [1] [2] [3]Flag and Command Improvements
core-maxwas renamed tocore-max(SSE frequency), and a newcore-max-bucketsflag was introduced for specifying frequencies for core buckets. Validation for these flags was improved using regex. [1] [2]--recordflag to the configuration command, allowing users to save the current configuration. [1] [2]Dependency Updates
golang:1.25.4togolang:1.25.5for improved security and compatibility.Internal Imports and Utilities
utilpackage for directory creation and other utilities.Let me know if you have any questions about how these changes affect usage or the code structure!