36137e09 | 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: I65cb0501917fee37f007ed97ce973e0dd07170fa Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
f083bc1a | 16-Dec-2024 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: update to latest commit
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I93e33afb0ca87f425074e86f87e6cde320f20dbc |
869230c6 | 12-Dec-2024 |
Patrick Williams <patrick@stwcx.xyz> |
async: fdio: remove unused member
clang warns about an unused private field ('fd') because it is a capture-only member. There isn't any reason to keep the fd around once the underlying sd_event has
async: fdio: remove unused member
clang warns about an unused private field ('fd') because it is a capture-only member. There isn't any reason to keep the fd around once the underlying sd_event has been created, so remove it as a member.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I176b2c4b53bbd7e4bb4bc9a9594f5816ee1bda2e
show more ...
|
d792b8cd | 06-Dec-2024 |
Jayanth Othayoth <ojayanth@gmail.com> |
clang-tidy: Fix implicit copy constructor errors
The following errors were reported during clang-tidy enablement due to the implicit copy constructor. These errors are suppressed using pragma diagno
clang-tidy: Fix implicit copy constructor errors
The following errors were reported during clang-tidy enablement due to the implicit copy constructor. These errors are suppressed using pragma diagnostic ignore checks.
''' ../include/sdbusplus/async/stdexec/../stdexec/__detail/__env.hpp:463:11: error: definition of implicit copy constructor for 'prop<stdexec::__queries::get_stop_token_t ../include/sdbusplus/async/stdexec/../stdexec/__detail/__env.hpp:501:10: error: definition of implicit copy constructor for 'env<>' is deprecated because it has a user-declared copy assignment operator [-Werror ../include/sdbusplus/async/stdexec/../stdexec/__detail/__env.hpp:544:10: error: definition of implicit copy constructor for 'env<stdexec::__env::prop<stdexec::__queries::get_stop_token_t ../include/sdbusplus/async/stdexec/../stdexec/__detail/__env.hpp:609:14: error: definition of implicit copy constructor for '__t' is deprecated because it has\ a user-declared copy assignment operator [-Werror '''
Tested: Verified build and unit testing.
Change-Id: I0b74cdbd5b5c58ba3c01866ffb0509e070861db9 Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
show more ...
|
dfbd9ddf | 11-Sep-2024 |
Lei YU <yulei.sh@bytedance.com> |
asio: connection: Return unpacked value directly
`yield_method_call()` shall return the values of DBus methods, and it was using constexpr if to check `sizeof...(RetTypes)` to get the return type an
asio: connection: Return unpacked value directly
`yield_method_call()` shall return the values of DBus methods, and it was using constexpr if to check `sizeof...(RetTypes)` to get the return type and construct default return values.
`message::unpack()` does the same thing so it is possible to return directly.
In case of error occurs, it still need to return the default-constructed value, so a helper function `default_ret_types()` is introduced for default return in such case.
Change-Id: Iac7501dc03c1cfaf16f59f7ae742168c6be5886d Signed-off-by: Lei YU <yulei.sh@bytedance.com>
show more ...
|
cd3bf08a | 12-Oct-2024 |
Ed Tanous <etanous@nvidia.com> |
Handle timeouts in asio connections
It was reported in #98 that timeouts weren't working in some simple cases. This appears to be because we've broken some of the assumptions used by sd-bus around
Handle timeouts in asio connections
It was reported in #98 that timeouts weren't working in some simple cases. This appears to be because we've broken some of the assumptions used by sd-bus around manually handling polling loops, and ignoring sd_bus_get_timeout and sd_bus_get_events, as well as not calling sd_bus_get_fd before every invocation. [1]
This commit: Adds a steady_timer class to the asio object, which indirectly allows expiring the underlying epoll loop early, based on the result of sd_bus_get_timeout.
Changes the flow such that sd_bus_get_events is called and obeyed when adding poll events to the reactor. While this wasn't seen in practice, in theory we have the potential to miss events during heavy write loads where the socket might block. This should resolve it.
Re-calls sd_bus_get_fd on each invocation of the poll loop, as directed by the sd_bus documentation. Further testing is needed to see if this resolves some of the match_t issues we've seen.
Tested: asio-example functions and prints expected content. More in-system testing needed.
[1] https://www.freedesktop.org/software/systemd/man/249/sd_bus_get_fd.html#
Change-Id: I9abe99c95eb5395753dde33f92c831bd828238f3 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
9737e15f | 12-Oct-2024 |
Ed Tanous <etanous@nvidia.com> |
Add get_events and get_timeout
These two functions are required for handling external io loops properly, per the sd-bus documentation. Add them to the interface, and mocks.
Change-Id: Ic2d20607585
Add get_events and get_timeout
These two functions are required for handling external io loops properly, per the sd-bus documentation. Add them to the interface, and mocks.
Change-Id: Ic2d20607585ddf669d1cf6e7acc3e5970489489b Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
2a12ae12 | 23-Oct-2024 |
Jagpal Singh Gill <paligill@gmail.com> |
add async fd sender receiver for coroutines
Add async sender receiver for file descriptor based events. The user of the async file descriptor needs to initialize a fdio instance and then call next()
add async fd sender receiver for coroutines
Add async sender receiver for file descriptor based events. The user of the async file descriptor needs to initialize a fdio instance and then call next() to get each new event for the fd.
Tested: ``` > meson test -C builddir test_async_fdio ninja: Entering directory `/host/repos/sdbusplus/builddir' ninja: no work to do. 1/1 test_async_fdio OK 6.01s
Ok: 1 Expected Fail: 0 Fail: 0 Unexpected Pass: 0 Skipped: 0 Timeout: 0
Full log written to /host/repos/sdbusplus/builddir/meson-logs/testlog.txt ```
Change-Id: I1b4f16963e6096f30484c4a6df471e64ed24448b Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
956e87a2 | 11-Nov-2024 |
Jayanth Othayoth <ojayanth@gmail.com> |
boost version 1.86 support
Added fix for boost::asio::spawn overload issue reported similar to chriskohlhoff/asio#1524. This error is reported by telemetry recipe during Boost 1.86 migration build.
boost version 1.86 support
Added fix for boost::asio::spawn overload issue reported similar to chriskohlhoff/asio#1524. This error is reported by telemetry recipe during Boost 1.86 migration build.
Error details
''' tmp/work/armv7ahf-vfpv4d16-openbmc-linux-gnueabi/telemetry/1.0+git/ recipe-sysroot/usr/include/sdbusplus/asio/object_server.hpp:238:27: error: call of overloaded 'spawn '''
Proposed fix is to use default completion token.
Tested: verified build
Change-Id: I4c24869c1467a04ac40027bc4c50aebd1f3acb78 Signed-off-by: Jayanth Othayoth <ojayanth@gmail.com>
show more ...
|
b08d14dd | 05-Nov-2024 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: events: unpack an event from JSON
Generate code necessary to unpack a generated event from its JSON representation.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I7a28617f
sdbus++: events: unpack an event from JSON
Generate code necessary to unpack a generated event from its JSON representation.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I7a28617f3f0374968609328a44587b655a9141c1
show more ...
|
3b54a8e5 | 25-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: simplify handling of empty parameter lists
Add a template specialization of the type-tuple generation for empty parameter lists in order to simplify the Mako templates. This eliminates a sp
sdbus++: simplify handling of empty parameter lists
Add a template specialization of the type-tuple generation for empty parameter lists in order to simplify the Mako templates. This eliminates a special case for empty parameter lists in multiple places.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I7ca8d962ab1c7a65e0ad6d80ece1cd7e3847f2c6
show more ...
|
fc0bb996 | 11-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
bus: un-inline functions
Due to additional upstream error results, the bus creation functions need better error handling. This will result in larger functions that are no longer a direct sd-bus cal
bus: un-inline functions
Due to additional upstream error results, the bus creation functions need better error handling. This will result in larger functions that are no longer a direct sd-bus call and probably shouldn't be inlined. Move the functions to the `bus.cpp` file.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: If141ef74a62fd04b3bbf58b0720da2a9410481a7
show more ...
|
4b3720f8 | 10-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: use new_bus by default
There are two primary methods for creating a generic bus: * new_default * new_bus
The "default" methods use TLS to get a shared bus for the thread. Thi
async: context: use new_bus by default
There are two primary methods for creating a generic bus: * new_default * new_bus
The "default" methods use TLS to get a shared bus for the thread. This is likely not the desired bus to use for async operations because:
1. Currently a separate thread is used for the message processing. 2. Some existing synchronous code throughout openbmc uses `new_default` instead of referencing an existing bus, which could interfere with the async context.
Switch to using `new_bus` by default to ensure we get a fresh, unused and unshared bus in the typical case.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I1fd27de7bce9a8737294a5ab8e63e0dbe1afc8c3
show more ...
|
c012fde4 | 07-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
events: add severity to class generation
Use the severity field to add to the class generation for use by phosphor-logging to commit entries.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Cha
events: add severity to class generation
Use the severity field to add to the class generation for use by phosphor-logging to commit entries.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I82bb8482c0f95435275fb3a1fcdcb37bd29fc7ec
show more ...
|
760adffd | 05-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
events: add non-template base class
In order to allow non-template implementations that interact with the `sdbusplus::excception::generated_event<T>` class, it is useful to have a non-template base
events: add non-template base class
In order to allow non-template implementations that interact with the `sdbusplus::excception::generated_event<T>` class, it is useful to have a non-template base class. Add the `to_json` there for use by phosphor-logging.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ibed2c7c4fc0e23f1c82c4c003e16a6f438f7e68f
show more ...
|
14c4797c | 24-Sep-2024 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: events: create json for events
Create JSON for the events containing their metadata and leverage that as the "message" portion of the `sd_bus_error`. This will allow unpacking the message
sdbus++: events: create json for events
Create JSON for the events containing their metadata and leverage that as the "message" portion of the `sd_bus_error`. This will allow unpacking the message on a client side back to the original exception.
Tested: ``` $ busctl --user call net.poettering.Calculator /net/poettering/calculator net.poettering.Calculator Divide xx 5 0 Call failed: {"net.poettering.Calculator.DivisionByZero":{"FOO":"unused"}} ```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I4edd76d983267f28e51c4aa41902d45f5d6da793
show more ...
|
a4bfefde | 24-Sep-2024 |
Patrick Williams <patrick@stwcx.xyz> |
exception: move sd_bus_error_set calls to exception
In the future, generated exceptions will need to fill the sd_error with something other than the "description" in order to pass more metadata. Mo
exception: move sd_bus_error_set calls to exception
In the future, generated exceptions will need to fill the sd_error with something other than the "description" in order to pass more metadata. Move the sd_bus_error_set calls to exception as a virtual function so this can be accomplished.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6e6947e4977701a8e7e27fef119bd35e837d866b
show more ...
|
ebe01794 | 24-Sep-2024 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: events: simplify constructor
Consolidate consteval_string usage to simplify the generated code.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6340eb369c117bb580a128e53381
sdbus++: events: simplify constructor
Consolidate consteval_string usage to simplify the generated code.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6340eb369c117bb580a128e5338113a4b38a0f80
show more ...
|
d925c0bc | 23-Sep-2024 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: events: generate exception constructors
Generate constructors for exceptions using the listed metadata.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I99dc912e4ad0746a14d3
sdbus++: events: generate exception constructors
Generate constructors for exceptions using the listed metadata.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I99dc912e4ad0746a14d3053a5653327ae12440dd
show more ...
|
d731d263 | 17-Sep-2024 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: events: create event classes
Generate an equivalent amount of exception class as the `errors.yaml` supported and convert the examples to use it.
Tested:
``` ‣ Type=error Endian=l Flags=
sdbus++: events: create event classes
Generate an equivalent amount of exception class as the `errors.yaml` supported and convert the examples to use it.
Tested:
``` ‣ Type=error Endian=l Flags=1 Version=1 Cookie=9 ReplyCookie=2 Timestamp="Tue 2024-09-17 18:21:35.649674 UTC" Sender=:1.2489 Destination=:1.2495 ErrorName=net.poettering.Calculator.DivisionByZero ErrorMessage="Attempted to divide by zero." UniqueName=:1.2489 MESSAGE "s" { STRING "Attempted to divide by zero."; }; ```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I4b2671838639d1e8be1ccdf655b699a98b9c2116
show more ...
|
88c6a823 | 10-Sep-2024 |
Lei YU <yulei.sh@bytedance.com> |
message: Fix unpack void type
The template unpack<void> is deduced as one argument instead of 0, and results in below compile error: ``` error: variable or field ‘r’ declared void error: return-stat
message: Fix unpack void type
The template unpack<void> is deduced as one argument instead of 0, and results in below compile error: ``` error: variable or field ‘r’ declared void error: return-statement with a value, in function returning ‘void’ [-fpermissive] ```
Fix this by checking void if `sizeof...(Args) == 1` and return void. Also add a unit test case to make sure the code compiles.
Change-Id: I74cca180783645496863393be37215f1d6f4ca02 Signed-off-by: Lei YU <yulei.sh@bytedance.com>
show more ...
|
6ea10e04 | 02-Sep-2024 |
Lei YU <yulei.sh@bytedance.com> |
asio: Fix read into tuple response
Some DBus methods return multiple elements, e.g. `org.freedesktop.resolve1` has a method `ResolveHostname` that returns the result type `a(iiay)st`, which could no
asio: Fix read into tuple response
Some DBus methods return multiple elements, e.g. `org.freedesktop.resolve1` has a method `ResolveHostname` that returns the result type `a(iiay)st`, which could not be "read()" directly as a tuple.
The code was using a tuple to represent the multiple elements, and use `r.read(responseData)` that would result in "Invalid Argument" error.
Fix it by `message::unpack` API to correctly read the response and unpack the multiple elements into the tuple.
Change-Id: I83eb83abf0b079ebf94c1a51a40640533ab04a9f Signed-off-by: Lei YU <yulei.sh@bytedance.com>
show more ...
|
8d40adad | 22-Aug-2024 |
Igor Kononenko <i.kononenko.e@gmail.com> |
transaction: fix -Wconversion c++ warning
Building sdbusplus by meson subproject as a part of external project contains compile warning which can be interpreted as compile error (if external project
transaction: fix -Wconversion c++ warning
Building sdbusplus by meson subproject as a part of external project contains compile warning which can be interpreted as compile error (if external project defines both `-Werror` and `-Wconversion`)
Changing the `Transaction::time` property type to the appropriate `std::time_t` will solve the issue.
Change-Id: I9ab42472ff361aab9487c73d7804531151986e4c Signed-off-by: Igor Kononenko <i.kononenko.e@gmail.com>
show more ...
|
06f265f6 | 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: I4f63258febea27dae710c252033b9151e02be7e8 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
5cee9157 | 30-Jul-2024 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: update to latest commit
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I52e2ff4ea33617fb055981000ce3c2f40faab43e |