History log of /openbmc/phosphor-post-code-manager/src/post_code.cpp (Results 1 – 17 of 17)
Revision Date Author Comments
# 9c2e871d 16-Aug-2024 Patrick Williams <patrick@stwcx.xyz>

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda forma

clang-format: re-format for clang-18

clang-format-18 isn't compatible with the clang-format-17 output, so we
need to reformat the code with the latest version. The way clang-18
handles lambda formatting also changed, so we have made changes to the
organization default style format to better handle lambda formatting.

See I5e08687e696dd240402a2780158664b7113def0e for updated style.
See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.

Change-Id: I23c72085a3819d1036e1b926ed47ef80dfde924c
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 2d74ceb6 05-Dec-2023 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: avoid deprecated phosphor::Timer

sdbusplus had an older type named `phosphor::Timer` which was
recently renamed to `sdbusplus::Timer`. Update the code to use
the new type alias.

Change-

sdbusplus: avoid deprecated phosphor::Timer

sdbusplus had an older type named `phosphor::Timer` which was
recently renamed to `sdbusplus::Timer`. Update the code to use
the new type alias.

Change-Id: I9a57a056eb7bb38a851f835d573c4271c4a69a0d
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# a4c19b00 28-Feb-2023 Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>

Support OCP debug card postcode display

Description:
- Meson option postcode display path is supported
- Support OCP debug card postcode display

Example of test process:
1. Set postcode-displa

Support OCP debug card postcode display

Description:
- Meson option postcode display path is supported
- Support OCP debug card postcode display

