Skip to content

feature: all c-states telemetry#655

Merged
harp-intel merged 5 commits intomainfrom
cstates-telem
Mar 4, 2026
Merged

feature: all c-states telemetry#655
harp-intel merged 5 commits intomainfrom
cstates-telem

Conversation

@harp-intel
Copy link
Contributor

This pull request refactors the telemetry codebase to generalize and improve how CPU C-state residency metrics are handled. Instead of focusing solely on C6 residency, the code now supports collecting and displaying all relevant C-state metrics dynamically, making the telemetry tool more flexible and future-proof. The changes include renaming variables and functions, updating help texts, and introducing a more robust extraction mechanism for C-state fields.

The most important changes are:

Generalization of C-state telemetry:

  • Replaced all references to "C6" with "C-state" throughout the codebase, including variable and flag names, help texts, and menu labels, to reflect the broader support for multiple CPU C-states instead of just C6. [1] [2] [3] [4] [5] [6]
  • Updated the telemetry table definition to dynamically build fields for all detected C-state metrics, rather than hard-coding for C6 only. The table now adapts to whatever C-state fields are present in the data. [1] [2]

Data extraction improvements:

  • Added a new function TurbostatPlatformRowsByRegexMatch in extract/turbostat.go to extract all C-state-related fields from the turbostat output using regular expressions, enabling support for a variety of C-state metrics across different CPU platforms.

Renderer and output updates:

  • Refactored the HTML renderer function for C6 to a generalized C-state renderer, and updated axis labels to be more generic. [1] [2]
  • Updated table registration and summary output to use the new C-state telemetry table and removed the hardcoded C6 residency summary field. [1] [2] [3]

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
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 generalizes the telemetry command’s CPU idle residency reporting from a C6-only view to a dynamic “all C-states” view, by extracting C-state-related turbostat columns via regex and building telemetry fields at runtime. It also includes a sizable refactor of DIMM parsing logic and adds DIMM unit tests.

Changes:

  • Add regex-driven turbostat platform-row extraction to support dynamic C-state field discovery.
  • Replace C6 telemetry table/renderer/flag plumbing with generalized “C-States” equivalents and dynamically built table fields.
  • Refactor DIMM format detection/extraction and add extensive DIMM unit test coverage.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
internal/extract/turbostat.go Adds TurbostatPlatformRowsByRegexMatch for regex-based field extraction from platform rows.
cmd/telemetry/telemetry_tables.go Replaces C6 table values builder with dynamic C-state field discovery and table construction.
cmd/telemetry/telemetry_renderers.go Renames and generalizes the C6 HTML renderer and updates axis labeling.
cmd/telemetry/telemetry.go Renames the C6 telemetry category flag and updates table/renderer registration and summary output.
internal/extract/dimm.go Refactors DIMM format handling into an ordered dimmFormats definition and simplifies parsing/extraction.
internal/extract/dimm_test.go Adds comprehensive tests for DIMM parsing and socket/slot extraction behavior.

harp-intel and others added 2 commits March 3, 2026 19:43
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
@harp-intel harp-intel merged commit eb49859 into main Mar 4, 2026
3 checks passed
@harp-intel harp-intel deleted the cstates-telem branch March 4, 2026 04:02
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.

2 participants