ibm-openbmc / dev

Product Development Project Mgmt and Tracking
16 stars 2 forks source link

Add BMC uptime to PELs in UserData section #3601

Closed spinler closed 1 year ago

spinler commented 2 years ago

There is a UserData section we add to each PEL with extra debug information, like:

"User Data 0": {
    "Section Version": "1",
    "Sub-section type": "1",
    "Created by": "0x2000",
    "BMCState": "Ready",
    "BootState": "OSRunning",
    "ChassisState": "On",
    "FW Version ID": "fw1020.00-65-1020.2226.20220628b (NL1020_067)",
    "HostState": "Running",
    "Process Name": "/usr/bin/phosphor-fan-monitor",
    "System IM": "50001001"
},

I would like to add the output of the 'uptime' command to that.

# uptime
 16:12:15 up 11:26,  load average: 0.84, 0.92, 0.87

so:

"User Data 0": {
    "Section Version": "1",
    "Sub-section type": "1",
    "Created by": "0x2000",
    "BMCState": "Ready",
    "BootState": "OSRunning",
    "ChassisState": "On",
    "FW Version ID": "fw1020.00-65-1020.2226.20220628b (NL1020_067)",
    "HostState": "Running",
    "Process Name": "/usr/bin/phosphor-fan-monitor",
    "System IM": "50001001"
    "Uptime": " 16:12:15 up 11:26,  load average: 0.84, 0.92, 0.87"
},

I can't decide on if it would be better to save a bit of space and just print the actual uptime between the 'up' and the 'load', and then put the load average as another entry:

"Uptime": "11:26"
"Load":  "0.84, 0.92, 0.87"

but I could make a decision when the time comes.

this would go into makeSysInfoUserDataSection() in pel.cpp in the phosphor-logging repo, where a new function would be added into DataInterface to run the command and parse the output.

One thing to note is we also add this user data into Hostboot PELs in PEL::updateSysInfoInExtendedUserDataSection(). I asked them about this and they said they aren't interested in seeing this data, so we'll need to skip adding it in that case.

lxwinspur commented 1 year ago

@spinler Review by: https://gerrit.openbmc.org/c/openbmc/phosphor-logging/+/55391

lxwinspur commented 1 year ago

@spinler can we close this issue?