History log of /openbmc/phosphor-power/utility.cpp (Results 1 – 21 of 21)
Revision Date Author Comments
# f5402197 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: I7b90380845efee6bf6a1fe342a793d71aa9ff181
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 8270b7d1 26-Jun-2023 Shawn McCarney <shawnmm@us.ibm.com>

Support multiple D-Bus interfaces in getSubTree()

The utility function getSubTree() only allows a single D-Bus interface
to be specified.

This does not match the corresponding GetSubTree D-Bus meth

Support multiple D-Bus interfaces in getSubTree()

The utility function getSubTree() only allows a single D-Bus interface
to be specified.

This does not match the corresponding GetSubTree D-Bus method, which
allows multiple D-Bus interfaces to be specified.

Add a getSubTree() overload that accepts multiple D-Bus interfaces.

Tested:
* Existing getSubTree() function
* Test where it is successful
* Test where it fails due to a D-Bus error
* New getSubTree() function
* Test where zero interfaces are specified
* Test where one interface is specified
* Test where multiple interfaces are specified
* Test where it is successful
* Test where it fails due to a D-Bus error

Change-Id: I56e124c13bec633f7a3af80ff6d5b2014454bfb8
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...


# 48781aef 10-May-2023 Patrick Williams <patrick@stwcx.xyz>

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest

clang-format: copy latest and re-format

clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.

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

show more ...


# 06594229 01-May-2023 Matt Spinler <spinler@us.ibm.com>

psu-ng: Fix chassis association call

The association name from a power supply to its chassis changed from
'chassis' to 'powering', so change that in the code.

Also update the code to find the assoc

psu-ng: Fix chassis association call

The association name from a power supply to its chassis changed from
'chassis' to 'powering', so change that in the code.

Also update the code to find the association using the new
GetAssociatedSubTreePaths mapper method which is like the existing
GetSubTreePaths but also ensures the results are an endpoint of the
passed in association path. This way if the 'powering' association is
used to show the power supply powers other things it will still work.

Change-Id: I9076a6b1502ba43a29404a191bd8bc56a9c5df45
Signed-off-by: Matt Spinler <spinler@us.ibm.com>

show more ...


# 7354ce62 22-Jul-2022 Patrick Williams <patrick@stwcx.xyz>

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are

sdbusplus: use shorter type aliases

The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t

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

show more ...


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

catch exceptions as const

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


# 4e8b335e 16-Mar-2021 Adriana Kobylak <anoo@us.ibm.com>

utility: Add Get All Properties

Add a utility function to call the D-Bus GetAll method. This will be
used to get the values of all the properties from the Supported
Configuration interface from Enti

utility: Add Get All Properties

Add a utility function to call the D-Bus GetAll method. This will be
used to get the values of all the properties from the Supported
Configuration interface from Entity Manager. Start with the variant
values for the properties in the Supported Configuration interface which
are uint64_t (count), string (type), and array of strings (models).

Make the service parameter optional since the caller may already have
the service name from another D-Bus call like getSubTree, or the caller
may decide to call getService() before the getAll function if they are
going to call getAll multiple times and the service name can be reused.
If the service name is not passed, the new getAll will call getService().

Tested: Verified that calling the new function worked as expected
calling it with and without a service name.

Change-Id: I4d679f0e5d28248d38050b6aed44d4ea86b83c59
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>

show more ...


# c761b5fc 05-Nov-2020 Brandon Wyman <bjwyman@gmail.com>

Add a phosphor::power::util getSubTree helper

Adding a helper function to do the GetSubTree method call on the object
mapper.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: Iaac9723d6e

Add a phosphor::power::util getSubTree helper

Adding a helper function to do the GetSubTree method call on the object
mapper.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: Iaac9723d6e1086b873ad6b260daf46a8cfa875c3

show more ...


# 6a3fd2c2 25-Aug-2020 Jay Meyer <jaymeyer@us.ibm.com>

