History log of /openbmc/dbus-sensors/src/ExternalSensorMain.cpp (Results 1 – 22 of 22)
Revision Date Author Comments
# eacbfdd1 04-Apr-2024 Ed Tanous <ed@tanous.net>

Enable misc-include-cleaner

Change-Id: I22099a0f95b2eb884dec7d95cee0bdd0c159fd1f
Signed-off-by: Ed Tanous <ed@tanous.net>


# 597e8423 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: I73acd9daf41b52bcc3f6af9a1c38c5f162ae76b2
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 779c96a2 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: I0d10afa582342818b9d90b168f6f39f71ce4e0f4
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
[AJ: regenerate using .clang-format from openbmc/docs@f44abd66eca8]
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

show more ...


# 83db50ca 01-Mar-2023 Ed Tanous <edtanous@google.com>

Don't use deprecated asio functions

This code used a number of asio functions that have been deprecated.
This patch replaces them with their new equivalents, and enabled
BOOST_ASIO_NO_DEPRECATED.

C

Don't use deprecated asio functions

This code used a number of asio functions that have been deprecated.
This patch replaces them with their new equivalents, and enabled
BOOST_ASIO_NO_DEPRECATED.

Change-Id: I98bddba4c7d72a53ceca9455429828e60f06c5e0
Signed-off-by: Ed Tanous <edtanous@google.com>

show more ...


# 1f978631 28-Feb-2023 Ed Tanous <edtanous@google.com>

Change io_service to io_context

This was renamed a while back in boost to be compliant with the
std::executors proposal.

Change-Id: Ib56544a0a7478990d18fe9e0bbbd8db1e52fa5b8
Signed-off-by: Ed Tanou

Change io_service to io_context

This was renamed a while back in boost to be compliant with the
std::executors proposal.

Change-Id: Ib56544a0a7478990d18fe9e0bbbd8db1e52fa5b8
Signed-off-by: Ed Tanous <edtanous@google.com>

show more ...


# 14ed5e99 12-Jul-2022 Ed Tanous <edtanous@google.com>

Add ObjectManager in the right place

Per
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/55308
dbus-sensors has been putting the ObjectManager in the wrong place. Fix
that.

Tested:

Add ObjectManager in the right place

Per
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/55308
dbus-sensors has been putting the ObjectManager in the wrong place. Fix
that.

Tested:
Loaded build with all patches under this same topic, and observed IPMI
and Redfish trees working correctly and responding with sensor data.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Iefe050fe50658de6e1f215eab95b1f772e50eb4a

show more ...


# 9da019cc 28-Sep-2022 Patrick Williams <patrick@stwcx.xyz>

clang-15: fixes for boolean simplification

clang-tidy-15 is reporting the following issue:

