ea0e5d27 | 11-Nov-2024 |
Ed Tanous <etanous@nvidia.com> |
Fix compile error on boost 1.86
Boost 1.86 shows a compiler error which is holding up the rebase here. The mapper extends std::vector, because it results in smaller binary sizes compared to boost::v
Fix compile error on boost 1.86
Boost 1.86 shows a compiler error which is holding up the rebase here. The mapper extends std::vector, because it results in smaller binary sizes compared to boost::vector. It's not clear if this is the problem, or if there's something else amiss within container. Triaging the real root cause isn't important to this use case.
There are a few reported bugs and changes that might be related[1][2].
It's not clear which one would've broken try_emplace in this case, nor is it worth the effort to resolve.
This patchset replaces try_emplace calls with emplace calls. In theory these are slightly less efficient, but considering that map construction is a cold path, it's not terribly important that it be efficient.
[1] https://github.com/boostorg/container/issues/292 [2] https://github.com/boostorg/container/issues/280
Change-Id: I30d176022d2cec45430a50dc02c84666541fb4d7 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
7a93d516 | 13-Sep-2024 |
Myung Bae <myungbae@us.ibm.com> |
Return empty paths if no SubTreePathsById is found
`getAssociatedSubTreePaths()` returns the empty paths if there are no associated subtrees, and bmcweb uses it to differentiate from the error.
How
Return empty paths if no SubTreePathsById is found
`getAssociatedSubTreePaths()` returns the empty paths if there are no associated subtrees, and bmcweb uses it to differentiate from the error.
However, `getAssociatedSubTreePathsById()` (which is introduced by [1]) returns NotFound error for the case. It would be more appropriate to match its behavior with `getAssociatedSubTreePaths()`.
Tested: - unit-test is succeeded for good and bad cases
[1] https://gerrit.openbmc.org/c/openbmc/phosphor-objmgr/+/70699
Change-Id: I84680b1b39ba8ade94ea6fdb7dae280505e5c050 Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
c363323e | 09-Apr-2024 |
Lakshmi Yadlapati <lakshmiy@us.ibm.com> |
mapper: Add GetAssociatedSubTreePathsById and GetAssociatedSubTreeById
dbus-interface change in: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/69999
This commit implements two new
mapper: Add GetAssociatedSubTreePathsById and GetAssociatedSubTreeById
dbus-interface change in: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/69999
This commit implements two new methods: GetAssociatedSubTreePathsById and GetAssociatedSubTreeById. These methods retrieve the paths of associated endpoints corresponding to the provided identifier, filtering based on their association with specified endpoint interfaces.
GetAssociatedSubTreePathsById returns the D-Bus paths of associated endpoints, while GetAssociatedSubTreeById retrieves a dictionary of D-Bus paths of associated endpoints mapped to corresponding services associated with the provided identifier.
Tested: ''' busctl call -j "xyz.openbmc_project.ObjectMapper" "/xyz/openbmc_project/object_mapper" \ "xyz.openbmc_project.ObjectMapper" "GetAssociatedSubTreePathsById" ssassas \ "chassis" \ "/xyz/openbmc_project/inventory" \ 1 "xyz.openbmc_project.Inventory.Item.Chassis" \ "powered_by" \ 1 "xyz.openbmc_project.Inventory.Item.PowerSupply" { "type" : "as", "data" : [ [ "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0", "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply1", "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply2", "/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply3" ] ] } '''
Another example.
``` busctl call -j xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/object_mapper \ xyz.openbmc_project.ObjectMapper GetAssociatedSubTreePathsById ssassas \ disk_backplane0 \ /xyz/openbmc_project/inventory \ 1 xyz.openbmc_project.Inventory.Item.FabricAdapter \ connecting \ 1 xyz.openbmc_project.Inventory.Connector.Port { "type" : "as", "data" : [ [ "/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/dp0_connector0", "/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/dp0_connector1", "/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/dp0_connector2", "/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/dp0_connector3", "/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/dp0_connector4", "/xyz/openbmc_project/inventory/system/chassis/motherboard/disk_backplane0/dp0_connector5" ] ] } ```
Change-Id: Id55a9b41fe70f7204543d92b5396888f6914a1d4 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com> Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
8c25006c | 23-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
handler: fix undefined behavior
Saving a reference to a temporary returned from a function call is undefined behavior and subverts RVO. Remove the `&` so these become local variables.
Signed-off-b
handler: fix undefined behavior
Saving a reference to a temporary returned from a function call is undefined behavior and subverts RVO. Remove the `&` so these become local variables.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I8e7da30fddef808dfe7ee323d7f91a7c2a2cdeb6
show more ...
|
9052ebd3 | 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: Ic68b91e23738cafe198c50f40e46d4163bda02b6 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
47b68cbc | 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: Ibc0976e16acb6163431698832a461e9fc7335448 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
1a19e6aa | 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: I9252bdd2509e5a9cff31fce9be31291f63b3a5cc Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
bd441717 | 15-Feb-2023 |
Patrick Williams <patrick@stwcx.xyz> |
mapper-wait: add service dependency
Even though ObjectMapper is dbus-activated, it takes long enough to start up that the dbus client operation times out. This causes a whole bunch of failed servic
mapper-wait: add service dependency
Even though ObjectMapper is dbus-activated, it takes long enough to start up that the dbus client operation times out. This causes a whole bunch of failed services on boot of the BMC. Add an explicit dependency back on the service in order to give the service time to start up.
Tested: Applied on Bletchley and see no restarts of the various mapper-wait invocations now.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I473a8f251906a8267e2c44600b6802adfea1fd0e
show more ...
|
670edd12 | 15-Feb-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update with latest
Copy the latest clang-format and apply to the repository.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I10a3fe64d4ca77601e6855daf46954579312c7df |
a99e109c | 03-Feb-2023 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
lint: update .clant-format and run
Change-Id: If9cfc42ca96517a4df2c59c130c2e22a2a443467 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> |
2ec9157f | 03-Jun-2022 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
mapper: install systemd unit, dbus conf files
The same systemd and dbus unit/configuration files can work for everyone now, so ship them. Enable dbus activation, add unit file templates, and move m
mapper: install systemd unit, dbus conf files
The same systemd and dbus unit/configuration files can work for everyone now, so ship them. Enable dbus activation, add unit file templates, and move mapperx to libexec where it belongs.
Change-Id: Ieb021889605767ffdb9d72faad5f5b856312b935 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
58881d0b | 02-Oct-2022 |
Willy Tu <wltu@google.com> |
mapper: Add Associated subtree method definition
dbus-interface change in: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/57821
Create new mapper function to make subtree call and
mapper: Add Associated subtree method definition
dbus-interface change in: https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/57821
Create new mapper function to make subtree call and association call at the same time. With the association definition, we will have more endpoints to fetch and verify that it is actually the resource that we are looking for. We need to verify that it has the expected interface to confirm that it is right device. In the current workflow this will take two dbus calls to the mapper to get the association and the subtree.
This change aims to reduce that down to one by combining the two operations. It will not significant performance increase for the daemons, but it can help reduce the load on the dbus-broker.service.
Tested: ``` Normal Call: busctl call "xyz.openbmc_project.ObjectMapper" \ "/xyz/openbmc_project/object_mapper" \ "xyz.openbmc_project.ObjectMapper" "GetSubTreePaths" sias \ "/xyz/openbmc_project/inventory" 0 1 \ "xyz.openbmc_project.Inventory.Item.Storage" as 4 "/xyz/openbmc_project/inventory/storage_0" "/xyz/openbmc_project/inventory/storage_1" "/xyz/openbmc_project/inventory/storage_4" "/xyz/openbmc_project/inventory/storage_3"
Associated Call: (Only 0 and 1 is associated to the chassis) busctl call "xyz.openbmc_project.ObjectMapper" \ "/xyz/openbmc_project/object_mapper" \ "xyz.openbmc_project.ObjectMapper" "GetAssociatedSubTreePaths" ssias \ "/xyz/openbmc_project/inventory/chassis_0/storage" \ "/xyz/openbmc_project/inventory" 0 1 "xyz.openbmc_project.Inventory.Item.Storage" as 2 "/xyz/openbmc_project/inventory/storage_0" "/xyz/openbmc_project/inventory/storage_1" ```
Change-Id: Ib532e660cf20b9efc83045fb1cbd9143d0c1841e Signed-off-by: Willy Tu <wltu@google.com>
show more ...
|
aba14d3d | 31-Jan-2023 |
Willy Tu <wltu@google.com> |
test: Add dbus handler unit tests
Created unit tests for all of the object mapper dbus handlers.
Refactor the handlers to handler.cpp to allow unit testing. Also updated to use std::set_intersectio
test: Add dbus handler unit tests
Created unit tests for all of the object mapper dbus handlers.
Refactor the handlers to handler.cpp to allow unit testing. Also updated to use std::set_intersection.
Change-Id: Ib87ab81f949d27f7dab55899d3e8d380e43bda04 Signed-off-by: Willy Tu <wltu@google.com>
show more ...
|
60ffc244 | 02-Dec-2022 |
William A. Kennington III <wak@google.com> |
mapperx: Use lambdas and move
This reduces the number of type-erased copies we have to store and makes the type work with interface changes to the underlying stored callback type.
Change-Id: Ieccd0
mapperx: Use lambdas and move
This reduces the number of type-erased copies we have to store and makes the type work with interface changes to the underlying stored callback type.
Change-Id: Ieccd0e7f182177e47e8d8d4ef836521109f1a2e7 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
5b4357da | 12-Oct-2022 |
Kallas, Pawel <pawel.kallas@intel.com> |
add Associations endpoints change delay timer
When multiple associations that point to the same interface are created, each change (adding or removing one) leads to updating "endpoints" property on
add Associations endpoints change delay timer
When multiple associations that point to the same interface are created, each change (adding or removing one) leads to updating "endpoints" property on dbus. This property update is time consuming with many endpoints already present, because each update needs to send the whole list of current elements plus/minus one. With a lot of changes in short time it can cause the service to be unresponsive. This change adds timer to delay updating dbus property. This way many associations updates can be aggregated into single dbus property update.
Tested: Ran on hardware with dbus sensor tester. 4000 created sensors with interfaces are processed within 10 seconds. Time before the change was above 2 minutes.
Signed-off-by: Kallas, Pawel <pawel.kallas@intel.com> Change-Id: I1083c027ab12238249cffc67fb29a8ffef6baf83
show more ...
|
48248203 | 10-Oct-2022 |
Patrick Williams <patrick@stwcx.xyz> |
ignore unique-name dbus connections
Processes which only expose unique-name connections are dbus-clients and do not need to have their dbus tree interrogated. It is also common practice for a daemo
ignore unique-name dbus connections
Processes which only expose unique-name connections are dbus-clients and do not need to have their dbus tree interrogated. It is also common practice for a daemon to create a bus connection, create their objects, and then claim a well-known name. By having objmgr look at the unique-name connections from those daemons, objmgr is getting too early a look into the daemon.
Filter out the unique-name connections from the dbus signal match.
I ran this on Bletchley hardware and observed a small boot time performance gain (<1s) which was difficult to distinguish from noise. On some machines with heavy script-driven `busctl` operations, this was reported to have some noticeable performance benefit.
Tested: Ran on Bletchley and observed no change in behavior for mapper-wait, entity-manager, etc.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I93bde89409f049682fb7c67ab1fe45b7b9cf795a
show more ...
|
1e94e60b | 02-Jun-2022 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
mapper: remove configurable service allowlists
Remove the ability to specify an allow list at runtime. Instead, introspect any DBus service except those that start with org.freedesktop. This remov
mapper: remove configurable service allowlists
Remove the ability to specify an allow list at runtime. Instead, introspect any DBus service except those that start with org.freedesktop. This removes the need for argument parsing code and complex bitbake metadata.
Skip org.freedesktop because applications (OpenBMC or otherwise) should access org.freedesktop services directly and not indirectly via the OpenBMC mapper.
Change-Id: I83038a121580dcde2a2b3b1f994b3066cc9d955f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
86d2880e | 11-Jul-2022 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
treewide: prefer std::starts_with to boost
Replace boost versions of starts_with and ends_with with the std versions provided with c++20.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Ch
treewide: prefer std::starts_with to boost
Replace boost versions of starts_with and ends_with with the std versions provided with c++20.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I97218c607ff04aedad490b3af428071b0fa75615
show more ...
|
f6ebfc73 | 07-Jul-2022 |
Brandon Kim <brandonkim@google.com> |
main: Fix getSubTree & getSubTreePaths partial match
Due to us popping out the trailing "/" in our "reqPath", partial matches satisfied the "boost::starts_with(" searches for paths - leading to "cor
main: Fix getSubTree & getSubTreePaths partial match
Due to us popping out the trailing "/" in our "reqPath", partial matches satisfied the "boost::starts_with(" searches for paths - leading to "core1X" for example, matching a reqPath of "core1" or "core1/".
Since we do not want to return the base reqPath anyway, add a trailing "/" in the reqPath for the match to ensure complete match.
Tested: dbus-send --system --print-reply --dest=xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper.GetSubTreePaths string:"/xyz/openbmc_oject/inventory/system/chassis/motherboard/cpu0/core1" int32:0 array:string:"xyz.openbmc_project.Inventory.Item.CpuThread"
Without the fix: array [ string "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core1/thread0" string "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core11/thread0" string "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core12/thread0" string "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core13/thread0" string "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core14/thread0" string "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core15/thread0" string "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core16/thread0" string "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core17/thread0" string "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core18/thread0" string "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core19/thread0" ]
With the fix: array [ string "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core1/thread0" ]
Similar results with GetSubTree, results not pasted as it's too long: dbus-send --system --print-reply --dest=xyz.openbmc_project.ObjectMapper /xyz/openbmc_project/object_mapper xyz.openbmc_project.ObjectMapper.GetSubTree string:"/xyz/openbmc_proje/inventory/system/chassis/motherboard/cpu0/core1" int32:0 array:string:"xyz.openbmc_project.Inventory.Item.CpuThread"
------------- Also verified that "depth" remained the same using print outs:
Before change: mapperx[12580]: thisPath: /xyz/openbmc_project/sensors/power mapperx[12580]: reqPath: mapperx[12580]: thisDepth: 4
mapperx[12580]: thisPath: /xyz/openbmc_project/sensors/temperature mapperx[12580]: reqPath: /xyz/openbmc_project mapperx[12580]: thisDepth: 2
After: mapperx[30959]: thisPath: /xyz/openbmc_project/network mapperx[30959]: reqPath: / mapperx[30959]: thisDepth: 3
mapperx[30959]: thisPath: /xyz/openbmc_project/inventory/system/board mapperx[30959]: reqPath: /xyz/openbmc_project/inventory/system/ mapperx[30959]: thisDepth: 1
Signed-off-by: Brandon Kim <brandonkim@google.com> Change-Id: If488402a3839de21c50b4585e51fa156016e768d
show more ...
|
cc8070ba | 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: I1c3acea60ea58b8a0f9a76fd32b5d0d007bf1a16
show more ...
|
26ed4a1e | 13-Jul-2022 |
Ed Tanous <edtanous@google.com> |
Add boost wrap file
Recent changes make us incompatible with older versions of boost (1.74 in my testing). Like we do elsewhere, add a wrapfile for boost.
At the same time, the tests were missing
Add boost wrap file
Recent changes make us incompatible with older versions of boost (1.74 in my testing). Like we do elsewhere, add a wrapfile for boost.
At the same time, the tests were missing an explicit #include for boost, so even when the above patch was applied, it still doesn't build. Add an explicit dependency.
Tested: meson buildlocal --buildtype=debug && ninja -C buildlocal
Succeeds. Should have no impact to yocto builds.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I20543fd184491dc138a2e145945eb71051c4cd52
show more ...
|
82720f07 | 08-Jul-2022 |
Brandon Kim <brandonkim@google.com> |
main: Match getSubTrees* to GetAncestors pattern
getSubTrees, getSubTreePaths and GetAncestors have a code snippet that's very similar. Unify them so that they are easier to read.
For the ret vecto
main: Match getSubTrees* to GetAncestors pattern
getSubTrees, getSubTreePaths and GetAncestors have a code snippet that's very similar. Unify them so that they are easier to read.
For the ret vector being declared further down, it's better practice to declare variables closer to where it's going to be used since we wouldn't have needed ret if we error out early.
Tested: The code is only syntatically different. Tested with the following commit in more depth.
Signed-off-by: Brandon Kim <brandonkim@google.com> Change-Id: Ib449ab4ffab502c801040cf6bce28b30507d8e0b
show more ...
|
964681ca | 08-Jul-2022 |
Ed Tanous <edtanous@google.com> |
Modernize mapper core types
There's a number of best practices that have evolved in our use of flat_maps and flat_sets since this code was originally written.
First, add std::less<> to the Compare
Modernize mapper core types
There's a number of best practices that have evolved in our use of flat_maps and flat_sets since this code was originally written.
First, add std::less<> to the Compare template argument. The default for this is std::less<Key> which limits find() calls (and any lookup for that matter) to only supporting std::string. Using std::less<> allows lookup by std::string_view, which can prevent some copies in some cases.
Next, add std::vector<...> to the types under the AllocatorOrContainer template arg. Per our coding standard, this overrides the default of using boost::vector, and replaces it with std::vector, which, although it has a very similar interface, tends to optimize better, and be better supported overall.
The rest of this patch updates a couple places where the various types were specifically hardcoded, so it moves to using the various using declarations.
Tested: Unit tests; Next patch tests this more fully.
Change-Id: I11e8ecb669f31193c55dda344b25d3fa5d191502 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
d554232b | 02-Jun-2022 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
mapper: remove service deny list feature
This feature has existed for years, but remains unused. Drop the dead code.
Change-Id: I1b0b6f7fee0da30a3e36e1d151e70e1039fe2c7b Signed-off-by: Brad Bishop
mapper: remove service deny list feature
This feature has existed for years, but remains unused. Drop the dead code.
Change-Id: I1b0b6f7fee0da30a3e36e1d151e70e1039fe2c7b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
cd7bf529 | 02-Jun-2022 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
mapper: remove unused ifaceAllowList
This feature was left unimplemented in the switch from the python to the c++ mapper and noone seems to have noticed. Drop the remaining references to it.
Signe
mapper: remove unused ifaceAllowList
This feature was left unimplemented in the switch from the python to the c++ mapper and noone seems to have noticed. Drop the remaining references to it.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I60dab879503cdf2c7abd152d6794570f15ee431a
show more ...
|