Skip to content

Conversation

@harp-intel
Copy link
Contributor

@harp-intel harp-intel commented Dec 2, 2025

This pull request introduces several improvements and new features to the configuration workflow for the perfspect tool, 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

  • Added support for recording the current configuration to a human-readable file using the --record flag, and restoring configuration from a file with the new config restore subcommand. This is documented in README.md and integrated into the CLI workflow. [1] [2] [3] [4] [5] [6]
  • The restore command can also target remote systems using the --target or --targets flags.

Codebase Refactoring & API Changes

  • Refactored the flag set function signatures (IntSetFunc, FloatSetFunc, etc.) to be synchronous and return errors directly, removing the need for goroutines and channels in flag setting logic. [1] [2]
  • Split the configuration reporting logic into separate functions: getConfig, processConfig, and printConfig, improving modularity and testability. [1] [2] [3]

Flag and Command Improvements

  • Added new flags for SSE frequency configuration: core-max was renamed to core-max (SSE frequency), and a new core-max-buckets flag was introduced for specifying frequencies for core buckets. Validation for these flags was improved using regex. [1] [2]
  • Added the --record flag to the configuration command, allowing users to save the current configuration. [1] [2]

Dependency Updates

  • Updated the Go base image in the Docker build from golang:1.25.4 to golang:1.25.5 for improved security and compatibility.

Internal Imports and Utilities

  • Added import of the new util package for directory creation and other utilities.

Let me know if you have any questions about how these changes affect usage or the code structure!

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>
@harp-intel harp-intel linked an issue Dec 2, 2025 that may be closed by this pull request
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>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel requested a review from Copilot December 3, 2025 20:48
Copy link
Contributor

Copilot AI left a 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 restore subcommand 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-buckets flag for specifying frequencies per core bucket
  • Split configuration reporting logic into modular getConfig, processConfig, and printConfig functions

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>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel marked this pull request as ready for review December 3, 2025 21:41
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel merged commit 8f235bd into main Dec 3, 2025
1 of 2 checks passed
@harp-intel harp-intel deleted the configrecordrestore branch December 3, 2025 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

save and restore system config to/from file

2 participants