```
../src/ExternalSensorMain.cpp:227:17: error: boolean expression can be simplified by DeMorgan's theore

clang-15: fixes for boolean simplification

clang-tidy-15 is reporting the following issue:

```
../src/ExternalSensorMain.cpp:227:17: error: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr,-warnings-as-errors]
if (!(std::isfinite(timeoutSecs) && (timeoutSecs >= 0.0)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! || <
```

Apply automatic fix from clang-tidy.

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

show more ...


# 9b4a20e9 06-Sep-2022 Ed Tanous <edtanous@google.com>

Move to steady_timer

deadline_timer and steady_timer have one important difference, the
former runs off CLOCK_REALTIME, and the later runs off CLOCK_MONOTONIC.
For a long time we've relied on deadli

Move to steady_timer

deadline_timer and steady_timer have one important difference, the
former runs off CLOCK_REALTIME, and the later runs off CLOCK_MONOTONIC.
For a long time we've relied on deadline_timer incorrectly, given that
dbus-sensors does not care in the least about the calendar time, and
only cares about the difference between sensor scans.

Fortunately, this likely has no effect on the behavior of the sensors
most of the time, and in general, in a time change, the clock generally
moves forward, so all timers would immediately expire, scan all sensors,
and move on. phosphor-pid-control is intentionally designed to handle
this case, so it's quite likely that a user would never notice it, and
even if they did, would have to be looking at a debug console the moment
it happened.

The other effect is that in most cases, sensors call clock_gettime more
than they probably need to, which might slow down the performance.

This commit moves all usages of sensor timing to steady_timer, which
should give us more consistent results, and (in theory at least) be
faster. Because of stdlib compliance things, this also has the effect
of us dropping our dependence on boost::posix_time, and move to
std::chrono::duration objects, per the coding standard.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I69f948fb3f0fc0dfd7fd196d26ba46742a3e15a7

show more ...


# 054aad8f 18-Aug-2022 Zev Weiss <zev@bewilderbeest.net>

Remove Configuration interface prefix from utils APIs

This eliminates some repetitive verbosity from daemons that handle a lot
of different sensor types (such as hwmontempsensor and psusensor). It

Remove Configuration interface prefix from utils APIs

This eliminates some repetitive verbosity from daemons that handle a lot
of different sensor types (such as hwmontempsensor and psusensor). It
also positions us to more cleanly use a single data structure for both
existing APIs like GetSensorConfiguration() and
setupPropertiesChangedMatches(), as well as upcoming I2C
device-management support.

Tested: hwmontempsensor and adcsensor on romed8hm3 continue to behave as
they did previously.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I9d80475ca4160c8d2ff0afab942709496d51238d

show more ...


# 6c106d66 17-Aug-2022 Zev Weiss <zev@bewilderbeest.net>

Replace boost string predicate functions with stdlib ones

Now that we're on C++20 we no longer need boost for starts_with() and
ends_with() tests.

Also remove the predicate.hpp #include from files

Replace boost string predicate functions with stdlib ones

Now that we're on C++20 we no longer need boost for starts_with() and
ends_with() tests.

Also remove the predicate.hpp #include from files that weren't actually
using anything from it.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: Id68a019d5108a4646eb9b5fd18af33d60617e048

show more ...


# 08cb50c5 12-Aug-2022 Zev Weiss <zev@bewilderbeest.net>

ExternalSensorMain: Replace iterator pairs with structured bindings

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I93928a18fc8b12c842b9622fa7382847760fb2c8


# 214d9717 12-Aug-2022 Zev Weiss <zev@bewilderbeest.net>

Refactor PropertiesChanged handler setup

Most sensor daemons had pretty much the same duplicated open-coded
pattern for setting up PropertiesChanged signal matches; introduce a
helper function to re

Refactor PropertiesChanged handler setup

Most sensor daemons had pretty much the same duplicated open-coded
pattern for setting up PropertiesChanged signal matches; introduce a
helper function to reduce the duplication and make things more readable.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I803a21eea2f6d7fc71b50d54bb8fd57a104f3349

show more ...


# 92f8f515 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: Ieb6587e32446a758676f67d9c868289cc02e50bf

show more ...


# a4d2768c 19-Jul-2022 Zev Weiss <zev@bewilderbeest.net>

Factor out getPowerState() helper function

This same pattern had been open-coded in many of the sensor daemons;
let's reduce the duplication a bit.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>

Factor out getPowerState() helper function

This same pattern had been open-coded in many of the sensor daemons;
let's reduce the duplication a bit.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I8556af30fdcd53cdf06e5a4911f9152d3265c7af

show more ...


# 2049bd26 09-Jul-2022 Ed Tanous <edtanous@google.com>

Clang-tidy-14 fixes

Do as the robot commands. All changes made automatically by tidy.

Tested: (Thanks Zhikui)
Downloaded and run on system. Sensors scan normally.

Signed-off-by: Ed Tanous <edtan

Clang-tidy-14 fixes

Do as the robot commands. All changes made automatically by tidy.

Tested: (Thanks Zhikui)
Downloaded and run on system. Sensors scan normally.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I752f37c9e7a95aa3be8e6980ba6e4b2b48b3395a

show more ...


# bb67932a 16-May-2022 Ed Tanous <edtanous@google.com>

Apply LambdaBodyIndentation to dbus-sensors

Per the transform being done in bmcweb, do the same for dbus-sensors.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: If21489607759f3cdf20fad17

Apply LambdaBodyIndentation to dbus-sensors

Per the transform being done in bmcweb, do the same for dbus-sensors.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: If21489607759f3cdf20fad17eede50fb4e228e5e

show more ...


# a771f6a7 14-Jan-2022 Ed Tanous <edtanous@google.com>

Enable cppcoreguidelines-init-variables

We try to enforce this rule, but clearly the robot can do a better job.
Enable the rule, and for init of all variables that clang-tidy finds in
error.

Signed

Enable cppcoreguidelines-init-variables

We try to enforce this rule, but clearly the robot can do a better job.
Enable the rule, and for init of all variables that clang-tidy finds in
error.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Icf64bc51b3180de29f7e92fa5c5f636e6b1462a6

show more ...


# 8a17c303 02-Sep-2021 Ed Tanous <edtanous@google.com>

Make dbus-sensors compile with clang-13

clang-13 finds a lot more warnings for unused variables than it used to,
and also picks up some warnings about errant std::moves that are in
p

Make dbus-sensors compile with clang-13

clang-13 finds a lot more warnings for unused variables than it used to,
and also picks up some warnings about errant std::moves that are in
place.

This commit fixes them.

Tested:
code compiles against clang-13

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I80864287b7131acfe936c4b28afaf34ababb3029

show more ...


# 0362738d 17-Mar-2021 Josh Lehan <krellan@google.com>

ExternalSensor: Further refinements

Further refinements, learned after more testing.

Moved the writeHook lambda out of the ExternalSensor constructor,
and into separate initWrit

ExternalSensor: Further refinements

Further refinements, learned after more testing.

Moved the writeHook lambda out of the ExternalSensor constructor,
and into separate initWriteHook() function, to reduce the bloat of
an already extremely large argument list to the constructor,
and solve a nasty gotcha regarding enable_shared_from_this usage:

https://stackoverflow.com/a/63579750/3063879

Adding a few more useful debugging messages, to be printed when
debugging is enabled (set the "debug" constants to true).

Tested: Interrupted external source of data, values changed to NaN
as expected. Resumed external source, values changed from NaN to the
correctly updated values. Timer durations appear correct. Also sent
many configuration change messages, forcing sensor objects to be
reconstructed. No errors noted during processing, even when messages
sent quickly, and also with random delays, and left to run a while.

To check sensor data value:

busctl --no-pager introspect xyz.openbmc_project.ExternalSensor \
/xyz/openbmc_project/sensors/temperature/mysensor \
xyz.openbmc_project.Sensor.Value

To send a configuration change message:

dbus-send --system \
/xyz/openbmc_project/inventory/system/board/myboard/mysensor \
x.x.x.PropertiesChanged \
string:xyz.openbmc_project.Configuration.ExternalSensor

Change-Id: I7bd515fed8ddf391df3fabadab61321a446c1b9f
Signed-off-by: Josh Lehan <krellan@google.com>

show more ...


# 7243217b 17-Mar-2021 Josh Lehan <krellan@google.com>

Add timer expiration feature to ExternalSensor

ExternalSensor now functions as intended, wholly within dbus-sensors,
without requiring any modification to the IPMI or Redfish servers,

Add timer expiration feature to ExternalSensor

ExternalSensor now functions as intended, wholly within dbus-sensors,
without requiring any modification to the IPMI or Redfish servers,
to provide the feature of timeout expiration of external data, so that
stale/lost external connections can be properly indicated as such.

A "Timeout" parameter is added, in decimal seconds, providing a
watchdog for the arrival of external data. The expectation is that the
external source will provide D-Bus updates, to the sensor Value
property, at regular intervals, repeating indefinitely.
If this external source stops doing this, the watchdog barks, and
the Value of this Sensor will become set to "NaN". This provides
an indication to consumers of this Sensor, to realize that the Value
of this sensor has became stale/disconnected.

A practical application of this is fan control. Upon loss of external
temperature notification, the fans could be thrown into failsafe
mode, instead of risking the system overheating by wrongly continuing
to believe an old temperature value that has become stale.

Tested: Works for me. I started an external data source, data arrived
into the Value of the sensor. I stopped that external data source,
after the Timeout period, the Value became "NaN". I started the
external source again, the Value became correct again, as soon as
external data started to arrive again. I repeated this stop and start
procedure a few times, verifying that it operated as intended.

Signed-off-by: Josh Lehan <krellan@google.com>
Change-Id: I53b9ff4c0aa771aff4aaf3449fcab23c07afa296

show more ...


# 8a57ec09 09-Oct-2020 Ed Tanous <ed@tanous.net>

add clang-tidy

This commit implements a clang-tidy file, and makes some changes to get
it to pass. Most changes are naming or mechanical in nature.

Tested:
Clang-tidy now p

add clang-tidy

This commit implements a clang-tidy file, and makes some changes to get
it to pass. Most changes are naming or mechanical in nature.

Tested:
Clang-tidy now passes.

Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Ia441e4801b6c8725421d160c531c5df141f255d4

show more ...


# 2a40e939 02-Sep-2020 Josh Lehan <krellan@google.com>

ExternalSensor: New service for external sensors

This code was mostly copied from HwmonTempSensor, and inspired by the
initial proof of concept from https://gerrit.openbmc-project.xyz/35

ExternalSensor: New service for external sensors

This code was mostly copied from HwmonTempSensor, and inspired by the
initial proof of concept from https://gerrit.openbmc-project.xyz/35476

External sensors are designed to be placeholders, with no hwmon or
other hardware support locally. Thus, there is no detection or kernel
driver load, so no change is necessary to entity-manager.

The expectation is that these sensors will be updated by something
external to the BMC, such as the host, which can be useful for
including host-based sensors into phosphor-pid-control thermal zones.

* Added systemd service file, similar to the others.
* Added CMakeLists blocks, similar to the others.
* Also cleaned up some nearby formatting in CMakeLists.

Tested: With the addition of the Mutable feature from 36275, and the
installation of the systemd file from 36272, and a change to our IPMI
daemon (still in the process of being upstreamed), the host can write
to a sensor over IPMI. It correctly shows up in the IPMI SDR, and the
written value correctly shows up on the D-Bus ExternalSensor here.

Here is example JSON for use with entity-manager:
{
"Name": "HostOnlyDevTemp",
"Measure": "temperature",
"MinValue": -10.0,
"MaxValue": 117.5,
"Type": "ExternalSensor"
},

Signed-off-by: Josh Lehan <krellan@google.com>
Change-Id: Id499e1cd6c7918179bb1729e5ce8546cf4121dfa
Signed-off-by: Ed Tanous <edtanous@google.com>

show more ...