Example of test process:
1. Set postcode-display-path as /sys/bus/i2c/devices/12-
000f/postcode-display-slot in project layer
2. Press OCP debug card uart button to the host to check
3. Host power on
4. The postcode should start displaying on the OCP debug card screen
with user-readable string representation for those codes
Note:
- The postcode-display-path was setting by CLD driver, which
will though CPLD setting ocp-debug card
(link: https://lore.kernel.org/lkml/20230117094425.19004-1-Delphine_CC_Chiu@Wiwynn.com/)

Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Change-Id: I915c0ec29d763b8933835a9fdc8881648ca95d24

show more ...


# 13cb8537 15-Dec-2022 Bonnie Lo <Bonnie_Lo@wiwynn.com>

Add one second timer to save POST codes to file

A lot of POST codes are sent to BMC from BIC
in a short time.

In BMC, there is an ipmi handler to get POST codes
and upload to dbus property.

The xy

Add one second timer to save POST codes to file

A lot of POST codes are sent to BMC from BIC
in a short time.

In BMC, there is an ipmi handler to get POST codes
and upload to dbus property.

The xyz.openbmc_project.State.Boot@.PostCode service
listens the PropertiesChanged signal and saves to POST
codes history file.

The xyz.openbmc_project.State.Boot@.PostCode service
is hanged if there are too many POST codes in a short time.

At this time, the memory usage of dbus-broker increases,
and the out-of-memory(OOM) issue happens.

The processes are killed when OOM happens,
and BMC may reset unexpected.

Test Case:
Check the frequency for post code file getting larger

Signed-off-by: Bonnie Lo <Bonnie_Lo@wiwynn.com>
Change-Id: Ic5a397cfa7f053e196cc3d0eeae3e2b2fa5089b7

show more ...


# 8290e0f3 23-Nov-2022 Jonathan Doman <jonathan.doman@intel.com>

Use binary serialization instead of JSON

The binary format is much more efficient than JSON in terms of
computational speed and disk space consumption. The former is important
in case the host is se

Use binary serialization instead of JSON

The binary format is much more efficient than JSON in terms of
computational speed and disk space consumption. The former is important
in case the host is sending a constant stream of POST codes.
post-code-manager can fall behind because it takes too long to store
each new POST code on disk, causing D-Bus messages to pile up and
increase memory consumption inside dbus-broker.

Tested:
Rebooted the host a few times and observed that POST code history is
populated normally in Redfish. After upgrading to this change, old POST
code history stored in JSON format is lost, but remains on disk until it
gets overwritten during subsequent host boots.

Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
Change-Id: Id55909a55d950e6e62b78b3333df687b4c582c42

show more ...


# c7fed5ca 23-Nov-2022 Jonathan Doman <jonathan.doman@intel.com>

Refactor singleton and filesystem path handling

- Remove singleton PostCodeDataHolder. It only contained a single int
which could easily be held inside the main PostCode class instead.
- Simplify

Refactor singleton and filesystem path handling

- Remove singleton PostCodeDataHolder. It only contained a single int
which could easily be held inside the main PostCode class instead.
- Simplify D-Bus match construction by using predefined
PropertiesChanged rule.
- Remove unnecessary PostCode members which were just copies of const
strings.
- Refactor some filesystem path construction/handling to simplify code.

Tested:
Rebooted host a few times and observed that correct POST code history is
still populated in Redfish.

Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
Change-Id: Ifd61751807da704eaf2a64dac34ca708fd28c872

show more ...


# c1819379 27-Oct-2022 Bonnie Lo <Bonnie_Lo@wiwynn.com>

Max post code file size per cycle setting

Let user could set POST code file size per cycle

The default size is 512 counts

Reason:
BMC may crash caused by nonstop saving POST code when BIOS has
som

Max post code file size per cycle setting

Let user could set POST code file size per cycle

The default size is 512 counts

Reason:
BMC may crash caused by nonstop saving POST code when BIOS has
some unusual behavior like PXE loop
Thus, BMC should set a limit size to prevent this risk

Test Case:
Manually send POST code to check the POST code file rotation

Signed-off-by: Bonnie Lo <Bonnie_Lo@wiwynn.com>
Change-Id: Ic7fbafe532a79123e6ae880a8a3506f9c397d933

show more ...


# bd706d79 20-Dec-2021 Manojkiran Eda <manojkiran.eda@gmail.com>

Switch to a thread safe single ton

In the current state the single ton pattern used in the
repository is not thread safe.

Switching the pattern to Meyer's single ton over the trusty
leaky single to

Switch to a thread safe single ton

In the current state the single ton pattern used in the
repository is not thread safe.

Switching the pattern to Meyer's single ton over the trusty
leaky single ton.

Ref : https://jinyu.li/notes/meyers-singleton/

Tested By :
1. Patched post-code-manager deamon & was able to get the post
codes with the GetPostCodesWithTimeStamp method.

Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I0ee5c21f15fc93e1d8c5e62a0fed33622a33c894

show more ...


# f5e52db7 22-Dec-2021 Alan Kuo <Alan_Kuo@quantatw.com>

Fix 'usTimeOffset' was not declared error

When enable 'bios-post-code-log' feature will cause 'usTimeOffset'
was not declared error, therefore changing the scope of 'usTimeOffset'
va

Fix 'usTimeOffset' was not declared error

When enable 'bios-post-code-log' feature will cause 'usTimeOffset'
was not declared error, therefore changing the scope of 'usTimeOffset'
variable.

Tested:
- Tested build OK.
- Check /var/log/redfish OK.
1970-01-01T00:02:38.626333+00:00 OpenBMC.0.1.BIOSPOSTCode,2,0.0000,0x01
1970-01-01T00:02:38.656143+00:00 OpenBMC.0.1.BIOSPOSTCode,2,0.0183,0x02
1970-01-01T00:02:38.664210+00:00 OpenBMC.0.1.BIOSPOSTCode,2,0.0420,0x02

Signed-off-by: Alan Kuo <Alan_Kuo@quantatw.com>
Change-Id: I1d35777e47d507c2bba5b6b6afa72ca70cb23155

show more ...


# de8d3a53 05-Dec-2021 Manojkiran Eda <manojkiran.eda@gmail.com>

Fix static analysis & cppcheck issues

This commit fixes:
1. warning: Value stored to 'event' is never read [deadcode.DeadStores]
2. style: Consider using std::transform algorithm ins

Fix static analysis & cppcheck issues

This commit fixes:
1. warning: Value stored to 'event' is never read [deadcode.DeadStores]
2. style: Consider using std::transform algorithm instead of a raw loop. [useStlAlgorithm]
3. style: Variable 'usTimeOffset' is assigned a value that is never used. [unreadVariable]

Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: Ia0c8235195aa7eceda8bd8f36cd11fcb72781d1b

show more ...


# 7cc8ea63 06-Oct-2021 Patrick Williams <patrick@stwcx.xyz>

catch exceptions as const

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I2dc48774ef73fcfbe9287196086f829a6948320d


# b84fea4e 03-Jun-2021 Ravi Teja <raviteja28031990@gmail.com>

Fix DeleteAll to set boot count 0

Currently DeleteAll sets boot count 1 after
DeleteAll next boot shows as boot count 2
and GetPostCodesWithTimeStamp does not show
progress codes

Fix DeleteAll to set boot count 0

Currently DeleteAll sets boot count 1 after
DeleteAll next boot shows as boot count 2
and GetPostCodesWithTimeStamp does not show
progress codes for boot count 2 and it continues

This commit fixes this issue.

Tested results:

After DeleteAll:
busctl call xyz.openbmc_project.State.Boot.PostCode0 /xyz/openbmc_project/State/Boot/PostCode0 org.freedesktop.DBus.Properties Get ss xyz.openbmc_project.State.Boot.PostCode CurrentBootCycleCount
v q 0

First Boot after DeleteAll:
busctl call xyz.openbmc_project.State.Boot.PostCode0 /xyz/openbmc_project/State/Boot/PostCode0 org.freedesktop.DBus.Properties Get ss xyz.openbmc_project.State.Boot.PostCode CurrentBootCycleCount
v q 1

busctl call xyz.openbmc_project.State.Boot.PostCode0 /xyz/openbmc_project/State/Boot/PostCode0 xyz.openbmc_project.State.Boot.PostCode GetPostCodesWithTimeStamp q 1
a{t(tay)} 41 1622776305892427 3472328313407551299 72 2 0 0 9 0 0 0 72 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 251 30 215 0 0 0 0 0 0 0 0 67 55 48 48 52 48 48 48 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 1622776307055818 3472328313407551299 72 2 0 0 9 0 0 0 72 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 251 14 215 0 0 0 0 0 0 0 0 67 55 48 48 52 48 48 48 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32

Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
Change-Id: Icc4d40fe6fb110f25e1883557acb2d6dfa4b804b

show more ...


# 0171dd6b 14-Apr-2021 Alan Kuo <Alan_Kuo@quantatw.com>

Add the BIOSPostCode events into the BMCWeb EventService

- Add BIOSPostCode events to the bmcweb redfish event log, so that
users can collect BIOSPOSTCode events through redfish EventS

Add the BIOSPostCode events into the BMCWeb EventService

- Add BIOSPostCode events to the bmcweb redfish event log, so that
users can collect BIOSPOSTCode events through redfish EventService.
Refer to:
https://github.com/openbmc/docs/blob/master/architecture/redfish-logging-in-bmcweb.md
- Add CMake option to trun on/off the log of post code.
The default setting is off.

Tested:
- Tested build OK.
- Check /var/log/redfish OK.
1970-01-01T00:05:06.042545+00:00 OpenBMC.0.1.BIOSPOSTCode,1,267.5030,0x15
1970-01-01T00:05:06.182087+00:00 OpenBMC.0.1.BIOSPOSTCode,1,267.5813,0x7f
1970-01-01T00:05:06.276475+00:00 OpenBMC.0.1.BIOSPOSTCode,1,267.7245,0x00

Signed-off-by: Alan Kuo <Alan_Kuo@quantatw.com>
Change-Id: Ieff2acd81ee6fbd74ad8005680499e6753860037

show more ...


# 84a4c19c 25-Feb-2021 Manojkiran Eda <manojkiran.eda@gmail.com>

Add logic for supporting the secondary post codes

- The intent behind this commit to fix up the post code manager
to support the secondary post codes as well.

- This commit ne

Add logic for supporting the secondary post codes

- The intent behind this commit to fix up the post code manager
to support the secondary post codes as well.

- This commit needs the PDI Change from:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/40927
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/40903

Tested By :
===========
1. Patched the library generated by the PDI change.
2. Compile the post code manager with this commit.
3. PATCH it on a live system to check if the post codes stored
in the file system has both the primary & secondary codes

Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I8b36cc3a908bb94467b12a5b41ffb156789795a8

show more ...


# fd45f788 01-Sep-2020 Kumar Thangavel <thangavel.k@hcl.com>

phosphor-post-code-manager: Add post code support for multi host

Added implementation to handle post codes from multiple host to BMC with
multi process approach. Each process handles pos

phosphor-post-code-manager: Add post code support for multi host

Added implementation to handle post codes from multiple host to BMC with
multi process approach. Each process handles post codes for corresponding host.

TESTED : Built the openbmc image targetting Facebook YosemiteV2 hardware.
Verified all the host's postcodes stored in corresponding host directories.

Signed-off-by: Kumar Thangavel <thangavel.k@hcl.com>
Change-Id: I29d55558ed165d9e4494f017e13808dff6252b04

show more ...


# 993d4dd9 29-Jan-2020 ZhikuiRen <zhikui.ren@intel.com>

Add timestamp to BIOS POST Codes log and DeleteAll interface

Added GetPostCodesWithTimeStamp methods to PostCode interface.
GetPostCodesWithTimeStamp logs timestamp in microseconds since

Add timestamp to BIOS POST Codes log and DeleteAll interface

Added GetPostCodesWithTimeStamp methods to PostCode interface.
GetPostCodesWithTimeStamp logs timestamp in microseconds since epoch
together with each post code.

Added DeleteAll method to remove existing logs and
reset currentBootCycleIndex to 1.

Tested:
Build with changes in phosphor-dbus-interfaces.
Invoked GetPostCodesWithTimeStamp with busctl and observed expected format:
("US since Epoch":, Post Code)
"1580923291420015": 1,
"1580923291428076": 2,

Invoke DeleteAll and verify GetPostCodes returns no code afterwards,
and CurrentBootiCycleCount is reset to 1.

Cycled host power more than 100 times and observed that CurrentBootCycleCount
increments until it reached MaxBootCycleNum.

Verified GetPostCodes and GetPostCodesWithTimeStamp respond correctly with
index 1 being the most recent boot cycle, CurrentBootCycleCount being
the oldest boot cycle.

Change-Id: I4f222fce0eba38c65f468d8bd186079e0883da6e
Signed-off-by: ZhikuiRen <zhikui.ren@intel.com>

show more ...


# 3a044400 19-Feb-2019 Kuiying Wang <kuiying.wang@intel.com>

Implement post code manager

This depends on interfaces definition:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/20474

Implement method and properties

Implement post code manager

This depends on interfaces definition:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-dbus-interfaces/+/20474

Implement method and properties defined in PostCode.interface.yaml
under phosphor-dbus-interfaces/xyz/openbmc_project/State/Boot
1. Method: std::vector<uint64_t> PostCode::getPostCodes(uint16_t index)
2. Properties: CurrentBootCycleIndex/MaxBootCycleNum

Test-By:
Every cycle post codes is saved in "/var/lib/phosphor-post-code-manager"
"1" file is saved all post codes for cycle 1
"2" file is saved all post codes for cycle 2
"CurrentBootCycleIndex" file is saved the current boot cycle number.
root@wolfpass:/var/lib/phosphor-post-code-manager# ls
1 2 CurrentBootCycleIndex

Change-Id: Ia89b9121983261fef5573092d890beb84626ceeb
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>

show more ...