more descriptive representation of installed memory in summary table #592
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors how DIMM (memory module) information is handled and accessed throughout the codebase. The main change is moving the DIMM index constants and related helper functions from
cmd/report/dimm.goto theinternal/commonpackage, making them reusable and centralizing DIMM parsing logic. All code that previously used local DIMM helpers and constants now references the shared versions ininternal/common. This improves maintainability and reduces code duplication.Key changes include:
Improvements to Summary Table Logic:
internal/common/table_defs.goto prefer DIMM information from DMI decode, falling back to/proc/meminfoonly if necessary, and updated the field name to "Memory" for clarity. [1] [2]Refactoring and Code Reuse:
BankLocatorIdx,SizeIdx, etc.) and DIMM helper functions (DimmInfoFromDmiDecode,InstalledMemoryFromOutput) fromcmd/report/dimm.gotointernal/common/table_helpers.gofor shared use across the codebase. [1] [2]Code Updates to Use Shared Helpers:
cmd/report/dimm.goto usecommon.DimmInfoFromDmiDecodeandcommon.<IndexConstant>instead of local definitions. [1] [2] [3] [4] [5] [6]cmd/report/report_tables.goandcmd/report/system.goto usecommon.InstalledMemoryFromOutputandcommon.<IndexConstant>. [1] [2] [3] [4]These changes centralize DIMM parsing logic, reduce duplication, and ensure consistency across different parts of the codebase when handling memory module information.