Skip to content
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

Memory info should be more detail ? #12

Open
Haraguroicha opened this issue Mar 15, 2019 · 3 comments
Open

Memory info should be more detail ? #12

Haraguroicha opened this issue Mar 15, 2019 · 3 comments

Comments

@Haraguroicha
Copy link
Contributor

Following this below of code block, there only accept/get first BANK information into memory structure (each DMI type 17 record is describe for a single BANK), but there may be use different type of memory model on server memory (e.g. different of clock speed or Bank Locator), there are not always used same memory information

Is there can add a detailed information into Memory structure or add as Memory.Details ?

e.g.:

{
  "memory": {
    "detailed": [
      {
        "bank": 0,
        "size": 8192,
        "speed": 2133,
        "type": "LPDDR3",
        "voltage": 1.2
      }, {
        "bank": 2,
        "size": 4096,
        "speed": 1866,
        "type": "LPDDR3",
        "voltage": 1.2
      }, {
        "bank": 3,
        "size": 4096,
        "speed": 1866,
        "type": "LPDDR3",
        "voltage": 1.2
      }
    ],
    "total_size": 16384
  }
}

sysinfo/memory.go

Lines 192 to 210 in 9dc8824

if si.Memory.Type == "" {
// SMBIOS Reference Specification Version 3.0.0, page 92
memTypes := [...]string{
"Other", "Unknown", "DRAM", "EDRAM", "VRAM", "SRAM", "RAM", "ROM", "FLASH",
"EEPROM", "FEPROM", "EPROM", "CDRAM", "3DRAM", "SDRAM", "SGRAM", "RDRAM",
"DDR", "DDR2", "DDR2 FB-DIMM", "Reserved", "Reserved", "Reserved", "DDR3",
"FBD2", "DDR4", "LPDDR", "LPDDR2", "LPDDR3", "LPDDR4",
}
if index := int(mem[p+0x12]); index >= 1 && index <= len(memTypes) {
si.Memory.Type = memTypes[index-1]
}
}
if si.Memory.Speed == 0 && recLen >= 0x17 {
if speed := uint(word(mem, p+0x15)); speed != 0 {
si.Memory.Speed = speed
}
}

@zcalusic
Copy link
Owner

Hello @Haraguroicha,

I wasn't even aware that you could have memory banks with different parameters like type, speed, frequency etc... At least, I haven't seen it in the wild, so far.

I do care a lot about simplicity of this library, and compatibility with previous versions. But... I would accept a PR on the topic. I'd also like to hear what other users of the library think?

If you expect me to code it, I must admit it could take a while... quite busy with other stuff...

@chendh521
Copy link

yes, I also hope the memory info could be more detail.

@Haraguroicha
Copy link
Contributor Author

I pushed a PR as #14

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

No branches or pull requests

3 participants