| ec7bf8c0 | 07-Nov-2025 |
Patrick Williams <patrick@stwcx.xyz> |
delete bundled stdexec
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I054b42515b94be3204f298c12a60dfc0d54ac3a7
|
| afc8e6e1 | 20-Aug-2025 |
Patrick Williams <patrick@stwcx.xyz> |
use external stdexec package
Add subprojects/stdexec.wrap so that we can use upstream stdexec, if the packageconfig is unavailable, and reference it as necessary in the meson.build.
Signed-off-by:
use external stdexec package
Add subprojects/stdexec.wrap so that we can use upstream stdexec, if the packageconfig is unavailable, and reference it as necessary in the meson.build.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ic0f32f694aac2f98c9646168b08ca352c183afa1
show more ...
|
| 5e36f4ab | 06-Nov-2025 |
Patrick Williams <patrick@stwcx.xyz> |
async: remove tag_invoke calls
P2300R9 removed usage of tag_invoke. stdexec still has it but in order to be forward compliant with the C++26 standard we should modernize the code and remove its usa
async: remove tag_invoke calls
P2300R9 removed usage of tag_invoke. stdexec still has it but in order to be forward compliant with the C++26 standard we should modernize the code and remove its usage. This also has the benefit of simplifying most sender/receiver implementations.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib0a1d0a82485c8d247a18daa020d0bba2249e95c
show more ...
|
| 10d0b4b7 | 05-Nov-2025 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: update to latest
* Add a .clang-format-ignore for the stdexec and stop running clang-format on it. This makes it identical to the stdexec source.
* Add a warning exception for
stdexec: update to latest
* Add a .clang-format-ignore for the stdexec and stop running clang-format on it. This makes it identical to the stdexec source.
* Add a warning exception for -Wempty-body.
* Remove a requirement constraint on the spawn function. The sender_of constraint can no longer analyze certain stdexec generated classes and appears to be deprecated. In the future I may be able to figure out a newer constraint for better diagnostics, but this is only for diagnostic purposes.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ic29b7052b1e3a1818fbbfbd42aefe2990f4295c7
show more ...
|
| 7c0fb15f | 04-Nov-2025 |
Patrick Williams <patrick@stwcx.xyz> |
use unpack syntax
Rather than defining a variable and then reading it from a message, we also supports directly unpack-ing from the message. Use this syntax instead as it is more efficient and succ
use unpack syntax
Rather than defining a variable and then reading it from a message, we also supports directly unpack-ing from the message. Use this syntax instead as it is more efficient and succinct.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I2ce2aa3e6a43d8866ba9b3920dd3165b7b6b9f6e
show more ...
|
| 40762595 | 12-Sep-2025 |
Ed Tanous <etanous@nvidia.com> |
Remove read_into_tuple
This function can be easily superseded by pack expressions, simplifying the code.
Tested: Boot up gb200 in qemu. Redfish service validator/login/logout all pass.
Change-Id:
Remove read_into_tuple
This function can be easily superseded by pack expressions, simplifying the code.
Tested: Boot up gb200 in qemu. Redfish service validator/login/logout all pass.
Change-Id: I999e0947c2ee124ca3dc8dc9718ddb13c2c52ea4 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| bd04c3b2 | 07-Jul-2025 |
Jagpal Singh Gill <paligill@gmail.com> |
add support for async mutex
Add support for async mutex for synchronizing coroutines/tasks using sender receiver framework. Also, add lock_guard support which provides a RAII wrapper for mutex to ow
add support for async mutex
Add support for async mutex for synchronizing coroutines/tasks using sender receiver framework. Also, add lock_guard support which provides a RAII wrapper for mutex to own it for the duration of a scoped block.
Tested: Add Unit Test using gtest ``` 1/1 test_async_mutex OK 2.01s
Ok: 1 Expected Fail: 0 Fail: 0 Unexpected Pass: 0 Skipped: 0 Timeout: 0 ```
Change-Id: I691528885a94b9cf55d4b7f2fb0c1e0e6d0ab84f Signed-off-by: Jagpal Singh Gill <paligill@gmail.com> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| 5b543251 | 22-Jul-2025 |
Jagpal Singh Gill <paligill@gmail.com> |
add support for timed fdio
For certain operations such as reading and writing to a fd for request response flows, the fd needs to have a timeout to avoid everlasting hangs in case of a unresponsive
add support for timed fdio
For certain operations such as reading and writing to a fd for request response flows, the fd needs to have a timeout to avoid everlasting hangs in case of a unresponsive responder. To support this, the fdio has been extended to add timeout support by throwing an exception in case of timeout.
Tested: Unit Test ``` 1/1 test_async_fdio_timed OK 10.03s
Ok: 1 Expected Fail: 0 Fail: 0 Unexpected Pass: 0 Skipped: 0 Timeout: 0 ```
Change-Id: Ib219e4a4c55125785e6c1571488e445ba3379244 Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
| e8f2b0d5 | 12-Sep-2025 |
Ed Tanous <etanous@nvidia.com> |
asio: unpack in place
The existing code uses several different tuples to do the unpack, then concatenates them with tuple_cat. Simplify the code by generating a tuple of references to the dbus args
asio: unpack in place
The existing code uses several different tuples to do the unpack, then concatenates them with tuple_cat. Simplify the code by generating a tuple of references to the dbus args, and unpack directly to the main struct, thus simplifying the flow.
To accomplish this the make_dbus_args_tuple helper method is added, which strips the non-dbus arguments from a callback so they can be unpacked separately. This is relatively complex because this code tries to support
callback(boost::error_code, message_t, dbus_arg); as well as callback(boost::error_code, dbus_arg);
Dynamically dependent on which overload is provided. There's likely more cleanup that can happen there to separate these two, but this should at least help.
Tested: OpenBMC launches and runs. Redfish service validator (which should hit the majority of these overloads) passes.
Change-Id: I6bb7ee960459a505eb8633b1cdb30cd2b3037466 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 485f6b60 | 19-Sep-2025 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update latest spec and reformat with clang-21
Copy the latest format file from the docs repository and apply using clang-format-21.
See I795e88ada8e676c242b5a18888ce9c08afdedc93 for c
clang-format: update latest spec and reformat with clang-21
Copy the latest format file from the docs repository and apply using clang-format-21.
See I795e88ada8e676c242b5a18888ce9c08afdedc93 for clang-21 enablement.
Change-Id: If23c0ebde25b8016876e48e4a63697310ea57706 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| 0fc47395 | 12-Sep-2025 |
Ed Tanous <etanous@nvidia.com> |
Use specific callable_traits includes
In line with the coding standard, use the most specific boost includes we can, in this case for callable_traits, we only need two structs, not the whole library
Use specific callable_traits includes
In line with the coding standard, use the most specific boost includes we can, in this case for callable_traits, we only need two structs, not the whole library.
Change-Id: I0500e5f726b7dc1646fa3fecc47cac5189218c64 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 47ac18da | 15-Jul-2025 |
Ed Tanous <etanous@nvidia.com> |
Allow appending std::vector<bool>
std::vector<bool> when done with a for loop returns the type of std::_bit_reference, which doesn't have a direct conversion to the underlying boolean type.
Rather
Allow appending std::vector<bool>
std::vector<bool> when done with a for loop returns the type of std::_bit_reference, which doesn't have a direct conversion to the underlying boolean type.
Rather than relying on the type returned by begin(), rely on T::value_type to specifically get the type in the container.
There isn't a particular use for this, but https://gerrit.openbmc.org/c/openbmc/entity-manager/+/81474
Is trying to consolidate code, and having all types use the same pack/unpack code is advantageous to avoid special cases. I don't know of a place we're actually packing/unpacking arrays of bool.
Tested: Booted gb200nvl-bmc. Services launched, no new crashes seen.
Change-Id: I07fc150a190ae44f7bdc90531ad2a4ce7f47e0a1 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 10476180 | 10-Jul-2025 |
Ed Tanous <etanous@nvidia.com> |
Remove grouping for append
These APIs are fairly complex. Similar to what was done for the read_single class of values, simplify these using c++17 template expressions.
Tested: Booted gb200nvl-bmc
Remove grouping for append
These APIs are fairly complex. Similar to what was done for the read_single class of values, simplify these using c++17 template expressions.
Tested: Booted gb200nvl-bmc. Services launched, no new crashes seen.
Change-Id: If2604113efa578062890f11d18ecca7a9f249e9c Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 7413ccc1 | 20-Feb-2025 |
Ed Tanous <ed@tanous.net> |
Simplify read templates
Clang build analyzer when run on bmcweb shows that sdbusplus::message::read functions are one of the longer-to-compile templates. Given that bmcweb has 400 ish method calls,
Simplify read templates
Clang build analyzer when run on bmcweb shows that sdbusplus::message::read functions are one of the longer-to-compile templates. Given that bmcweb has 400 ish method calls, and a variant type[1] that's made grown adults cry in fear when presented with compiler template errors, this should be something worth optimizing.
Luckily, we have c++17 these days, so we can vastly simplify our unpacking code using variadic fold expressions[2]
As part of the simplification, this commit removes the whole grouping class, as well as the class that creates std::tuples entirely, and operates entirely on the variadic pack directly. This drops the per-template compile time down to 700ms from 1800ms (note, these exact times fluctuate a lot run to run and machine to machine).
For the grouping entries, there were only two users that I was able to find. Ipmi[3] and ipmb. Running ipmitool in a fast loop shows no measurable change in performance.
[1] https://github.com/openbmc/bmcweb/blob/cc67d0a0fed101c930b334a583d9ca9b222ceb77/include/dbus_utility.hpp#L32 [2] https://en.cppreference.com/w/cpp/language/fold [3] https://github.com/openbmc/phosphor-host-ipmid/blob/920602f5f89b7aeeb7fd31dc77c768f1149cc1f2/ipmid-new.cpp#L493
Results from clang build analyzer after. Note, this is when isolated to a single compile unit (redfish.cpp). When run across the full build and all the template instantiations, this template saves 3-4 seconds on the compile time. ``` 735 ms: sdbusplus::message::message::read<std::vector<std::pair<std::basic_string<char>, std::variant<std::vector<std::tuple<std::basic_string<cha... (1 times, avg 735 ms) 735 ms: sdbusplus::message::read<std::vector<std::pair<std::basic_string<char>, std::variant<std::vector<std::tuple<std::basic_string<char>, std::... (1 times, avg 735 ms) 733 ms: sdbusplus::message::details::read_single<std::vector<std::pair<std::basic_string<char>, std::variant<std::vector<std::tuple<std::basic_str... (1 times, avg 733 ms) ```
Before ``` 1024 ms: sdbusplus::message::message::read<std::vector<std::pair<std::basic_string<char>, std::variant<std::vector<std::tuple<std::basic_string<cha... (1 times, avg 1024 ms) 1024 ms: sdbusplus::message::read<std::vector<std::pair<std::basic_string<char>, std::variant<std::vector<std::tuple<std::basic_string<char>, std::... (1 times, avg 1024 ms) 1022 ms: sdbusplus::message::details::read_grouping<std::tuple<>, std::vector<std::pair<std::basic_string<char>, std::variant<std::vector<std::tupl... (1 times, avg 1022 ms) 1017 ms: sdbusplus::message::details::read_tuple<std::tuple<std::vector<std::pair<std::basic_string<char>, std::variant<std::vector<std::tuple<std:... (1 times, avg 1017 ms) 1015 ms: sdbusplus::message::details::read_single<std::vector<std::pair<std::basic_string<char>, std::variant<std::vector<std::tuple<std::basic_str... (1 times, avg 1015 ms) ```
Change-Id: I6445ec448f94db39c3bc4615e57a6cd3df421ca6 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
| bc139974 | 08-Jul-2025 |
Patrick Williams <patrick@stwcx.xyz> |
watchdog: add support for systemd watchdog
Add interfaces and handling for systemd watchdog petting.
Systemd service files can specify a watchdog timeout and systemd will expect the application to
watchdog: add support for systemd watchdog
Add interfaces and handling for systemd watchdog petting.
Systemd service files can specify a watchdog timeout and systemd will expect the application to periodically poke a software watchdog, or else the service will be restarted. This is enabled with the 'WatchdogSec=' service file directive. Add primitives for interacting with the watchdog APIs.
Enable automatic support in the `async::context` for this watchdog handling, such that if the watchdog is required (by checking sd_watchdog_enabled) the daemon will automatically pet at the appropriate rate, assuming that the `async::context` is functioning correctly.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I68caf7b2c7166ca402b07ecee3db65f75365aa72
show more ...
|
| 242677a2 | 27-Mar-2024 |
Ed Tanous <ed@tanous.net> |
Use sd-bus array methods for read and append
Currently sdbusplus uses sd_bus_message_read_basic and message_append_basic for decoding and encoding of arrays. For large arrays, this imposes a signif
Use sd-bus array methods for read and append
Currently sdbusplus uses sd_bus_message_read_basic and message_append_basic for decoding and encoding of arrays. For large arrays, this imposes a significant overhead in calling the library each time. This leads to some extreme performance degradation in some cases, for example, passing a 4K bytes data array over sdbusplus interface now takes 4096 + 2 calls of sd_bus_message_read_basic and message_append_basic, this will consume about 10ms CPU time on a Aspeed 2600 platform for each package on both send and receive side.
While in this case, a DBus interface design should likely opt for using an FD rather than an array of bytes, this isn't a reason to not optimize this case.
sd-bus, in version 240 added methods to deal with this performance degradation, namely sd_bus_message_read_array and sd_bus_message_append_array, which each only require a single call to load values into the array using pointers and lengths.
This patchset is based on the one submitted here: https://gerrit.openbmc.org/c/openbmc/sdbusplus/+/68614
But opts for a different approach to a number of technical details on how it accomplishes the result, including changing the underlying sd-bus calls used to utilize ones that don't require sdbus internal malloc, avoiding unit tests ASAN issues in the process.
This commit adds support for utilizing the above methods when doing calls to the library if the following requirements are met: 1. The container is contiguous (using the std::contiguous_iterator concept) 2. The container represents a list of values of type int/uint 8,16,32, or 64 bits wide. Note, per the sd-bus documentation, arrays of bool are explicitly not supported (presumably because the internal representation of a bool array for both libc++ and sd-bus is implementation defined).
To accomplish this, the arrays handling for contiguous arrays is moved to use concepts, simplifying the code significantly, and allowing the use of std::contiguous_iterator.
Change-Id: I3bd9f97ed160835e8c30c302b80553a1d450bbf9 Signed-off-by: Ed Tanous <ed@tanous.net> Signed-off-by: Yongbing Chen <yongbingchen@google.com>
show more ...
|
| a0fe02ca | 10-Mar-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
aserver: constructor to initialize properties
Functions like 'emit_added()' do not work correctly if properties are not initialized. Often, the initial values for the properties of an interface are
aserver: constructor to initialize properties
Functions like 'emit_added()' do not work correctly if properties are not initialized. Often, the initial values for the properties of an interface are known, such as
- Software Version Interface - Software ActivationProgress Interface - Software ApplyTime Interface - ...
How was this previously handled?
- Write a wrapper class for the specific aserver class. This allows to initialize the properties, as they are protected members. Example [2]
- Write a wrapper class and provide methods to get/set the variables. This is done in [1]
- Set each property with a method call, which emits 'PropertyChanged' signal by default, not ideal. This also does not work if the interface is ever refactored to have additional properties.
To facilitate using these interfaces without having to write a wrapper class to inherit from them, and to avoid having to manually set each property, which can easily be forgotten, provide a constructor to allow for passing a struct with values for all the properties.
Tested: Unit tests pass, but still needs to be build-tested against openbmc/openbmc. The concern there is mostly due to an added template parameter.
References: [1] https://github.com/openbmc/sdbusplus/blob/da8574d5888b2c1622f5482a47adc7a12ffa0d0e/example/calculator-aserver.cpp#L44 [2] https://github.com/openbmc/phosphor-bmc-code-mgmt/blob/4983b138ea8fc70bd66fe4d30500e6252629fa5d/common/src/software.cpp#L29
Change-Id: I873cbca97ae16b19bfbf622303f4d52e2563a62c Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| c63e8e8a | 08-Jun-2025 |
Jayanth Othayoth <ojayanth@gmail.com> |
clang-tidy: Replace NULL with nullptr
Replaced all instances of NULL with nullptr to improve type safety and clarity, as nullptr is the modern C++ standard for null pointers.
Change-Id: I45ad10d46e
clang-tidy: Replace NULL with nullptr
Replaced all instances of NULL with nullptr to improve type safety and clarity, as nullptr is the modern C++ standard for null pointers.
Change-Id: I45ad10d46e3d01e66717bb47225aff8153f60c43 Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
show more ...
|
| 94beff8b | 23-Feb-2025 |
Ed Tanous <ed@tanous.net> |
Remove duplicated template params
These extra templates add bloat. There might be subtle cases of volatile (which by convention we shouldn't be using), and const, which should never be used as a re
Remove duplicated template params
These extra templates add bloat. There might be subtle cases of volatile (which by convention we shouldn't be using), and const, which should never be used as a read (You can't read into a const) where these might deduplicate things. Lets prefer simpler code here unless we have reason to believe this is a problem.
Change-Id: Ifa37eff346fd455f5e2e31bd9361f3a6b9978a65 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| ec6cfc9a | 16-May-2025 |
Jagpal Singh Gill <paligill@gmail.com> |
fix IWYU issue for sdbusplus/bus/match.hpp
clang-tidy explicitly includes sdbusplus/bus/match.hpp even though its already available through sdbusplus/async/match.hpp, so use IWYU pragma to mark sdbu
fix IWYU issue for sdbusplus/bus/match.hpp
clang-tidy explicitly includes sdbusplus/bus/match.hpp even though its already available through sdbusplus/async/match.hpp, so use IWYU pragma to mark sdbusplus/async/match.hpp as exporter of sdbusplus/bus/match.hpp as per [1].
[1]: https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-export
Change-Id: I5df39ee642b476aa502fc0707db241eb42378577 Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
| a91aac80 | 16-May-2025 |
Jagpal Singh Gill <paligill@gmail.com> |
fix IWYU for async.hpp
async.hpp includes bunch of async header files which is being ignored by clang-tidy due to IWYU. Hence, use IWYU pragma as per [1].
[1]: https://github.com/include-what-you-u
fix IWYU for async.hpp
async.hpp includes bunch of async header files which is being ignored by clang-tidy due to IWYU. Hence, use IWYU pragma as per [1].
[1]: https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-begin_exportsend_exports
Change-Id: I19cd7153b9f7ed3c6ad0cdd73addc701469af191 Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
| a23d26bd | 08-May-2025 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update latest spec and reformat with clang-20
Copy the latest format file from the docs repository and apply using clang-format-20.
See I1818407fdd8ab2ca11a939ffebd5f3e5445403c3 for c
clang-format: update latest spec and reformat with clang-20
Copy the latest format file from the docs repository and apply using clang-format-20.
See I1818407fdd8ab2ca11a939ffebd5f3e5445403c3 for clang-20 enablement.
Change-Id: I2b0de060a3f45027da88a1c1b65e333d02952bfc Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
| dd195669 | 21-Apr-2025 |
Ed Tanous <ed@tanous.net> |
Fix spawn calls
Boost 1.87 has brought with it build failures around using defaults for boost::asio::spawn. The first attempt to resolve this wasn't correct.
Fix it by making our implicit construc
Fix spawn calls
Boost 1.87 has brought with it build failures around using defaults for boost::asio::spawn. The first attempt to resolve this wasn't correct.
Fix it by making our implicit constructors explicit.
Change-Id: Ie171dbc7f998161fe211ba56b11a1a55e13e5982 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| 17a3263c | 07-Apr-2025 |
Patrick Williams <patrick@stwcx.xyz> |
asio: connection: add bus to ctor
Add a constructor parameter that accepts a bus-rvalue with a default of `sdbusplus::bus::new_default`. This was the previous behavior of the single-parameter const
asio: connection: add bus to ctor
Add a constructor parameter that accepts a bus-rvalue with a default of `sdbusplus::bus::new_default`. This was the previous behavior of the single-parameter constructor but now allows any other bus-constructing-function result to be used as a constructor parameter.
There was previously an alternative constructor that accepted an `sd_bus*` raw pointer, but this required an awkward `new_bus().release()` (or similar) call.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Id49a007eb1bddb054d1ffc83b415feab4a33a33a
show more ...
|
| 67cfca77 | 11-Mar-2025 |
Alexander Hansen <alexander.hansen@9elements.com> |
Add missing include for move_only_function
#include <functional>
References: [1] https://en.cppreference.com/w/cpp/utility/functional/move_only_function
Change-Id: I5b605eab5209a0bed545dfd74166c5
Add missing include for move_only_function
#include <functional>
References: [1] https://en.cppreference.com/w/cpp/utility/functional/move_only_function
Change-Id: I5b605eab5209a0bed545dfd74166c5eb0a8c3647 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|