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 ...
|
150d5f6a | 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: I85f99c9dfb356b15f40667aa920fbaff1af015a3 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
5f07fa36 | 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: Ib9913e28d2bd3a9cf98e47326a57d9b35ab223ef Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
9358f6bd | 14-Mar-2024 |
Konstantin Aladyshev <aladyshev22@gmail.com> |
Add fan_pwm to the possible sensors
Add fan PWM output to the list of supported sensor types.
Change-Id: Ia0c7970934fe403d4e6e0142af78b7815bcff0c9 Signed-off-by: Konstantin Aladyshev <aladyshev22@g
Add fan_pwm to the possible sensors
Add fan PWM output to the list of supported sensor types.
Change-Id: Ia0c7970934fe403d4e6e0142af78b7815bcff0c9 Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
show more ...
|
96439f1f | 07-Dec-2023 |
Patrick Williams <patrick@stwcx.xyz> |
meson: adjust nlohmann-json dependency
Simplify the dependency directive and align with the usage in other repositories.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6b140e3a2631
meson: adjust nlohmann-json dependency
Simplify the dependency directive and align with the usage in other repositories.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6b140e3a26314de110902bb4dceb1e8c57d80c3c
show more ...
|
f2e94221 | 31-Oct-2023 |
Tao Lin <lintao.lc@ieisystem.com> |
UpdateVirtualSensor uses information from signals
UpdateVirtualSensor uses information obtained from signals to avoid extensive dbus queries.
Tested: 1:Execute DBus cmd to see if VirtualSensor can
UpdateVirtualSensor uses information from signals
UpdateVirtualSensor uses information obtained from signals to avoid extensive dbus queries.
Tested: 1:Execute DBus cmd to see if VirtualSensor can correctly obtain the value of DbusSensor busctl tree xyz.openbmc_project.VirtualSensor busctl introspect xyz.openbmc_project.VirtualSensor xxx 2:Waiting for the value change of DbusSensor,Check if the value of the virtual sensor has changed after the dbusSensor changes.
Fixes openbmc/phosphor-virtual-sensor#1
Change-Id: If11f9017b31ce5cf06f910a38c65637c55d74b24 Signed-off-by: Tao Lin <lintao.lc@ieisystem.com>
show more ...
|
ae10c529 | 20-Oct-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-17 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-17 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: I2c290b16ee59b4768ba96642db5c9317b8311ba3 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
14ef8742 | 07-Oct-2023 |
Lei YU <yulei.sh@bytedance.com> |
Add UT cases for exprtk functions related to nan
Add unit test cases for below exprtk functions: * maxIgnoreNaN * sumIgnoreNaN * ifNan
Signed-off-by: Lei YU <yulei.sh@bytedance.com> Change-Id: I4a9
Add UT cases for exprtk functions related to nan
Add unit test cases for below exprtk functions: * maxIgnoreNaN * sumIgnoreNaN * ifNan
Signed-off-by: Lei YU <yulei.sh@bytedance.com> Change-Id: I4a9ea4b1f88ad1fd76295f88778a5bfc6b4defd1
show more ...
|
c77b6b3f | 08-Jun-2023 |
Lei YU <yulei.sh@bytedance.com> |
exprkt: Add ifNan to ignore the NaN value
Arithmetic with `nan` values is not expected in virtual sensor's case.
Adding a new exprkt function `ifNan` to handle this case, that if a value is `nan`,
exprkt: Add ifNan to ignore the NaN value
Arithmetic with `nan` values is not expected in virtual sensor's case.
Adding a new exprkt function `ifNan` to handle this case, that if a value is `nan`, then use the other value.
Example usage in json config: ``` "Expression": "ifNan(maxIgnoreNaN(T0, T1), T2)" ```
The above expression get max value of T0, T1 ignoring nan, and if it's still nana, it uses the value T2.
Signed-off-by: Lei YU <yulei.sh@bytedance.com> Change-Id: Ib323f6e18ef9f3317437753018857ad53732f54b
show more ...
|
87d35115 | 24-Oct-2022 |
Lei YU <yulei.sh@bytedance.com> |
exprkt: Add sumIgnoreNaN to ignore the NaN value
Arithmetic with `nan` values is not expected in virtual sensor's case.
Adding a new exprkt function `sumIgnoreNaN` to handle this case, that it igno
exprkt: Add sumIgnoreNaN to ignore the NaN value
Arithmetic with `nan` values is not expected in virtual sensor's case.
Adding a new exprkt function `sumIgnoreNaN` to handle this case, that it ignores all `nan` values. If all values are `nan` then it returns `nan`, otherwise it returns the sum of the valid values.
Example usage in json config: ``` "Expression": "sumIgnoreNaN(T0, T1, T2, T3)" ```
Signed-off-by: Lei YU <yulei.sh@bytedance.com> Change-Id: I0cbd87f038499b4ea3ab722c003adc795a11c2b3
show more ...
|
0ab9d838 | 19-Jul-2022 |
Lei YU <yulei.sh@bytedance.com> |
exprkt: Add maxIgnoreNaN to ignore the NaN value
The max function in exprtk uses std::max() to get the max value. Comparing a value with nan has special rule and is not expected in virtual sensor's
exprkt: Add maxIgnoreNaN to ignore the NaN value
The max function in exprtk uses std::max() to get the max value. Comparing a value with nan has special rule and is not expected in virtual sensor's case. E.g. `max(nan, 1)` gives `nan`.
Adding a new exprkt function `maxIgnoreNaN` to handle the above case so that it ignores all `nan` values. If all values are `nan` then it returns `nan`, otherwise it returns the max value of the valid values.
Example usage in json config: ``` "Expression": "maxIgnoreNaN(T0, T1, T2, T3)" ```
Signed-off-by: Lei YU <yulei.sh@bytedance.com> Change-Id: Idd345cd2ce325e5a186b9816458ba3d3bc66a187
show more ...
|
2db8d41f | 21-Aug-2023 |
George Liu <liuxiwei@inspur.com> |
Optimize the createVirtualSensorsFromDBus method logic
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I56a7a229a8d5a6f414b2ba036627e4e7a8185bbd |
94921490 | 21-Aug-2023 |
George Liu <liuxiwei@inspur.com> |
hardcode dbus name
The busName variable is only used as the request_name parameter in the main method, so there is no need to explicitly declare a static variable.
Signed-off-by: George Liu <liuxiw
hardcode dbus name
The busName variable is only used as the request_name parameter in the main method, so there is no need to explicitly declare a static variable.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ice0ef649e6bb648707bd36687fafdeb095254e40
show more ...
|
ce4241cb | 12-Jul-2023 |
Patrick Williams <patrick@stwcx.xyz> |
build: upgrade to C++23
Meson 1.1.1 and GCC-13 both support C++23 and a sufficient portion of the standard has been implemented. Upgrade the build to leverage it.
Change-Id: I89744897e2829000688b4
build: upgrade to C++23
Meson 1.1.1 and GCC-13 both support C++23 and a sufficient portion of the standard has been implemented. Upgrade the build to leverage it.
Change-Id: I89744897e2829000688b4f34752e326bc6180236 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
1226f208 | 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: Ia9a79a850d4ae8d576f052bb552a83429b792ddb Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|