Enhance PSU tracing support - add device access info

Move file names for file errors to the journal message. Enhance usablility.

Logging messages for file errors contain the file names inside struc

Enhance PSU tracing support - add device access info

Move file names for file errors to the journal message. Enhance usablility.

Logging messages for file errors contain the file names inside structured
entries rather than directly in the log message. This makes viewing errors
more difficult than need be. Before this change, the journal report needed to
be run with '-o verbose' to see the file names.

Tested: Ran unit tests. All successful
Tested:
* Changes to phosphor-power-supply/main.cpp were tested by running with the
.json configuration file missing in either and both default locations.
* Change to loadJSONFromFile() in utility.cpp for an invalid file was tested by
giving invalid "psu_config.json" file to main program.
* Empty file message was tested by changing main() to allow loadJSONFromFile()
to be called it when the file did not exist.
* Changes to other files were tested by running phosphor-power initialization
and manipulating the code to force execution of various error paths.
* Methods that are changed but were not directly called by phosphor-power
initialization:
PMBus::readBit(), PMBus::readBinary() and PMBus::write().
The changed log messages in these were tested by adding calls to them from
PMBus::read() and then changing code to force execution through paths that
created the log messages.

Signed-off-by: Jay Meyer <jaymeyer@us.ibm.com>
Change-Id: I1f0c01716495ac7022d5234e9a8dfdab8195c186

show more ...


# d262440d 03-Feb-2020 Matthew Barth <msbarth@us.ibm.com>

util: Logging error on getService optional

Make logging an error on service name lookup for a given path/interface
optional for the case where a service may not be available yet. This is
to handle t

util: Logging error on getService optional

Make logging an error on service name lookup for a given path/interface
optional for the case where a service may not be available yet. This is
to handle the case where a service dependent on a property from another
may be started in parallel by systemd where the property would need to
be retrieved by other means (i.e. interfacesAdded signal).

Tested:
No change to current users of getService util function
No error logged when service not found

Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Change-Id: Ib570b83fe2feae07031fa477f468327a7b0554b0

show more ...


# e8c9cd64 04-Nov-2019 Lei YU <mine260309@gmail.com>

power-utils: Implement isReadyToUpdate

Check other PSUs' status word and status vout, return false when the
status has input/output fault.

Tested: Verify on Witherspoon that the update is not start

power-utils: Implement isReadyToUpdate

Check other PSUs' status word and status vout, return false when the
status has input/output fault.

Tested: Verify on Witherspoon that the update is not started and log
Unable to update PSU when other PSU has input/ouput fault
when the other PSU has input/output error;
And the update continues when the other PSU has no errors.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Ia2a4a23a43c18a417b8a85fbd5339f487984e689

show more ...


# cfc040c7 29-Oct-2019 Lei YU <mine260309@gmail.com>

Refactor: Move isPoweredOn to utility

The check of power on will be used by other components, so move it to
utility.
There are several constexpr definitions are used by multiple components,
move the

Refactor: Move isPoweredOn to utility

The check of power on will be used by other components, so move it to
utility.
There are several constexpr definitions are used by multiple components,
move them into types.hpp so that we do not have duplicated constexprs.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I42ad142d6e7ae8da9c0cf6d8f5cb21dee229eba2

show more ...


# 4070546e 09-Oct-2019 Lei YU <mine260309@gmail.com>

Refactor: move get pmbus access type to utility

The function to get the pmbus access type is common, move it to utility.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I26e7da044c88c1efba1

Refactor: move get pmbus access type to utility

The function to get the pmbus access type is common, move it to utility.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I26e7da044c88c1efba141349ee4c18b24cdef81f

show more ...


# ab093328 09-Oct-2019 Lei YU <mine260309@gmail.com>

Refactor: rename namespace witherspoon to phosphor

This repo now becomes phosphor-power, rename namespace witherspoon to
phosphor to make it generic.

