f0592559 | 22-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable readability-convert-member-functions-to-static
This check finds non-static member functions that can be made static because the functions don’t use this. This check also triggers
clang-tidy: Enable readability-convert-member-functions-to-static
This check finds non-static member functions that can be made static because the functions don’t use this. This check also triggers readability-static-accessed-through -instance check as we are trying to access a static member function through an instance.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I6efe76666f75fb4f65621796466d9347cea25d01
show more ...
|
b6da7888 | 22-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable readability-string-compare check
Finds string comparisons using the compare method.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I78c904bca4724e84aa3999d9f34ed66
clang-tidy: Enable readability-string-compare check
Finds string comparisons using the compare method.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I78c904bca4724e84aa3999d9f34ed66b567af984
show more ...
|
405ea286 | 22-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable readability-const-return-type check
Checks for functions with a const-qualified return type and recommends removal of the const keyword. Such use of const is usually superfluous,
clang-tidy: Enable readability-const-return-type check
Checks for functions with a const-qualified return type and recommends removal of the const keyword. Such use of const is usually superfluous, and can prevent valuable compiler optimizations. Does not (yet) fix trailing return types.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: Ifff7541c95d7881d8c6407b20c906ec7eb13abf1
show more ...
|
4bb15d80 | 22-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable performance-faster-string-find check
Optimize calls to std::string::find() and friends when the needle passed is a single character string literal. The character literal overload
clang-tidy: Enable performance-faster-string-find check
Optimize calls to std::string::find() and friends when the needle passed is a single character string literal. The character literal overload is more efficient.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I7cfc50410d6b6c9057995df8db47084445119d7b
show more ...
|
226059b8 | 22-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
clang-tidy: Enable modernize-avoid-bind check
The check finds uses of std::bind and boost::bind and replaces them with lambdas.
Lambdas will use value-capture unless reference capture is explicitly
clang-tidy: Enable modernize-avoid-bind check
The check finds uses of std::bind and boost::bind and replaces them with lambdas.
Lambdas will use value-capture unless reference capture is explicitly requested with std::ref or boost::ref.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I4491650a46eaab1588474b26efc622e89232ef02
show more ...
|
fe476e17 | 23-Jul-2024 |
Alexander Hansen <alexander.hansen@9elements.com> |
readability: remove redundant check before iterate
There were some patterns like
if (collection.size()) { for(auto& it : collection){ //... } }
which is redundant.
Change-Id: I10c
readability: remove redundant check before iterate
There were some patterns like
if (collection.size()) { for(auto& it : collection){ //... } }
which is redundant.
Change-Id: I10c0ad1ecd0aa2e96b456dcf9c5ea4d8995ae016 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
191949c8 | 22-Jul-2024 |
George Liu <liuxiwei@ieisystem.com> |
Fix cppcheck warnings
Warning message: ``` /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unique_ptr.h:97:16: error: invalid application of 'sizeof' to an incomplete type 'phosphor
Fix cppcheck warnings
Warning message: ``` /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unique_ptr.h:97:16: error: invalid application of 'sizeof' to an incomplete type 'phosphor::led::fru::fault::monitor::Remove' 97 | static_assert(sizeof(_Tp)>0, | ^~~~~~~~~~~ /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/unique_ptr.h:404:4: note: in instantiation of member function 'std::default_delete<phosphor::led::fru::fault::monitor::Remove>::operator()' requested here 404 | get_deleter()(std::move(__ptr)); | ^ /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:88:15: note: in instantiation of member function 'std::unique_ptr<phosphor::led::fru::fault::monitor::Remove>::~unique_ptr' requested here 88 | __location->~_Tp(); | ^ /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:149:12: note: in instantiation of function template specialization 'std::destroy_at<std::unique_ptr<phosphor::led::fru::fault::monitor::Remove>>' requested here 149 | std::destroy_at(__pointer); | ^ /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:163:11: note: in instantiation of function template specialization 'std::_Destroy<std::unique_ptr<phosphor::led::fru::fault::monitor::Remove>>' requested here 163 | std::_Destroy(std::__addressof(*__first)); | ^ /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:193:35: note: in instantiation of function template specialization 'std::_Destroy_aux<false>::__destroy<std::unique_ptr<phosphor::led::fru::fault::monitor::Remove> *>' requested here 193 | return std::_Destroy_aux<false>::__destroy(__first, __last); | ^ /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:948:12: note: in instantiation of function template specialization 'std::_Destroy<std::unique_ptr<phosphor::led::fru::fault::monitor::Remove> *>' requested here 948 | std::_Destroy(__first, __last); | ^ /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:735:7: note: in instantiation of function template specialization 'std::_Destroy<std::unique_ptr<phosphor::led::fru::fault::monitor::Remove> *, std::unique_ptr<phosphor::led::fru::fault::monitor::Remove>>' requested here 735 | std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, | ^ ../../../fault-monitor/fru-fault-monitor.hpp:48:14: note: in instantiation of member function 'std::vector<std::unique_ptr<phosphor::led::fru::fault::monitor::Remove>>::~vector' requested here 48 | explicit Add(sdbusplus::bus_t& bus) : | ^ ../../../fault-monitor/fru-fault-monitor.hpp:28:7: note: forward declaration of 'phosphor::led::fru::fault::monitor::Remove' 28 | class Remove; | ^ ```
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I5c20a0031deff51e6bacccdd81310e95f14e52a0
show more ...
|
94e894cb | 17-Jun-2024 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Fix spelling mistakes using codespell
This commit corrects various spelling mistakes throughout the repository. The corrections were made automatically using `codespell`[1] tool.
[1]: https://githu
Fix spelling mistakes using codespell
This commit corrects various spelling mistakes throughout the repository. The corrections were made automatically using `codespell`[1] tool.
[1]: https://github.com/codespell-project/codespell
Change-Id: I3a5360efb5b6a71d5eabb557accf939cd6abc864 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
95b0db91 | 29-Nov-2023 |
Patrick Williams <patrick@stwcx.xyz> |
build: use allowed over enabled
Meson feature options are typically in a tri-state of enabled, disabled, or auto. The enabled and disabled functions on an option (from `get_option`) no longer retur
build: use allowed over enabled
Meson feature options are typically in a tri-state of enabled, disabled, or auto. The enabled and disabled functions on an option (from `get_option`) no longer return true for auto features. Instead, the expectation is to use `allowed()` which is true for both enabled and auto.
Switch all uses of `enabled` to `allowed`.
Change-Id: I4db060ea85cfae7be96693ec04a09829767351a1 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
1f0b715a | 17-Jul-2023 |
George Liu <liuxiwei@inspur.com> |
Use the lower camel case of the C++ standard
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ied901f0cc7cc6606e199dad0e31a35f838c32ab9 |
fcf3a9d0 | 24-May-2023 |
Priyanga Ramasamy <priyanga24@in.ibm.com> |
LED:Invalid association for fault LED group
The LED fault association group name has been changed from fault_led_group to fault_identifying as a part of this change <https://github.com/openbmc/phosp
LED:Invalid association for fault LED group
The LED fault association group name has been changed from fault_led_group to fault_identifying as a part of this change <https://github.com/openbmc/phosphor-dbus-interfaces/commit /e7c10bd5cdab6cd898e5cad0daab8c1128adc0c8>.
The current code points to the invalid group name. This commit has the fix for it.
Test:
busctl set-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/vdd_vrm1 xyz.openbmc_project.State.Decorator.OperationalStatus Functional b false
busctl set-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/ebmc_card_bmc xyz.openbmc_project.State.Decorator.OperationalStatus Functional b true
Before the fix: Error traces are found when we try to set Functional property. phosphor-fru-fault-monitor[1180]: Failed to get endpoints property, ERROR = sd_bus_call: xyz.openbmc_project.Common.Error.ResourceNotFound: The resource is not found., PATH = /xyz/openbmc_project/inventory/system/chassis/motherboard/vdd_vrm1/fault_led_group May 31 02:17:32 rain127bmc phosphor-fru-fault-monitor[1180]: The inventory D-Bus object is not associated with the LED group D-Bus object. INVENTORY_PATH = /xyz/openbmc_project/inventory/system/chassis/motherboard/vdd_vrm1
After the fix: No error traces are found and Functional property has been updated.
Change-Id: Ib42c1b496b07ca238e2ba3573064d865e4911711 Signed-off-by: Priyanga Ramasamy <priyanga24@in.ibm.com>
show more ...
|
b4c82cf4 | 03-Jan-2023 |
George Liu <liuxiwei@inspur.com> |
support sdbusplus::message::object_path
Since lg2 already supports sdbusplus::message::object_path, it needs to be updated synchronously.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id:
support sdbusplus::message::object_path
Since lg2 already supports sdbusplus::message::object_path, it needs to be updated synchronously.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I4d81fac0d0acaf069381099e541ce2ac578d632e
show more ...
|
3e073ba6 | 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: I223d58649a21565678bd7ef78d955b30d3fd6d84
show more ...
|
f2044037 | 17-Mar-2022 |
Patrick Williams <patrick@stwcx.xyz> |
switch map to unordered_map
Generally, unordered_maps should be preferred over map because they have faster access times (O(1)) and tend to allocate less dynamic memory. We do not rely on ordered i
switch map to unordered_map
Generally, unordered_maps should be preferred over map because they have faster access times (O(1)) and tend to allocate less dynamic memory. We do not rely on ordered iteration in any current use of maps, so it is safe to do a full replace.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ieaa28ac7f70f9913d13d25142fea9861d49bb23f
show more ...
|
9bd334ff | 16-Mar-2022 |
Patrick Williams <patrick@stwcx.xyz> |
fault-monitor: remove locally generated errors
Switch fault-monitor to use Common.Errors instead of locally defined ones. This greatly simplifies the build structure and follows the expected phosph
fault-monitor: remove locally generated errors
Switch fault-monitor to use Common.Errors instead of locally defined ones. This greatly simplifies the build structure and follows the expected phosphor-logging patterns better.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Idb3473989c86b3a505f3c0a238735db6f3a4349e
show more ...
|
c5e0f31c | 27-Dec-2021 |
George Liu <liuxiwei@inspur.com> |
Fix some warnings by cppcheck
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Icee0abe2e3130aa225db776efdcd47200eb38f8d |
fb56fde0 | 06-Oct-2021 |
Patrick Williams <patrick@stwcx.xyz> |
catch exceptions as const
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Id11e5c601ff495cd61abd3c35e6558e446e8a7d1 |
e9fb5c6a | 01-Jul-2021 |
George Liu <liuxiwei@inspur.com> |
logging: switch to lg2
After switching to C++20, it is recommended to use `phosphor::lg2` to format log, and the correct `CODE_LINE` and `CODE_FUNC` values can be used in log tracking.
Tested: buil
logging: switch to lg2
After switching to C++20, it is recommended to use `phosphor::lg2` to format log, and the correct `CODE_LINE` and `CODE_FUNC` values can be used in log tracking.
Tested: built ledManager successfully and Unit Test passes.
Before: The file does not exist or is empty After: The file does not exist or is empty, FILE_PATH = /usr/share/phosphor-led-manager/lamp-test-led-overrides.json
MESSAGE=File does not exist, FILE_PATH = /var/lib/phosphor-led-manager/savedGroups LOG2_FMTMSG=File does not exist, FILE_PATH = {PATH} CODE_FILE=../../../../../../fp5280g2-workspace/sources/phosphor-led-manager/serialize.cpp CODE_LINE=63 CODE_FUNC=void phosphor::led::Serialize::restoreGroups() PATH=/var/lib/phosphor-led-manager/savedGroups SYSLOG_IDENTIFIER=phosphor-ledmanager _PID=298 _COMM=phosphor-ledman _EXE=/usr/bin/phosphor-ledmanager _CMDLINE=phosphor-ledmanager _SYSTEMD_CGROUP=/system.slice/xyz.openbmc_project.LED.GroupManager.service _SYSTEMD_UNIT=xyz.openbmc_project.LED.GroupManager.service _SYSTEMD_INVOCATION_ID=5ddd4960a3b04fe29c34e4ce03b6be06
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I5ec8530e0b539bcf8d7d211c802430698aebd343
show more ...
|
d78de14d | 23-Aug-2021 |
George Liu <liuxiwei@inspur.com> |
Handle D-Bus exceptions
Remove the usage of is_method_error()[1].
Also, add try-catch to handle D-Bus exceptions around mapper call.
[1]https://github.com/openbmc/sdbusplus/blob/master/include/sdb
Handle D-Bus exceptions
Remove the usage of is_method_error()[1].
Also, add try-catch to handle D-Bus exceptions around mapper call.
[1]https://github.com/openbmc/sdbusplus/blob/master/include/sdbusplus/bus.hpp#L282-L286
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Id2b5234009e62e6c003f24a25c726317646b582b
show more ...
|
7152edcf | 02-Sep-2021 |
Patrick Williams <patrick@stwcx.xyz> |
exception: switch to public sdbus exception
SdBusError was intended to be a private error type inside sdbusplus. Switch all catch locations to use the general sdbusplus::exception type.
Signed-off-
exception: switch to public sdbus exception
SdBusError was intended to be a private error type inside sdbusplus. Switch all catch locations to use the general sdbusplus::exception type.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I411acc5238da0ad3d14a963c0d1a3bb4791f23ff
show more ...
|
65f9c4b7 | 15-Apr-2021 |
George Liu <liuxiwei@inspur.com> |
Remove compilation using autotools
The intent behind this commit is build phosphor-led-manager with meson, So need to remove files related to autotools.
Tested: built phosphor-led-manager successfu
Remove compilation using autotools
The intent behind this commit is build phosphor-led-manager with meson, So need to remove files related to autotools.
Tested: built phosphor-led-manager successfully and worked.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ib2052b994070e4c913befdd884b6ec0462c639e5
show more ...
|
d76c0748 | 15-Apr-2021 |
George Liu <liuxiwei@inspur.com> |
fault-monitor: Add monitor-opertaional-status to meson.build
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I9ebe31773dc865b4ade9fbca985470d79d7dbe7a |
ee1c19e5 | 01-Apr-2021 |
George Liu <liuxiwei@inspur.com> |
fault-monitor: Add OperationalStatus Functional monitoring
Currently, the default way is to update the Asserted property of the LedManager by monitoring the `/xyz/openbmc_project/logging` object pat
fault-monitor: Add OperationalStatus Functional monitoring
Currently, the default way is to update the Asserted property of the LedManager by monitoring the `/xyz/openbmc_project/logging` object path.
The intent behind this commit is to add another way to monitor the `xyz.openbmc_project.State.Decorator.OperationalStatus` interface of the Inventory D-Bus object, and check whether the Inventory D-Bus object is associated with the LED group D-Bus object, and then update the Asserted property of the LedManager.
Since both these methods handle the faults differently, Only ONE of these 2 methods can be enabled and NOT both.
The first way is supported by default. To turn OFF the default way AND turn ON this second way, Enable monitor-operational-status.
Tested: - enable `monitor-operational-status` in bbappend file, built successfully.
- Before changing the `OperationalStatus` interface: busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1 xyz.openbmc_project.State.Decorator.OperationalStatus Functional b true
busctl get-property xyz.openbmc_project.LED.GroupManager /xyz/openbmc_project/led/groups/powersupply1_fault xyz.openbmc_project.Led.Group Asserted b false
busctl get-property xyz.openbmc_project.LED.Controller.front_psu /xyz/openbmc_project/led/physical/front_psu xyz.openbmc_project.Led.Physical State s "xyz.openbmc_project.Led.Physical.Action.Off"
- After changing the `OperationalStatus` interface: busctl set-property xyz.openbmc_project.Inventory. /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1 xyz.openbmc_project.State.Decorator.OperationalStatus Functional b false
busctl get-property xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1 xyz.openbmc_project.State.Decorator.OperationalStatus Functional b false
( If we have more than 1 LED Group D-Bus object: Like: The system/chassis/motherboard/powersupply1 path contains two sets of LEDGroup { "types": { "rType": "fru", "fType": "fault_led_group" }, "paths": [ "/xyz/openbmc_project/led/groups/powersupply0_fault", "/xyz/openbmc_project/led/groups/powersupply1_fault" ] } busctl get-property xyz.openbmc_project.LED.GroupManager /xyz/openbmc_project/led/groups/powersupply0_fault xyz.openbmc_project.Led.Group Asserted b true )
busctl get-property xyz.openbmc_project.LED.GroupManager /xyz/openbmc_project/led/groups/powersupply1_fault xyz.openbmc_project.Led.Group Asserted b true
busctl get-property xyz.openbmc_project.LED.Controller.front_psu /xyz/openbmc_project/led/physical/front_psu xyz.openbmc_project.Led.Physical State s "xyz.openbmc_project.Led.Physical.Action.Blink"
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I36c47198168028ea2b55804cf66d0285847afbd4
show more ...
|
4b062010 | 13-Oct-2020 |
George Liu <liuxiwei@inspur.com> |
Add meson build
This commit is to add meson build. And later, we will remove Autotools and replace it with meson build.
In addition, fixed Layout::LedAction construct parameter error in test file.
Add meson build
This commit is to add meson build. And later, we will remove Autotools and replace it with meson build.
In addition, fixed Layout::LedAction construct parameter error in test file.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I58c9a2c9de928db288e77ca2d6aa807d36e70144
show more ...
|
a6c18f8d | 21-Jun-2020 |
George Liu <liuxiwei@inspur.com> |
clang-format: update to latest from docs repo
Since `Cpp11` is an alias for `Latest` and we should tend towards using the latest C++ standard, udpate the C++ standard to Latest.
https://github.com/
clang-format: update to latest from docs repo
Since `Cpp11` is an alias for `Latest` and we should tend towards using the latest C++ standard, udpate the C++ standard to Latest.
https://github.com/llvm/llvm-project/commit/e5032567903de19962333c4bf7d2edceaf4f9824#diff-b49a097415dff2837d9626d422c58ba8R82 https://github.com/openbmc/docs/blob/master/style/cpp/.clang-format
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Iaac09e3c11ead581114c4b7e45ff863ec56a63f6
show more ...
|