| 900ee39c | 17-Dec-2025 |
George Liu <liuxiwei@ieisystem.com> |
Remove redundant is_method_error() checks
The handlers registered through sdbusplus::bus::match_t only receive D-Bus signals. Signal messages are never sent as method-error replies, and therefore me
Remove redundant is_method_error() checks
The handlers registered through sdbusplus::bus::match_t only receive D-Bus signals. Signal messages are never sent as method-error replies, and therefore message.is_method_error() can never be true in these callbacks.
This change removes all unnecessary is_method_error() checks from signal handlers to simplify the code and avoid confusion.
Change-Id: I1e29c0e6bf82d2bcaf61ca05984bb98420dac9fd Signed-off-by: George Liu <liuxiwei@ieisystem.com>
show more ...
|
| 6272a393 | 16-Sep-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
meson: add src/ folder
This creates a conventional structure of src/ and test/ which helps to separate top-level files such as meson.build, OWNERS, ... from implementation files.
Git history of ind
meson: add src/ folder
This creates a conventional structure of src/ and test/ which helps to separate top-level files such as meson.build, OWNERS, ... from implementation files.
Git history of individual files is still accessible via e.g. ``` git log --follow -- src/thresholds.hpp ```
Tested: code compiles.
Change-Id: Ifff8b3e70437bc6a25cd6f65afd07d8a563d1a8c Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
| b3f59464 | 02-Jun-2025 |
Amithash Prasad <amithash@meta.com> |
Add structured logging for threshold events
Add capability to create structured logs for threshold crossing (compatible with Redfish Sensor Events) along with ability to resolve the logs when the th
Add structured logging for threshold events
Add capability to create structured logs for threshold crossing (compatible with Redfish Sensor Events) along with ability to resolve the logs when the threshold event recovers.
Tested: Created an inventory with an external sensor named `HostDevTemp` and a virtual sensor named `SPECIAL_SENSOR` configured to consumes this sensor which has set thresholds `"HardShutdownHigh": 50` and `"CriticalHigh": 35`. This would allow us to change the sensor value and watch the service handling the threshold crossing.
1. Change sensor value to 40+ to observe upper critical threshold handling. ``` root@bmc:~# busctl introspect -l xyz.openbmc_project.Logging /xyz/openbmc_project/logging/entry/3 xyz.openbmc_project.Logging.Entry | grep "AdditionalData\|Message\|Resolved" .AdditionalData property a{ss} 8 "READING_VALUE" "41.0" "SENSOR_NAME" "/xyz/openbmc_project/sensors/temperature/SPECIAL_SENSOR" "THRESHOLD_VALUE" "35.0" "UNITS" "xyz.openbmc_project.Sensor.Value.Unit.DegreesC" <snip> .Message property s "xyz.openbmc_project.Sensor.Threshold.ReadingAboveUpperCriticalThreshold" .Resolved property b false ```
2. change sensor value to 70+ to observe upper hard-shutdown threshold crossing. ``` root@bmc:~# busctl introspect -l xyz.openbmc_project.Logging /xyz/openbmc_project/logging/entry/5 xyz.openbmc_project.Logging.Entry | grep "AdditionalData\|Message\|Resolved" .AdditionalData property a{ss} 8 "READING_VALUE" "71.0" "SENSOR_NAME" "/xyz/openbmc_project/sensors/temperature/SPECIAL_SENSOR" "THRESHOLD_VALUE" "50.0" "UNITS" "xyz.openbmc_project.Sensor.Value.Unit.DegreesC" <snip> .Message property s "xyz.openbmc_project.Sensor.Threshold.ReadingAboveUpperHardShutdownThreshold" .Resolved property b false ```
3. Change sensor value back to 40+. Ensure upper hard-shutdown threshold is marked as resolved. ``` root@bmc:~# busctl introspect -l xyz.openbmc_project.Logging /xyz/openbmc_project/logging/entry/5 xyz.openbmc_project.Logging.Entry | grep "AdditionalData\|Message\|Resolved" .AdditionalData property a{ss} 8 "READING_VALUE" "71.0" "SENSOR_NAME" "/xyz/openbmc_project/sensors/temperature/SPECIAL_SENSOR" "THRESHOLD_VALUE" "50.0" "UNITS" "xyz.openbmc_project.Sensor.Value.Unit.DegreesC" <snip> .Message property s "xyz.openbmc_project.Sensor.Threshold.ReadingAboveUpperHardShutdownThreshold" .Resolved property b true ```
4. Change sensor value to 1+. Ensure that the upper critical threshold is marked as resolved. And a new event log is created for the sensors stating that the sensor is now in normal range. ``` root@bmc:~# busctl introspect -l xyz.openbmc_project.Logging /xyz/openbmc_project/logging/entry/3 xyz.openbmc_project.Logging.Entry | grep "AdditionalData\|Message\|Resolved" .AdditionalData property a{ss} 8 "READING_VALUE" "41.0" "SENSOR_NAME" "/xyz/openbmc_project/sensors/temperature/SPECIAL_SENSOR" "THRESHOLD_VALUE" "35.0" "UNITS" "xyz.openbmc_project.Sensor.Value.Unit.DegreesC" <snip> .Message property s "xyz.openbmc_project.Sensor.Threshold.ReadingAboveUpperCriticalThreshold" .Resolved property b true ``` ``` root@bmc:~# busctl introspect -l xyz.openbmc_project.Logging /xyz/openbmc_project/logging/entry/6 xyz.openbmc_project.Logging.Entry | grep "AdditionalData\|Message\|Resolved" .AdditionalData property a{ss} 7 "READING_VALUE" "2.0" "SENSOR_NAME" "/xyz/openbmc_project/sensors/temperature/SPECIAL_SENSOR" "UNITS" "xyz.openbmc_project.Sensor.Value.Unit.DegreesC" <snip> .Message property s "xyz.openbmc_project.Sensor.Threshold.SensorReadingNormalRange" .Resolved property b false ```
Change-Id: I660b6a477af38c9314680ce12705c460bae23fd8 Signed-off-by: Amithash Prasad <amithash@meta.com>
show more ...
|
| 7d2f323a | 02-Jun-2025 |
Amithash Prasad <amithash@meta.com> |
Add a units and objPath member to the sensor class
Adding a units and objPath members to be reusable in the future. Moved around helper maps as needed.
Change-Id: Ic5fda95b5c8673476c2ee91359691f8af
Add a units and objPath member to the sensor class
Adding a units and objPath members to be reusable in the future. Moved around helper maps as needed.
Change-Id: Ic5fda95b5c8673476c2ee91359691f8afc21f7e2 Signed-off-by: Amithash Prasad <amithash@meta.com>
show more ...
|
| 162a1bd4 | 25-Jul-2025 |
George Liu <liuxiwei@ieisystem.com> |
Avoid redundant virtual sensor updates on unchanged values
This patch fixes a potential memory growth issue caused by handling PropertyChanged signals without checking whether the new value differs
Avoid redundant virtual sensor updates on unchanged values
This patch fixes a potential memory growth issue caused by handling PropertyChanged signals without checking whether the new value differs from the previous one.
Previously, the virtual sensor's `updateVirtualSensor()` method was called unconditionally whenever a "Value" property change signal was received. If a large number of D-Bus PropertyChanged signals were forged or triggered in rapid succession with the same value (e.g., during stress testing), this could result in frequent unnecessary updates, which in turn caused increased memory usage in both the sensor process and the dbus-broker.
With this change, the handler now compares the new value with the current stored value and only invokes `updateVirtualSensor()` when there is a real change.
This mitigates unnecessary CPU and memory load in high signal traffic scenarios.
Change-Id: I345188fa9e361b2cc972cdbb40c911be89a5d661 Signed-off-by: George Liu <liuxiwei@ieisystem.com>
show more ...
|
| 6f128345 | 25-Jul-2025 |
George Liu <liuxiwei@ieisystem.com> |
Remove unused variable 'path' in handleDbusSignalPropChange
The variable `path` was assigned using `msg.get_path()` but never used in the logic. This patch removes the redundant line to clean up the
Remove unused variable 'path' in handleDbusSignalPropChange
The variable `path` was assigned using `msg.get_path()` but never used in the logic. This patch removes the redundant line to clean up the code and avoid unused variable warnings.
Change-Id: I4c1eee8e3688b5483509670b79ef515b7892d86e Signed-off-by: George Liu <liuxiwei@ieisystem.com>
show more ...
|
| f8fcdc2a | 09-Jul-2025 |
Patrick Williams <patrick@stwcx.xyz> |
meson: use non-deprecated systemd packageconfig
Systemd's packageconfig file has both `systemdsystemunitdir` and `systemd_system_unit_dir` defined. The non-underscore one appears to be a deprecated
meson: use non-deprecated systemd packageconfig
Systemd's packageconfig file has both `systemdsystemunitdir` and `systemd_system_unit_dir` defined. The non-underscore one appears to be a deprecated alias[1]. Move to the non-deprecated / underscore-separated variant.
[1]: https://github.com/systemd/systemd/commit/4908de44b0a0409f84a7cdc5641b114d6ce8ba03
Change-Id: Ie551c0d3549c73c33e31ccb17149d4ad16170adb Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| 84597667 | 30-May-2025 |
Patrick Williams <patrick@stwcx.xyz> |
clang-tidy: format with config-clang-tidy
Reformat the .clang-tidy file for consistency using the config-clang-tidy tool from openbmc-build-scripts.
Change-Id: I2a292438a8ea2e71476284fa21e67ae238bd
clang-tidy: format with config-clang-tidy
Reformat the .clang-tidy file for consistency using the config-clang-tidy tool from openbmc-build-scripts.
Change-Id: I2a292438a8ea2e71476284fa21e67ae238bd7e15 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| 04605fa2 | 28-May-2025 |
Patrick Williams <patrick@stwcx.xyz> |
move daemons to libexec
Per the organization anti-pattern, executables are expected to be installed into libexec instead of bin[1]. Update service files and meson to install there.
[1]: https://gi
move daemons to libexec
Per the organization anti-pattern, executables are expected to be installed into libexec instead of bin[1]. Update service files and meson to install there.
[1]: https://github.com/openbmc/docs/blob/master/anti-patterns.md#incorrect-placement-of-executables-in-sbin-usrsbin-or-bin-usrbin
Change-Id: Ibb102f387c27593c81f41aa0adc3b994ca9185e2 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| 4b98de56 | 03-Feb-2025 |
Patrick Williams <patrick@stwcx.xyz> |
meson: reformat with meson formatter
Apply the `meson format` results.
Change-Id: Id7af795e402928290b31fb085bd12a715122545b Signed-off-by: Patrick Williams <patrick@stwcx.xyz> |
| d000018a | 06-Feb-2025 |
Lei YU <yulei.sh@bytedance.com> |
clang-tidy: Enable bugprone-unchecked-optional-access
Enable bugprone-unchecked-optional-access to detect the case that it accesses std::optional without checking empty.
See https://gerrit.openbmc.
clang-tidy: Enable bugprone-unchecked-optional-access
Enable bugprone-unchecked-optional-access to detect the case that it accesses std::optional without checking empty.
See https://gerrit.openbmc.org/c/openbmc/docs/+/78034 for details.
Signed-off-by: Lei YU <yulei.sh@bytedance.com> Change-Id: I6f35cc4585e681b7f4030b85295074b1564e8a48
show more ...
|
| be3c77fa | 06-Feb-2025 |
Lei YU <yulei.sh@bytedance.com> |
exprtk.wrap: Specify 0.0.3 release
The revision in exprtk.wrap points to a bad revision (possibly due to the exprtk force push on github), and the revision fails to build with clang++ as well.
The
exprtk.wrap: Specify 0.0.3 release
The revision in exprtk.wrap points to a bad revision (possibly due to the exprtk force push on github), and the revision fails to build with clang++ as well.
The yocto now points to 0.0.3 release, change the revision here to make it consistent and it compiles with clang++ now.
Signed-off-by: Lei YU <yulei.sh@bytedance.com> Change-Id: I52cf9a6df21494933545238cf4c95b5287ce88f7
show more ...
|
| 4224ca36 | 01-Feb-2025 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I75589ffb25513a101efdcf6ce060538b5d000ffb Signed-off-by: Patrick Williams <p
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I75589ffb25513a101efdcf6ce060538b5d000ffb Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| 76e6c5af | 30-Jan-2025 |
Patrick Williams <patrick@stwcx.xyz> |
build: use allowed over enabled or not-disabled
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`)
build: use allowed over enabled or not-disabled
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`. Switch all uses of `not disabled` to `allowed`.
Change-Id: Ia2c951e0b40131650ee8fd1d7f76a322686a3898 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| 74f835b0 | 18-Dec-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-19
clang-format-19 isn't compatible with the clang-format-18 output, so we need to reformat the code with the latest version. A few parameters in clang-tidy have b
clang-format: re-format for clang-19
clang-format-19 isn't compatible with the clang-format-18 output, so we need to reformat the code with the latest version. A few parameters in clang-tidy have been deprecated, so adjust the style file accordingly.
See Ie2f6eb3b043f2d655c9df806815afd7971fd0947 for updated style. See I88192b41ab7a95599a90915013579608af7bc56f for clang-19 enablement.
Change-Id: I370a946cb93cb5014f5d7ab2ae169bc996dd562e Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| 06f8874f | 24-Oct-2024 |
George Liu <liuxiwei@ieisystem.com> |
Fix create sensor failure after process restart
When the virtual-sensor process is intentionally restarted, the createVirtualSensors method will only create sensors with Type equal to ModifiedMedian
Fix create sensor failure after process restart
When the virtual-sensor process is intentionally restarted, the createVirtualSensors method will only create sensors with Type equal to ModifiedMedian, so if other types of sensors (eg: Sum, Minimum, Maximum, etc.) are configured in EM.json, they will not be loaded.
This commit will remove the `Type` and create the sensor by traversing the calculationIfaces when parsing to 'Config: D-Bus'.
Change-Id: I4a22bd2eef26e745e770acb260616374b5aba89b Signed-off-by: George Liu <liuxiwei@ieisystem.com>
show more ...
|
| d98174e9 | 25-Oct-2024 |
George Liu <liuxiwei@ieisystem.com> |
Add the main.cpp file
Separate the main method from virtualSensor.cpp and add it to the main.cpp file.
Change-Id: Ife3dd9bb6dee552d944399bcc769fc6c4ba54a4b Signed-off-by: George Liu <liuxiwei@ieisy
Add the main.cpp file
Separate the main method from virtualSensor.cpp and add it to the main.cpp file.
Change-Id: Ife3dd9bb6dee552d944399bcc769fc6c4ba54a4b Signed-off-by: George Liu <liuxiwei@ieisystem.com>
show more ...
|
| 2030a56a | 25-Oct-2024 |
George Liu <liuxiwei@ieisystem.com> |
README.md: Update Type supported types
Currently supported types are `Average`, `Maximum`, `Minimum`, `Sum` and `ModifiedMedian`.
Change-Id: I0c262fdb1564987a1a4f559cc8a7389022a48c3c Signed-off-by:
README.md: Update Type supported types
Currently supported types are `Average`, `Maximum`, `Minimum`, `Sum` and `ModifiedMedian`.
Change-Id: I0c262fdb1564987a1a4f559cc8a7389022a48c3c Signed-off-by: George Liu <liuxiwei@ieisystem.com>
show more ...
|
| bfb17214 | 15-Oct-2024 |
Jayanth Othayoth <ojayanth@gmail.com> |
Added fix for the yocto rebase build failure
Fixed below errors found during yocto rebase due to missing header file algorithm.
``` calculate.cpp: error: 'sort' is not a member of 'std'; did you
Added fix for the yocto rebase build failure
Fixed below errors found during yocto rebase due to missing header file algorithm.
``` calculate.cpp: error: 'sort' is not a member of 'std'; did you mean 'qsort'? error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'? error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'? ```
Tested: Build verified with yocto rebase patches.
Change-Id: Ie6f920e20a8ddb4b953b246b0debc4be87fa2462 Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
show more ...
|
| 60fab695 | 18-Sep-2024 |
George Liu <liuxiwei@ieisystem.com> |
Add func for average value when sensor from DBus
Add a function that calculates the average of all values.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I65cecf57814219fff233722a598
Add func for average value when sensor from DBus
Add a function that calculates the average of all values.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I65cecf57814219fff233722a59894e31fc001968
show more ...
|
| 4e6081bc | 18-Sep-2024 |
George Liu <liuxiwei@ieisystem.com> |
Add func for sum value when sensor from DBus
Add a function that calculates the sum of all values.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I922aab1a034be5c17f8725298ead99b113d
Add func for sum value when sensor from DBus
Add a function that calculates the sum of all values.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I922aab1a034be5c17f8725298ead99b113da5b5f
show more ...
|
| b4cea1b1 | 04-Sep-2024 |
Patrick Williams <patrick@stwcx.xyz> |
prettier: use config from docs
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I4f202295ce74399f4c31438889c18493177c8ead |
| c1f822c0 | 28-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
Add func for Minimum when sensor from DBus
Add function to calculate the minimum value.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I9b2650da93795c5768ac6e90102280f9e004e23c |
| 7f41a0d4 | 28-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
Refactor virtual sensor calculation logic
Refactor the calculation method to calculate.cpp and use std::map instead of std::array, and other algorithms will be added to calculate.cpp in the future.
Refactor virtual sensor calculation logic
Refactor the calculation method to calculate.cpp and use std::map instead of std::array, and other algorithms will be added to calculate.cpp in the future.
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I6dcf5119140a5acdf334ebb280dd0b458da1e3ea
show more ...
|
| a630f081 | 28-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
Remove DEBUG flag
Since lg2 already supports the debug log level and the log level can be modified in journald-maxlevel-policy.conf [1], there is no need to add the DEBUG flag in this repo.
[1]: ht
Remove DEBUG flag
Since lg2 already supports the debug log level and the log level can be modified in journald-maxlevel-policy.conf [1], there is no need to add the DEBUG flag in this repo.
[1]: https://github.com/openbmc/openbmc/blob/master/meta-phosphor/recipes-core/systemd/phosphor-systemd-policy/journald-maxlevel-policy.conf
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I8a4a0564707478b8f8fdbbd128a2e2f7908c2ce6
show more ...
|