Signed-off-by: Lei YU <mine260309@gmail.com>
Ch

Refactor: rename namespace witherspoon to phosphor

This repo now becomes phosphor-power, rename namespace witherspoon to
phosphor to make it generic.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Icb9f8a7c33065add99f2bf42ed55745a28fa0424

show more ...


# 7dc31bb1 29-Aug-2019 Lei YU <mine260309@gmail.com>

Add loadJSONFromFile() in utility

It provides a util function to load json from a file.

Tested: Manually verify the function works.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I4dc9466

Add loadJSONFromFile() in utility

It provides a util function to load json from a file.

Tested: Manually verify the function works.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I4dc946663e0ce1bf511de90b27b7aa425a338543

show more ...


# d3e4dad3 25-Oct-2018 Matt Spinler <spinler@us.ibm.com>

Remove unused is_method_error calls

According to
https://lists.ozlabs.org/pipermail/openbmc/2018-October/013696.html,
message::is_method_error() will never fail and it doesn't need to
be called anym

Remove unused is_method_error calls

According to
https://lists.ozlabs.org/pipermail/openbmc/2018-October/013696.html,
message::is_method_error() will never fail and it doesn't need to
be called anymore.

Change-Id: I3199c201a3d89c90ff61484018846d9edca48eec
Signed-off-by: Matt Spinler <spinler@us.ibm.com>

show more ...


# f0f02b9a 25-Oct-2018 Matt Spinler <spinler@us.ibm.com>

Start using .clang-format

Used the one from docs/style/cpp.

Change-Id: I3bdc2b353bf18a437266b362d8205b8463a9ce2b
Signed-off-by: Matt Spinler <spinler@us.ibm.com>


# 882ce956 05-Oct-2017 Matt Spinler <spinler@us.ibm.com>

Pass error to log into shutdown function

Changing the power off utility function to take a
template parameter that specifies the error to log
before the shutdown instead of hardcoding it in
the func

Pass error to log into shutdown function

Changing the power off utility function to take a
template parameter that specifies the error to log
before the shutdown instead of hardcoding it in
the function.

Also change the 2 callers of this function to pass
in the error type.

Change-Id: Ic83d87d5000f881ed9832092be207e91adf81c0c
Signed-off-by: Matt Spinler <spinler@us.ibm.com>

show more ...


# e0eb45cc 06-Oct-2017 Brandon Wyman <bjwyman@gmail.com>

Move power errors to org.open_power.witherspoon

Move xyz.openbmc_project.Power to org.open_power.Witherspoon.
This repo is Witherspoon specific, so moving to specific tree to have
its own namespace.

Move power errors to org.open_power.witherspoon

Move xyz.openbmc_project.Power to org.open_power.Witherspoon.
This repo is Witherspoon specific, so moving to specific tree to have
its own namespace. Update generated file, and corresponding namespace
statements in the source files.

Change-Id: I10bd1eeeac5b5f391ca54bf361b249b7ad531852
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>

show more ...


# 48b4a430 04-Aug-2017 Matt Spinler <spinler@us.ibm.com>

Add powerOff utility function

Logs an error so the shutdown reason is known and then
does a hard power off.

Change-Id: I52e2d07668a777c0aacf5c269f2632fbd6f15246
Signed-off-by: Matt Spinler <spinler

Add powerOff utility function

Logs an error so the shutdown reason is known and then
does a hard power off.

Change-Id: I52e2d07668a777c0aacf5c269f2632fbd6f15246
Signed-off-by: Matt Spinler <spinler@us.ibm.com>

show more ...


# 974c916e 04-Aug-2017 Matt Spinler <spinler@us.ibm.com>

Add getProperty and getService utility functions

Upcoming code will use them.

Change-Id: I7c6618a3a7479a7ed0a7d41dad92a222a45a3ba4
Signed-off-by: Matt Spinler <spinler@us.ibm.com>