5383d760 | 01-Feb-2025 |
Patrick Williams <patrick@stwcx.xyz> |
meson: reformat with meson formatter
Apply the `meson format` results.
Change-Id: I874e2c57075988db53dad8e365c0bf1ac204f81b Signed-off-by: Patrick Williams <patrick@stwcx.xyz> |
4e8c0343 | 22-Jan-2025 |
Amithash Prasasd <amithash@meta.com> |
Add helper method to resolve a log object path
Add a helper method to resolve a previously generated log entry which can be used by other services in conjunction with the `lg2::commit` API.
Change-
Add helper method to resolve a log object path
Add a helper method to resolve a previously generated log entry which can be used by other services in conjunction with the `lg2::commit` API.
Change-Id: Ia1582177b51ca2f0bfecae98f999b5b8f2f61c93 Signed-off-by: Amithash Prasasd <amithash@meta.com>
show more ...
|
236d864b | 18-Nov-2024 |
Amithash Prasasd <amithash@meta.com> |
Install commit.hpp into target include directory
This ensures that users can include commit.hpp which is needed to generate event logs
Change-Id: Ie04479d9a9ef41a3e3533db7bc20d33ff22b38be Signed-of
Install commit.hpp into target include directory
This ensures that users can include commit.hpp which is needed to generate event logs
Change-Id: Ie04479d9a9ef41a3e3533db7bc20d33ff22b38be Signed-off-by: Amithash Prasasd <amithash@meta.com>
show more ...
|
fc14867b | 06-Nov-2024 |
Patrick Williams <patrick@stwcx.xyz> |
lg2: commit: simplify commit functions
Eliminate the template indirection for the commit function in favor of a base-class overload. There was previously a public template specialization of `lg2::c
lg2: commit: simplify commit functions
Eliminate the template indirection for the commit function in favor of a base-class overload. There was previously a public template specialization of `lg2::commit` and a private base-class implementation (in the `details` namespace). The template implementations provided no stronger type-checking, since it was already a concept requiring inheritance from the base-class. The template precluded simple code such as:
```cpp try { //... } catch (const sdbusplus::exception::generated_event_base& e) { lg2::commit(e); } ```
By making the base-class types public, rather than hidden in the details namespace, and removing the templates, the code is simpler and more usable.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: If0a3e1331eff36aec4b9f7e4950636360d59306e
show more ...
|
e001cd79 | 07-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
lg2: commit: add stubs to support new sdbusplus events
Create empty stubs for the commit functions from the new event log design[1].
[1]: https://github.com/openbmc/docs/blob/master/designs/event-l
lg2: commit: add stubs to support new sdbusplus events
Create empty stubs for the commit functions from the new event log design[1].
[1]: https://github.com/openbmc/docs/blob/master/designs/event-logging.md
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I8c0232858f41b875e78d5e41f17c065ca727429d
show more ...
|
4e1456e4 | 03-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
elog: ensure new sdbusplus events cannot be committed directly
sdbusplus events should not be committed in the old way, because they have their metadata directly in the class rather than using the s
elog: ensure new sdbusplus events cannot be committed directly
sdbusplus events should not be committed in the old way, because they have their metadata directly in the class rather than using the side-band metadata YAML (from phosphor-logging). Add compile-time asserts to ensure they cannot be used with the older interfaces.
Tested:
Create a simple test: ``` phosphor::logging::report< sdbusplus::event::xyz::openbmc_project::Logging::Cleared>(); ```
Which fails to compile as follows: ``` In file included from ../test/basic_event_commit.cpp:3: ../lib/include/phosphor-logging/elog.hpp: In instantiation of ‘uint32_t phosphor::logging::report(Args ...) [with T = sdbusplus::event::xyz::openbmc_project::Logging::Cleared; Args = {}; uint32_t = unsigned int]’: ../test/basic_event_commit.cpp:13:66: required from here ../lib/include/phosphor-logging/elog.hpp:205:15: error: static assertion failed: T must NOT be an sdbusplus::generated_event 205 | !std::is_base_of_v<sdbusplus::exception::generated_event<T>, T>, ```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9cfc6915d125545067082a4fff717443aedd1531
show more ...
|
075c7923 | 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: I21d2ca8065f24fd73509229c517f5caf48934b60 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
da063a9c | 13-Jul-2024 |
Patrick Williams <patrick@stwcx.xyz> |
Remove lg2 template deduction guides
Deduction guides for the base 'log' class are unnecessary and unused, and deduction guides for the level-types already exist. Remove the unused ones.
Signed-of
Remove lg2 template deduction guides
Deduction guides for the base 'log' class are unnecessary and unused, and deduction guides for the level-types already exist. Remove the unused ones.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I795ea3a6d453e7a101d9b1d257e1334c894e340b
show more ...
|
b6ed39fa | 26-Feb-2024 |
Patrick Williams <patrick@stwcx.xyz> |
lg2: allow enumeration formatting
A good amount of code is using something like `std::to_underlying` to convert enums to a value for output with lg2. Add support directly in the library.
Tested: M
lg2: allow enumeration formatting
A good amount of code is using something like `std::to_underlying` to convert enums to a value for output with lg2. Add support directly in the library.
Tested: Modified phosphor-health-monitor with one enum with a `to_string` conversion and one without: ``` <7> TYPE=CPU, NAME=CPU SUBTYPE=Enum(1) PATH=, FREQ=1, WSIZE=120 <7> TYPE=CPU, NAME=CPU_Kernel SUBTYPE=Enum(0) PATH=, FREQ=1, WSIZE=120 ```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0644ff00fb7ff9b20daaf4ea5f9564b9b9e83237
show more ...
|
c2c32a2a | 26-Feb-2024 |
Patrick Williams <patrick@stwcx.xyz> |
lg2: allow type output customizations
Allow lg2 output for custom types where the type has a `to_string` function defined per ADL lookup rules.
Tested: Modified phosphor-health-monitor to have a `t
lg2: allow type output customizations
Allow lg2 output for custom types where the type has a `to_string` function defined per ADL lookup rules.
Tested: Modified phosphor-health-monitor to have a `to_string` for local enumerations. ``` <7> TYPE=CPU, NAME=CPU SUBTYPE=CPU PATH=, FREQ=1, WSIZE=120 <7> TYPE=CPU, NAME=CPU_Kernel SUBTYPE=CPU_Kernel PATH=, FREQ=1, WSIZE=120 ```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6850b0bb142f0ef5219a5fc07c2cb4e2c90d5779
show more ...
|
6ddbf69e | 05-Sep-2023 |
Willy Tu <wltu@google.com> |
Remove SDBUSPP_REMOVE_DEPRECATED_NAMESPACE
Fix the code to support new sdbusplus error without SDBUSPP_REMOVE_DEPRECATED_NAMESPACE.
Change-Id: I12713ec1757d3835e1acf07c7abf409ff97615e1 Signed-off-b
Remove SDBUSPP_REMOVE_DEPRECATED_NAMESPACE
Fix the code to support new sdbusplus error without SDBUSPP_REMOVE_DEPRECATED_NAMESPACE.
Change-Id: I12713ec1757d3835e1acf07c7abf409ff97615e1 Signed-off-by: Willy Tu <wltu@google.com>
show more ...
|
7f5e4410 | 23-Jun-2023 |
Patrick Williams <patrick@stwcx.xyz> |
lg2: simplify source_location for clang-16
As of clang-16, `source_location` is fully supported, so we do not need to use the `experimental::source_location` workarounds anymore. Eliminate them and
lg2: simplify source_location for clang-16
As of clang-16, `source_location` is fully supported, so we do not need to use the `experimental::source_location` workarounds anymore. Eliminate them and use `std::source_location` directly rather than the `lg2::source_location` alias.
Tested: Compiled the repository with CXX=clang++.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Iba987ed9580d228781acac630681fda172a6cef7
show more ...
|
ac1ba3f2 | 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: I077deb6e98025e4e8c6abd4d039f9af4db19342b Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
7691290f | 20-Dec-2022 |
George Liu <liuxiwei@inspur.com> |
lg2: Support sdbusplus::message::object_path type
Currently the sdbusplus::message::object_path type is not supported. To print the sdbusplus::message::object_path type, we need to explicitly obtain
lg2: Support sdbusplus::message::object_path type
Currently the sdbusplus::message::object_path type is not supported. To print the sdbusplus::message::object_path type, we need to explicitly obtain the string.
Resolves openbmc/phosphor-logging#25.
Without this patch: ``` sdbusplus::message::object_path objectPath; info("objectPath: {PATH}", "PATH", objectPath.str); ```
With this patch: ``` sdbusplus::message::object_path objectPath; info("objectPath: {PATH}", "PATH", objectPath); ```
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ica2eb19554203af578b8368b4c63c0efc9835857
show more ...
|
c107f191 | 05-Oct-2022 |
Patrick Williams <patrick@stwcx.xyz> |
lg2: minor tweak for readability
clang-format seems to have damaged the readability of one of the C++20 Concepts. Add parens to improve the readability.
Signed-off-by: Patrick Williams <patrick@st
lg2: minor tweak for readability
clang-format seems to have damaged the readability of one of the C++20 Concepts. Add parens to improve the readability.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0d9e591103bca0ec1d423559fffb4e2a972c3d61
show more ...
|
2544b419 | 04-Oct-2022 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update with latest
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I329396457b83bb2eb8740629b4ac1fbe9106bced |
45e83521 | 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: Ibc25db433a6926f7ee43ea83312c3ac14f480c33
show more ...
|
31d78f77 | 07-Feb-2022 |
Stanley Chu <yschu@nuvoton.com> |
Fix wrong type of TRANSACTION_ID in journal metadata
In the log API, it prints message to systemd journal and also stores TRANSACTION_ID metadata with its value as %lld. However, the transaction id
Fix wrong type of TRANSACTION_ID in journal metadata
In the log API, it prints message to systemd journal and also stores TRANSACTION_ID metadata with its value as %lld. However, the transaction id is acquired from sdbusplus::server:: transaction::get_id(), which is a uint64_t. The type of TRANSACTION_ID metadata should be changed to %llu, otherwise phosphor::logging::internal::Manager::_commit() may not find the matched journal entry.
Signed-off-by: Stanley Chu <yschu@nuvoton.com> Change-Id: I2a70ae836ae33006a043569d2e3a692fcece7303
show more ...
|
87001e46 | 10-Sep-2021 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: apply clang-12 changes
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Id432a670d81a53425940fe36b2299f8781ecc3be |
36a34693 | 28-Aug-2021 |
Patrick Williams <patrick@stwcx.xyz> |
lg2: conversion: reduce std::forward clutter
It was observed in another repository that if the same std::string was passed twice into lg2 function that clang-tidy would complain about a potential us
lg2: conversion: reduce std::forward clutter
It was observed in another repository that if the same std::string was passed twice into lg2 function that clang-tidy would complain about a potential use-after-realloc due to the 'string.data()' call for the first instance followed by a 'std::forward' on the second instance. I don't think there was actually any issue with that, but we don't really leverage r-value references in this code because there is never an opportunity to 'std::move' any contents. Remove the clutter of 'std::forward' everywhere and simply rely on l-value references, which is all the code needs anyhow. This also placated clang-tidy's memory use checker.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I89582e2f868732e9a7a08a7a24f858b9130d56bc
show more ...
|
e917611a | 28-Aug-2021 |
Patrick Williams <patrick@stwcx.xyz> |
lg2: fix clang static_assert fire
There are variants of the conversion functions that are in place simply to provide better diagnostics to users when they pass the wrong content into a `lg2::log` fu
lg2: fix clang static_assert fire
There are variants of the conversion functions that are in place simply to provide better diagnostics to users when they pass the wrong content into a `lg2::log` function. Most of these use `static_assert`s which can only fire when the compiler is able to deduce the appropriate types, and thus the function is incorrectly being used.
clang happens to be smarter than that. Even when it cannot deduce the types necessary to fully instantiate the function, the asserts can fire if all of the types necessary for the `static_assert` were deduced. Thus a `static_assert` like this can trigger:
static_assert(!std::is_same<foo, foo>, ...)
Workaround this by ensuring that at least one un-deduced type is included in all of these diagnostic-function-only `static_assert`.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I025e08661c6250c886803dfc308ad6acbd7e57cb
show more ...
|
d7888592 | 28-Aug-2021 |
Patrick Williams <patrick@stwcx.xyz> |
lg2: fix clang issue on nullptr_t
clang-tidy is more pedantic that nullptr_t is actually in std and fails unless it is specified as such.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-
lg2: fix clang issue on nullptr_t
clang-tidy is more pedantic that nullptr_t is actually in std and fails unless it is specified as such.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I74aa5a5af17fd5d4610fed4707564576c6ac22f1
show more ...
|
a91a62b0 | 28-Aug-2021 |
Patrick Williams <patrick@stwcx.xyz> |
lg2: workaround clang-tidy's lack of source_location
clang/clang-tidy do not currently support C++20 source_location, which causes repositories attempting to use lg2 but with clang-tidy enabled to f
lg2: workaround clang-tidy's lack of source_location
clang/clang-tidy do not currently support C++20 source_location, which causes repositories attempting to use lg2 but with clang-tidy enabled to fail with lots of missing-type errors. Workaround this by detecting the situation and falling back to use std::experimental::source_location.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Idb5a555243568c394505890035423d39e9b22407
show more ...
|
c4845d9a | 27-Aug-2021 |
Patrick Williams <patrick@stwcx.xyz> |
lg2: conversion: support std::filesystem::path natively
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ied02e149fd471e25ef1a07f05e437204d2d770cc |
b1811b31 | 26-Aug-2021 |
Patrick Williams <patrick@stwcx.xyz> |
lg2: minor size optimization in do_log
Push the calculation of the number of logging arguments into the variadic 'do_log' function rather than calculate it at the lg2 call site. This reduces each c
lg2: minor size optimization in do_log
Push the calculation of the number of logging arguments into the variadic 'do_log' function rather than calculate it at the lg2 call site. This reduces each call site by a few instructions.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ic8fcbdf65fb34d251d8110c5bbd05c2e20c66c18
show more ...
|