#
d7857201 |
| 28-Jan-2025 |
Ed Tanous <etanous@nvidia.com> |
Fix includes
Clang-tidy misc-include-cleaner appears to now be enforcing significantly more headers than previously. That is overall a good thing, but forces us to fix some issues. This commit is
Fix includes
Clang-tidy misc-include-cleaner appears to now be enforcing significantly more headers than previously. That is overall a good thing, but forces us to fix some issues. This commit is largely just taking the clang-recommended fixes and checking them in. Subsequent patches will fix the more unique issues.
Note, that a number of new ignores are added into the .clang-tidy file. These can be cleaned up over time as they're understood. The majority are places where boost includes a impl/x.hpp and x.hpp, but expects you to use the later. include-cleaner opts for the impl, but it isn't clear why.
Change-Id: Id3fdd7ee6df6c33b2fd35626898523048dd51bfb Signed-off-by: Ed Tanous <etanous@nvidia.com> Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
#
40e9b92e |
| 10-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Use SPDX identifiers
SPDX identifiers are simpler, and reduce the amount of cruft we have in code files. They are recommended by linux foundation, and therefore we should do as they allow.
This pa
Use SPDX identifiers
SPDX identifiers are simpler, and reduce the amount of cruft we have in code files. They are recommended by linux foundation, and therefore we should do as they allow.
This patchset does not intend to modify any intent on any existing copyrights or licenses, only to standardize their inclusion.
[1] https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects
Change-Id: I935c7c0156caa78fc368c929cebd0f068031e830 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
7da633f0 |
| 02-Dec-2024 |
Ed Tanous <etanous@nvidia.com> |
Clang-tidy updates for 19
Update to add new checks that are now available to us. Fix the minor issues we have. A few of our checks that we previously had enabled have been renamed, so remove those
Clang-tidy updates for 19
Update to add new checks that are now available to us. Fix the minor issues we have. A few of our checks that we previously had enabled have been renamed, so remove those from the file as well.
Change-Id: Idbbfc3cb7ba42ac780e557554d7ae8ab190e7551 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
56b81992 |
| 02-Dec-2024 |
Ed Tanous <etanous@nvidia.com> |
Make message registries use 2 digit versions
Redfish specification, section 9.5.11.2 says:
The MessageId property value shall be in the format: <MessageRegistryPrefix>.<MajorVersion>.<MinorVersion>
Make message registries use 2 digit versions
Redfish specification, section 9.5.11.2 says:
The MessageId property value shall be in the format: <MessageRegistryPrefix>.<MajorVersion>.<MinorVersion>.<MessageKey>
bmcweb in certain places has incorrectly used the 3 digit version instead of the 2 digit version. This commit fixes that by modifying the parse_registries script to generate 3 separate struct entries to represent the registry version, and parse them where appropriate.
MessageRegistryFileCollection uses the 3 digit version. No behavior changes. Message/event log entries use the 2 digit version. This will cause a MessageId change from: Base.1.19.0.InternalError to Base.1.19.InternalError
This is a breaking change, so a new option to allow the old behavior is provided.
Tested: Redfish Service validator passes. Heartbeat events on EventService show 2 digit versions.
Change-Id: I4165e994f73e200f13bed8ea76cb58bee2b69faa Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
6be832e2 |
| 10-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Remove duplicated block comments
Static analysis flags that these two comments are redundant[1], which seem to be duplicated a lot in copyright headers. Although there is a larger discussion that c
Remove duplicated block comments
Static analysis flags that these two comments are redundant[1], which seem to be duplicated a lot in copyright headers. Although there is a larger discussion that can likely be had.
[1] https://sonarcloud.io/project/issues?issueStatuses=OPEN%2CCONFIRMED&id=edtanous_bmcweb&open=AY9_HYjgKXKyw1ZFwgVP
Tested: Comment change only. Code compiles.
Change-Id: Ia960317761f558a87842347ca0b5f3da63f8e730 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
478b7adf |
| 15-Jul-2024 |
Ed Tanous <etanous@nvidia.com> |
Remove IWYU pragmas
These were added as part of d5c80ad9c07b94465d8ea62d2b6f87c30cac765e: test treewide: iwyu
Since then, Nan hasn't been very active on the project, and to my knowledge, since the
Remove IWYU pragmas
These were added as part of d5c80ad9c07b94465d8ea62d2b6f87c30cac765e: test treewide: iwyu
Since then, Nan hasn't been very active on the project, and to my knowledge, since the initial run, we've never used IWYU again.
clang-include-cleaner seems to work well without needing these pragmas, and is what we're using, even if it's less useful than IWYU.
Remove all mention of IWYU.
Tested: Code compiles.
Change-Id: I06feedeeac9a114f5bdec81d59ca83223efd8aa7 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
bd79bce8 |
| 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: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
17c47245 |
| 08-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Move logging args
Args captured by logging functions should be captured by rvalue, and use std::forward to get perfect forwarding. In addition, separate out the various std::out lines.
While we're
Move logging args
Args captured by logging functions should be captured by rvalue, and use std::forward to get perfect forwarding. In addition, separate out the various std::out lines.
While we're here, also try to optimize a little. We should ideally be writing each log line to the output once, and ideally not use iostreams, which induce a lot of overhead.
Similar to spdlog[1] (which at one point this codebase used), construct the string, then call fwrite and fflush once, rather than calling std::cout repeatedly.
Now that we don't have a dependency on iostreams anymore, we can remove it from the places where it has snuck in.
Tested: Logging still functions as before. Logs present.
[1] https://github.com/gabime/spdlog/blob/27cb4c76708608465c413f6d0e6b8d99a4d84302/include/spdlog/sinks/stdout_sinks-inl.h#L70C7-L70C13
Change-Id: I1dd4739e06eb506d68989a066d122109b71b92cd Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
d1d411f9 |
| 11-Apr-2022 |
Sui Chen <suichen@google.com> |
Move getMessage and getMessageFromRegistry to cpp and add test
This change moves getMessage and getMessageFromRegistry to a .cpp file so that they can be easily tested.
Tested: Unit test passes Sig
Move getMessage and getMessageFromRegistry to cpp and add test
This change moves getMessage and getMessageFromRegistry to a .cpp file so that they can be easily tested.
Tested: Unit test passes Signed-off-by: Sui Chen <suichen@google.com> Change-Id: Ia9fc91e5a47036198bf013ff3ea21ea9f6d5259a
show more ...
|
#
26ccae32 |
| 16-Feb-2023 |
Ed Tanous <edtanous@google.com> |
Pass string views by value
string_view should always be passed by value; This commit is a sed replace of the code to make all string_views pass by value, per general coding guidelines[1].
[1] http
Pass string views by value
string_view should always be passed by value; This commit is a sed replace of the code to make all string_views pass by value, per general coding guidelines[1].
[1] https://quuxplusone.github.io/blog/2021/11/09/pass-string-view-by-value/
Tested: Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I55b342a29a0fbfce0a4ed9ea63db6014d03b134c
show more ...
|
#
2e30bc2d |
| 09-Sep-2022 |
Krzysztof Grobelny <krzysztof.grobelny@intel.com> |
Fix function getLogFromRegistry
Function did not use result returned from fillMessageArgs, which caused message to contain %1, %2 instead of actual arguments passed to function
Tested: - Send inv
Fix function getLogFromRegistry
Function did not use result returned from fillMessageArgs, which caused message to contain %1, %2 instead of actual arguments passed to function
Tested: - Send invalid post which caused error message to appear in response. %1 and %2 were property replaced with this fix.
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com> Change-Id: If256afb1832f42783b94febde51986432e6922ca
show more ...
|
#
65e4f1f7 |
| 08-Feb-2022 |
Ed Tanous <edtanous@google.com> |
Optimize resource event schema
Very similar to how the base registry was optimized for binary size, optimize the resource event registry, by making the getLogFromRegistry a common method for both re
Optimize resource event schema
Very similar to how the base registry was optimized for binary size, optimize the resource event registry, by making the getLogFromRegistry a common method for both registries.
Tested: Only usage of these calls appears to be in management console. The code and pattern we're using here is well unit tested, and seems reasonable that we could rely on the compile time checks, but if not, I could use some help testing this.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I9cc442966df2ed301b14547727a5eb727c0c3a29
show more ...
|
#
80f595e7 |
| 14-Feb-2022 |
Ed Tanous <edtanous@google.com> |
Simplify fillMessageArgs
The aforementioned function does a lot of reconstruction of strings as args are filled in. This results in the end of the string being copied many times (N). Replace the a
Simplify fillMessageArgs
The aforementioned function does a lot of reconstruction of strings as args are filled in. This results in the end of the string being copied many times (N). Replace the algorithm with one that builds a new string, using reserve (which is good practice) and is also capable of returning errors in the case of bad entries. fillMessageArgs now returns a string instead of trying to do things in place, which avoids the initial std::string construction, so we should be net the same here.
Given this new algorithm can now detect failures in parsing (ie, trying to parse %1 with no arguments) add unit tests for coverage of that, and modify event manager slightly to handle errors.
Tested: Unit tests pass. Pretty good coverage of this stuff.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I16f28a2ac78580fb35266561f5ae38078b471989
show more ...
|
#
d5c80ad9 |
| 10-Jul-2022 |
Nan Zhou <nanzhoumails@gmail.com> |
test treewide: iwyu
These changes are done by running iwyu manually under clang14.
Suppressed some obvious impl or details headers. Kept the recommended public headers.
IWYU can increase readabili
test treewide: iwyu
These changes are done by running iwyu manually under clang14.
Suppressed some obvious impl or details headers. Kept the recommended public headers.
IWYU can increase readability, make maintenance easier, and avoid errors in some cases. See details in https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/WhyIWYU.md.
This commit also uses its best effort to correct obvious errors through iwyu pragma. See reference here: https://github.com/include-what-you-use/include-what-you-use#how-to-correct-iwyu-mistakes
Tested: unit test passed.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I983b6f75601707cbb0f2f04546c3362ff4ba7fee
show more ...
|
#
5f2b84ee |
| 08-Feb-2022 |
Ed Tanous <edtanous@google.com> |
Drop message severity
In the way we store the message registry, we store both Severity and MessageSeverity. Severity as a field is deprecated, and in every case in every registry both fields have t
Drop message severity
In the way we store the message registry, we store both Severity and MessageSeverity. Severity as a field is deprecated, and in every case in every registry both fields have the same value. We shouldn't duplicate data in that way. This commit changes the parse_registries.py script to stop producing the Severity field into the struct. The few uses we have left are moved over to use MessageRegistry.
Tested:
Redfish service validator shows no errors on the /redfish/v1/Registries tree. Other errors present that were there previously and are unchanged.
This saves a trivial amount: about 1kB on our compressed binary size.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ibbaf533dc59eb08365d6ed309aba16b54bc40ca1
show more ...
|
#
fffb8c1f |
| 08-Feb-2022 |
Ed Tanous <edtanous@google.com> |
Change message_registries namespace to registries
The message_registries namespace is overly wordy, and results in very long defines. Doing this one minor change reduces the code by 50 lines. This
Change message_registries namespace to registries
The message_registries namespace is overly wordy, and results in very long defines. Doing this one minor change reduces the code by 50 lines. This seems worthwhile.
Tested: Unit tests pass. Namespace change only.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib1401580b3fa47596eb56cdc86e60eeeb1c2f952
show more ...
|
#
c5ba4c27 |
| 07-Feb-2022 |
Ed Tanous <edtanous@google.com> |
Abstract fillMessageArgs and unit test it
EventService has a routine for taking a message registry entry and populate it with data. This ideally should be part of the message registry namespace, no
Abstract fillMessageArgs and unit test it
EventService has a routine for taking a message registry entry and populate it with data. This ideally should be part of the message registry namespace, not EventService, as it could be useful to later patchsets. So break out the method, and write some unit tests to ensure that it can be relied upon in the future.
Tested: Unit tests ran and passing.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I052d9492f306b63fb72cbf78286370ed0c477430
show more ...
|
#
e7808c93 |
| 08-Jul-2020 |
Gunnar Mills <gmills@us.ibm.com> |
Move registries to v1_4_0.MessageRegistry
This implements the MessageSeverity property which tools and users should use instead of the deprecated Severity property.
Since the registries use common
Move registries to v1_4_0.MessageRegistry
This implements the MessageSeverity property which tools and users should use instead of the deprecated Severity property.
Since the registries use common infrastructure, easiest if just bumped together and now allows grabbing the latest when implementing a new registry, e.g. ResourceEvent.
Implement this new required property, MessageSeverity, in the openbmc registry. Follow Redfish registries in having both MessageSeverity and Severity.
Modified parse_registries.py to look at latest Base and TaskEvent registries and ran parse_registries.py.
Tested: Built and validator passes. See new registries: curl -k https://$bmc/redfish/v1/Registries/Base { "@odata.id": "/redfish/v1/Registries/Base", "@odata.type": "#MessageRegistryFile.v1_1_0.MessageRegistryFile", "Description": "DMTF Base Message Registry File Location", "Id": "Base", "Languages": [ "en" ], "Languages@odata.count": 1, "Location": [ { "Language": "en", "PublicationUri": "https://redfish.dmtf.org/registries/Base.1.8.1.json", "Uri": "/redfish/v1/Registries/Base/Base" } ], ...
curl -k https://$bmc/redfish/v1/Registries/Base/Base { "@Redfish.Copyright": "Copyright 2014-2020 DMTF. All rights reserved.", "@odata.type": "#MessageRegistry.v1_4_0.MessageRegistry", "Description": "This registry defines the base messages for Redfish", "Id": "Base.1.8.1", "Language": "en", "Messages": { "AccessDenied": { "Description": "Indicates that while attempting to access, connect to or transfer to/from another resource, the service denied access.", "Message": "While attempting to establish a connection to %1, the service denied access.", "MessageSeverity": "Critical", "NumberOfArgs": 1, "ParamTypes": [ "string" ], "Resolution": "Attempt to ensure that the URI is correct and that the service has the appropriate credentials.", " ...
Change-Id: I6495af0e02036ea527036d942d6b6b5f55178bb2 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
#
271584ab |
| 09-Jul-2019 |
Ed Tanous <ed.tanous@intel.com> |
Fix a bunch of warnings
using the list of warnings from here: https://github.com/lefticus/cppbestpractices/blob/e73393f25a85f83fed7399d8b65cb117d00b2231/02-Use_the_Tools_Available.md#L100
Seems lik
Fix a bunch of warnings
using the list of warnings from here: https://github.com/lefticus/cppbestpractices/blob/e73393f25a85f83fed7399d8b65cb117d00b2231/02-Use_the_Tools_Available.md#L100
Seems like a good place to start, and would improve things a bit type-wise. This patchset attempts to correct all the issues in one shot.
Tested: It builds. Will test various subsystems that have been touched
Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I588c26440e5a97f718a0f0ea74cc84107d53aa1e
show more ...
|
#
351d3063 |
| 27-Mar-2019 |
Jason M. Bills <jason.m.bills@linux.intel.com> |
Parse Message Registry header info from the file
This extends the Message Registry parsing to include header details that are part of the redfish resource.
Tested: Verified that the MessageRegistry
Parse Message Registry header info from the file
This extends the Message Registry parsing to include header details that are part of the redfish resource.
Tested: Verified that the MessageRegistry info all returns correctly in the redfish response.
Change-Id: I6179c07f4067cd4520fce3e774d18530fede0a95 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
show more ...
|
#
70304cb5 |
| 27-Mar-2019 |
Jason M. Bills <jason.m.bills@linux.intel.com> |
Remove the static Base Message Registry file
This change removes the static Base Message Registry file and replaces it with a compile-time structure.
A script is used to pull the Base Message Regis
Remove the static Base Message Registry file
This change removes the static Base Message Registry file and replaces it with a compile-time structure.
A script is used to pull the Base Message Registry file from the DMTF and parse it into the .hpp structure.
Tested: Verified that after running the script, I can get the same Redfish data back from the existing endpoints without using the static files.
Change-Id: Ide3c61ecff62801c06619d5c3edc2229c945d8e7 Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
show more ...
|