History log of /openbmc/phosphor-psu-code-mgmt/ (Results 1 – 25 of 119)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
8753538f07-Feb-2025 Patrick Williams <patrick@stwcx.xyz>

build: use allowed over enabled or not-disabled

Meson feature options are typically in a tri-state of enabled, disabled,
or auto. The enabled and disabled functions on an option (from
`get_option`)

build: use allowed over enabled or not-disabled

Meson feature options are typically in a tri-state of enabled, disabled,
or auto. The enabled and disabled functions on an option (from
`get_option`) no longer return true for auto features. Instead, the
expectation is to use `allowed()` which is true for both enabled and
auto.

Switch all uses of `enabled` to `allowed`.
Switch all uses of `not disabled` to `allowed`.

Change-Id: I0569970ebf98929b443aeff84a60e66c046367b8
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

56760ee204-Feb-2025 Shawn McCarney <shawnmm@us.ibm.com>

Set RequestedActivation to None in all cases

The Activation D-Bus object represents the activation state for an
associated Version object.

The Activation property of the Activation object indicates

Set RequestedActivation to None in all cases

The Activation D-Bus object represents the activation state for an
associated Version object.

The Activation property of the Activation object indicates the current
activation state. It has possible values like Ready, Activating,
Active, and Failed.

The RequestedActivation property of the Activation object indicates the
desired activation state. It has possible values of Active and None.

When the PSU code update application wants to install firmware on one or
more PSUs, it sets the RequestedActivation property to Active.

If the code update is successful, the Activation property is set to
Active, and the RequestedActivation property is set to None.

However, if the code update fails, the RequestedActivation property is
not changed. It continues to have the value Active.

There are many ways in which a code update can fail, such as:
* Unable to get PSU information from D-Bus
* No compatible PSUs found that need an update (happens during certain
race conditions)
* Unable to find or start PSU code update service file
* PSU code update service fails

Since the RequestedActivation property has the value Active after a
failed code update, it prevents the PSU code update application from
performing another code update in the future.

It is desirable to allow PSU code updates to be attempted in the future.
For example, if a code update fails due to a bad PSU, and the customer
replaces the PSU with a good one that has downlevel code, the new PSU
should be code updated.

Modify the application so that the RequestedActivation property is
always set to None when an activation attempt ends, regardless of
whether it was successful.

Tested:
* Test where update succeeds
* Test where update fails on initial activation attempt
* File path empty
* Could not get list of PSU inventory paths
* PSU queue is empty; no compatible PSUs needed update
* Unable to get update service
* Unable to start service
* Test where update fails after initial activation attempt
* Test where fails to start service on second PSU
* Test where second PSU update service fails
* Test where activation is restarted
* Test where update succeeds
* Test where fails on initial activation attempt
* Test where update service fails

Change-Id: Ie124fdd399b1a9b02d8ad6b50040fa9ae6739ccd
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...

638b84ae01-Feb-2025 Patrick Williams <patrick@stwcx.xyz>

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: I9230bbf1838e1e34ee6b6b49553a59fc9245cca1
Signed-off-by: Patrick Williams <p

clang-format: update latest spec and reformat

Copy the latest format file from the docs repository and apply.

Change-Id: I9230bbf1838e1e34ee6b6b49553a59fc9245cca1
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

8a08ac1001-Feb-2025 Patrick Williams <patrick@stwcx.xyz>

meson: reformat with meson formatter

Apply the `meson format` results.

Change-Id: Ide29bf7e4bef23e31328a7e425ff700ea0aab39b
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

7cb5d05e03-Jan-2025 Shawn McCarney <shawnmm@us.ibm.com>

Handle repeated activation requests

PSU code versions are represented on D-Bus as a combination of Version
and Activation objects.

When this application determines that one or more PSUs need a code

Handle repeated activation requests

PSU code versions are represented on D-Bus as a combination of Version
and Activation objects.

When this application determines that one or more PSUs need a code
update, it sets the RequestedActivation property to Active on the
Activation object. This triggers the code update.

The code is updated on each PSU in sequential order. This process can
take several minutes depending on the PSU type and number of PSUs.

During this long code update process, it is possible for one of the
following to occur:
* New PSU information is found on D-Bus
* A new PSU is plugged in (hot-plug)

If the new PSU requires a code update, the application will again set
the RequestedActivation property to Active on the Activation object. If
a code update is already occurring, the property change is currently
ignored. That means that the new PSU will not be code updated.

Enhance the application so that the second code update request is not
ignored. If it is requested while another code update is already in
progress, then restart the code update process once the current one
completes.

Tested:
* Tested a repeated code update request occurring due to new PSU
information found on D-Bus.
* Tested a repeated code update request occurring due to a new PSU
being plugged in.
* Verified that code update cycle was repeated if a request was deferred
and the previous code update was successful.
* Verified that code update cycle was not repeated if a request was
deferred and the previous code update failed.
* See the complete test plan at
https://gist.github.com/smccarney/424f92af23fc25c6c2b6f67ee54d8919

Change-Id: Ie73e3f83c68945f6c85c2747003c36637791a24b
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...

b8590f5613-Jan-2025 Shawn McCarney <shawnmm@us.ibm.com>

Fix CI error

The test case doUpdateOnePSUNotPresent() recently started failing in CI
on the meson pass that contains the following option:
* -Db_sanitize=address,undefined

This option turns on memo

Fix CI error

The test case doUpdateOnePSUNotPresent() recently started failing in CI
on the meson pass that contains the following option:
* -Db_sanitize=address,undefined

This option turns on memory checking, and that results in slightly
different gtest execution.

There appears to be one or more gmock bugs when ON_CALL and EXPECT_CALL
are used on the same mock method. Modify doUpdateOnePSUNotPresent() to
use ON_CALL instead of EXPECT_CALL. This is consistent with the other
methods in this file.

Also wrap the SdBusMock objects in test cases with NiceMock<> to
simplify future test case debug. The test cases do not set many
expectations on the sdbusplus functions that are called, and this
results in a huge number of 'Uninteresting mock function call' warning
messages. Using NiceMock eliminates these warnings.

Tested:
* Verified all automated test cases pass

Change-Id: I9f7ef8f314378ad928579c3b5707aab4fa091a23
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...

20a045f618-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: If6fd351c0ebc24f49fb2ecc86d9eebf94bc0b54c
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...

17c2c94e10-Dec-2024 Shawn McCarney <shawnmm@us.ibm.com>

Set ExtendedVersion property on Activations

Activation objects are created by this application in three scenarios:
1. When an InterfacesAdded event notifies the application about a new
PSU image

Set ExtendedVersion property on Activations

Activation objects are created by this application in three scenarios:
1. When an InterfacesAdded event notifies the application about a new
PSU image that was uploaded to IMG_DIR (/tmp/images).
2. When getting the firmware version that is already running on a PSU
in the system.
3. When a firmware version is found in the file system (IMG_DIR_BUILTIN
or IMG_DIR_PERSIST).

In scenario #2, there are two Activation properties that are not set:
1. Path: the file system path to the image directory.
2. ExtendedVersion: contains the manufacturer and model.

In scenario #3, a firmware version may be found in the file system that
is the same as the version running on a PSU. In this case, the
Activation object has already been created. The Path property on the
existing Activation is set to the file system path.

However, the ExtendedVersion property of the existing Activation is not
set. Due to this, the Activation has no manufacturer or model
information. This means it cannot be used to update other PSUs.

Solve this problem by setting the ExtendedVersion property of the
existing Activation when a matching version is found in the file system.
This will enable the Activation to obtain the manufacturer and model
information. This in turn will allow the Activation to be used to update
other PSUs that are not running the latest version.

Tested:
* Verified that extendedVersion, manufacturer, and model data members
are set when the Activation constructor is called.
* Verified that extendedVersion, manufacturer, and model data members
are set when the new, overridden extendedVersion() method is called.
* Verified that the ExtendedVersion property is set by scanDirectory()
if an Activation already exists.
* For the complete test plan see:
https://gist.github.com/smccarney/2a3bf72c6faa436199a70968cd99e30e

Change-Id: I7107b8c1d631ada5cd55648f92cf2c1e5cd90778
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...

46ea388c10-Dec-2024 Shawn McCarney <shawnmm@us.ibm.com>

Verify PSU is present before code update

When an Activation is set to the Activating state, it checks all the
PSUs in the system to see which ones are compatible. Compatibility is
determined based o

Verify PSU is present before code update

When an Activation is set to the Activating state, it checks all the
PSUs in the system to see which ones are compatible. Compatibility is
determined based on the Model and Manufacturer properties. It performs a
code update only on compatible PSUs.

Update the Activation class to also check whether a PSU is present. A
code update should not be attempted on a missing PSU. The attempt will
fail, and that will cause the remaining PSUs to be skipped.

Tested:
* Activation::startActivation()
* Test where PSU is not present
* Verify it is skipped
* Test where PSU is present
* Verify the compatibility is checked
* Test where PSU is not compatible
* Verify it is skipped
* Test where PSU is compatible
* Verify it is code updated
* Activation::isPresent()
* Test where PSU is present
* Test where PSU is not present
* Test where a D-Bus error occurs
* Verify error is written to the journal
* Verify false is returned

Change-Id: I5647e51177d84d22f6ae5a38afa970243fe9ecdd
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...

487e2e1925-Nov-2024 Shawn McCarney <shawnmm@us.ibm.com>

Improve error handling for exceptions and asserts

The phosphor-psu-code-manager application currently exits abnormally due
to the following conditions:
* Uncaught exception
* False assert() statemen

Improve error handling for exceptions and asserts

The phosphor-psu-code-manager application currently exits abnormally due
to the following conditions:
* Uncaught exception
* False assert() statement

An abnormal exit can result in a core dump and/or a BMC dump. It also
causes the service to be restarted. If the failure condition remains,
the restarts will fail repeatedly, and systemd will stop trying to start
the service.

Improve error handling for exceptions in the following ways:
* Add try/catch blocks to the following locations:
* Code that calls functions that throw and needs to handle exceptions.
* For example, code looping over PSU objects may need to handle an
exception for one PSU and then continue to the remaining PSUs.
* D-Bus PropertiesChanged and InterfacesAdded event handlers.
* Do not allow exceptions to escape to the sdbusplus stack frames.
* main()
* Last line of defense; catching avoids a core dump.
* Write exception error message to the journal if appropriate

Replace assert statements with exceptions or error messages to the
journal.

Tested:
* Tested all modified functions/methods.
* Verified that all exceptions were caught and logged to the journal if
appropriate.
* Verified that asserts were replaced by exceptions and logging.
* See complete test plan at
https://gist.github.com/smccarney/b4bf568639fedd269c9737234fa2803d

Change-Id: I933386e94f43a915b301d6aef7d91691816a0548
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...

d57bd2f202-Dec-2024 Shawn McCarney <shawnmm@us.ibm.com>

Rename getPSUInventoryPath to getPSUInventoryPaths

Rename the utils method/function getPSUInventoryPath() to
getPSUInventoryPaths(). The method/function returns multiple paths in a
vector, so the n

Rename getPSUInventoryPath to getPSUInventoryPaths

Rename the utils method/function getPSUInventoryPath() to
getPSUInventoryPaths(). The method/function returns multiple paths in a
vector, so the name should be plural. This will make the return type
more clear. Currently the name implies only one path will be returned.

Tested:
* Verified all automated tests build and run successfully
* Verified getPSUInventoryPaths() returns correct data

Change-Id: I7e215c37e3ce1eb27313bc51348c7f7335c8f67a
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...

cdf86de226-Nov-2024 Shawn McCarney <shawnmm@us.ibm.com>

Convert from log() to lg2()

Convert from the old log() API to the new lg2() API for logging journal
messages. The new API is simpler to use, and the old API may be
deprecated in the future.

Tested:

Convert from log() to lg2()

Convert from the old log() API to the new lg2() API for logging journal
messages. The new API is simpler to use, and the old API may be
deprecated in the future.

Tested:
* Tested all lg2() calls to verify the resulting journal message was
correct.
* For the complete test plan, see
https://gist.github.com/smccarney/f4ed140bf7a46773b31c76b488e739dc

Change-Id: Ieb46c5d1481ceb51e5b0d51392b1c32596d8eac8
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...

783406e617-Nov-2024 Shawn McCarney <shawnmm@us.ibm.com>

Get model using command line tool

Get the PSU model using a command line tool specified in the meson
options. The default tool is 'psutils --get-model'. The tool should
get the model data directly

Get model using command line tool

Get the PSU model using a command line tool specified in the meson
options. The default tool is 'psutils --get-model'. The tool should
get the model data directly from the PSU.

This is more accurate than getting the Model property of the Asset
interface on D-Bus. Inventory Manager saves its state to files. When
the BMC is booted, Inventory Manager initializes itself using the saved
state. This is necessary to handle the scenario where the BMC is
rebooted while the rest of the system is powered on (such as a
concurrent BMC code update).

However, if all power was removed from the system, a PSU may have been
added/removed/replaced while the BMC was offline. When the BMC boots,
the Inventory Manager saved state is not correct.

Eventually the PSU monitoring application will update the model on
D-Bus, but this can take a non-trivial amount of time. This is
especially true if EntityManager is used to provide the PSU bus and
address information to the PSU monitoring application.

Tested:
* Verified all automated tests build and run successfully
* Verified application uses command line tool to obtain model
* Verified command line tool was returning the correct model
* Test where command line tool fails with non-zero exit code
* Tested where all PSU information available when application starts
* Tested where PSU information is obtained after application starts
using the InterfacesAdded handler
* Tested where PSU presence changes and is obtained by the
PropertiesChanged handler
* Full test plan is available at
https://gist.github.com/smccarney/87bd821a6d317ec0915d1f162028ff01

Change-Id: Ia9d35850aa6ac27dd006679991272232d67390ff
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...

73a6f0d830-Oct-2024 Shawn McCarney <shawnmm@us.ibm.com>

Update PSU if version cannot be obtained

Currently this application will ignore a PSU if the PSU code version
cannot be obtained.

However, there are several scenarios where this could occur:
* A co

Update PSU if version cannot be obtained

Currently this application will ignore a PSU if the PSU code version
cannot be obtained.

However, there are several scenarios where this could occur:
* A code update was previously attempted on the PSU, and the update
failed. The PSU is now in a bad state, and the update needs to be
performed again.
* The PSU is running old code that does not support reading the code
version.

In these scenarios performing a code update on the PSU is desired.

Enhance this application so that a PSU with an unknown code version will
be updated provided that it is the correct model.

Tested:
* Verified code update was still performed if version could not be
obtained.
* Tested where PSU information is found at start of application
* Tested where PSU information is found from InterfacesAdded event
* Tested where PSU information is found from PropertiesChanged event
* For the complete test plan, see
https://gist.github.com/smccarney/3846a97fef590eb69181edc669555a00

Change-Id: I6e60761fa20eeb4500529c00f33de16d69a8d84d
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...

ddf525f227-Sep-2024 Shawn McCarney <shawnmm@us.ibm.com>

Only store images from IMG_DIR

New PSU images are uploaded/downloaded to IMG_DIR (normally
/tmp/images). After all PSUs have been updated with the new image, the
image is copied to IMG_DIR_PERSIST

Only store images from IMG_DIR

New PSU images are uploaded/downloaded to IMG_DIR (normally
/tmp/images). After all PSUs have been updated with the new image, the
image is copied to IMG_DIR_PERSIST (normally /var/lib/obmc/psu). This
stores the image in a persistent location that will exist beyond a BMC
reboot. If a PSU is replaced in the future, and the new PSU has old
code, the PSU image from IMG_DIR_PERSIST is used to update it.

The application currently also copies PSU images from IMG_DIR_BUILTIN
(normally /usr/share/obmc/psu) to IMG_DIR_PERSIST. This is undesirable
for two reasons:
* Wastes flash space since IMG_DIR_BUILTIN is already persistent.
* IMG_DIR_PERSIST is located in a directory that is shared between both
BMC images ("A" side and "B" side). This means the PSU image will be
found by both BMC images. This may be undesirable behavior, such as
if the other BMC image has not been tested with this PSU image.

Modify the storing logic so that only PSU images from IMG_DIR are copied
to IMG_DIR_PERSIST.

Tested:
* Verified that a PSU image in IMG_DIR is copied to IMG_DIR_PERSIST
* Verified that a PSU image in IMG_DIR_PERSIST is not copied to
IMG_DIR_PERSIST
* Verified that a PSU image in IMG_DIR_BUILTIN is not copied to
IMG_DIR_PERSIST

Change-Id: I69fbbefffb08374cffcb86b9037780b7a312c459
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...

799f514926-Sep-2024 Shawn McCarney <shawnmm@us.ibm.com>

Support ALWAYS_USE_BUILTIN_IMG_DIR in IA handler

Support the new ALWAYS_USE_BUILTIN_IMG_DIR meson option in the
InterfacesAdded handler for software versions.

This handler notifies the application

Support ALWAYS_USE_BUILTIN_IMG_DIR in IA handler

Support the new ALWAYS_USE_BUILTIN_IMG_DIR meson option in the
InterfacesAdded handler for software versions.

This handler notifies the application when a new software version is
created on D-Bus. When a new PSU image is uploaded to the IMG_DIR
(/tmp/images) directory, the xyz.openbmc_project.Software.Version
service creates a new D-Bus object with the Version interface.

If the ALWAYS_USE_BUILTIN_IMG_DIR option is specified, the new PSU image
in IMG_DIR should be ignored. Only PSU images stored in IMG_DIR_BUILTIN
(/usr/share/obmc/psu) are used to update PSUs.

Tested:
* Built with ALWAYS_USE_BUILTIN_IMG_DIR set to false (the default)
* Verified that a new PSU image uploaded to /tmp/images is installed
on all PSUs.
* Verified new PSU image is copied to /var/lib/obmc/psu
* Verified new PSU image is removed from /tmp/images
* Verified that after BMC is rebooted new PSU image still exists in
/var/lib/obmc/psu
* Built with ALWAYS_USE_BUILTIN_IMG_DIR set to true
* Verified that a new PSU image uploaded to /tmp/images is ignored and
no PSUs are updated.
* Verified new PSU image is not copied to /var/lib/obmc/psu
* Verified new PSU image is not removed from /tmp/images
* Verified that after BMC is rebooted new PSU image no longer exists
in /tmp/images

Change-Id: I2f71593f786eac86bdf6f484cc0220e0e6b0f4b7
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>

show more ...

fb86e79411-Sep-2024 Faisal Awada <faisal@us.ibm.com>

Retrieve FW version from IMG_BUILTIN_DIR

Added method to retrieve firmware level found in IMG_BUILTIN_DIR. This
is required behavior on some systems types.

Tested:
Installed openbmc image on syst

Retrieve FW version from IMG_BUILTIN_DIR

Added method to retrieve firmware level found in IMG_BUILTIN_DIR. This
is required behavior on some systems types.

Tested:
Installed openbmc image on system and verified the function returns
the version available in IMG_BUILT_DIR.

Change-Id: I10166a1412fb9de421bd304c40916a81c1ca0558
Signed-off-by: Faisal Awada <faisal@us.ibm.com>

show more ...

80c2daae23-Aug-2024 George Liu <liuxiwei@ieisystem.com>

clang-tidy: Enable readability-convert-member-functions-to-static

This check finds non-static member functions that can be made
static because the functions don’t use this.
This check also triggers

clang-tidy: Enable readability-convert-member-functions-to-static

This check finds non-static member functions that can be made
static because the functions don’t use this.
This check also triggers readability-static-accessed-through
-instance check as we are trying to access a static member
function through an instance.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I6c06c61e8f199247e74aca3443741683e3853274

show more ...

a5205e4023-Aug-2024 George Liu <liuxiwei@ieisystem.com>

clang-tidy: Enable readability-string-compare check

This check finds string comparisons using the compare method.
A common mistake is to use the string’s compare method instead of
using the equality

clang-tidy: Enable readability-string-compare check

This check finds string comparisons using the compare method.
A common mistake is to use the string’s compare method instead of
using the equality or inequality operators.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I9d4b8aad27fa34345d08d2ba326b8a31cd3d99c6

show more ...

22c2fbd823-Aug-2024 George Liu <liuxiwei@ieisystem.com>

clang-tidy: Enable readability-uppercase-literal-suffix check

cert-dcl16-c redirects here as an alias for this check. By default,
only the suffixes that begin with l (l, ll, lu, llu, but not u, ul,

clang-tidy: Enable readability-uppercase-literal-suffix check

cert-dcl16-c redirects here as an alias for this check. By default,
only the suffixes that begin with l (l, ll, lu, llu, but not u, ul,
ull) are diagnosed by that alias.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I180ee3e3274899c63181f69a14f158319f178f0c

show more ...

71ae535c23-Aug-2024 George Liu <liuxiwei@ieisystem.com>

clang-tidy: Enable readability-make-member-function-const check

Finds non-static member functions that can be made const because the
functions don’t use this in a non-const way.

Signed-off-by: Geor

clang-tidy: Enable readability-make-member-function-const check

Finds non-static member functions that can be made const because the
functions don’t use this in a non-const way.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: Iff3a367401d571f9fcff90539aaab59e2c66e627

show more ...

cb6bbfd423-Aug-2024 George Liu <liuxiwei@ieisystem.com>

clang-tidy: Enable readability checks on repo

The readability-* checks in Clang-Tidy focus on improving code
readability by enforcing guidelines and suggesting improvements
that can enhance the clar

clang-tidy: Enable readability checks on repo

The readability-* checks in Clang-Tidy focus on improving code
readability by enforcing guidelines and suggesting improvements
that can enhance the clarity and maintainability of C++ code.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: If69d468f6303df4ec782a3b7c7453a60ddae1e4e

show more ...

a31e568e23-Aug-2024 George Liu <liuxiwei@ieisystem.com>

clang-tidy: Enable performance-unnecessary-value-param check

This check flags value parameter declarations of expensive to copy
types that are copied for each invocation but it would suffice to
pass

clang-tidy: Enable performance-unnecessary-value-param check

This check flags value parameter declarations of expensive to copy
types that are copied for each invocation but it would suffice to
pass them by const reference.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: Ia287488c3bbe1a64e05760cbece119456d8f82f3

show more ...

af025bcf23-Aug-2024 George Liu <liuxiwei@ieisystem.com>

clang-tidy: Enable performance-inefficient-vector-operation check

Finds possible inefficient std::vector operations (e.g. push_back,
emplace_back) that may cause unnecessary memory reallocations.

I

clang-tidy: Enable performance-inefficient-vector-operation check

Finds possible inefficient std::vector operations (e.g. push_back,
emplace_back) that may cause unnecessary memory reallocations.

It can also find calls that add element to protobuf repeated field in
a loop without calling Reserve() before the loop. Calling Reserve()
first can avoid unnecessary memory reallocations.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I442c3aac7e3c71abbb125ae6bcdbe3f8995d14e9

show more ...

a0f2cf7d23-Aug-2024 George Liu <liuxiwei@ieisystem.com>

clang-tidy: Enable performance-faster-string-find check

This check optimizes the calls to std::string::find() when the
input passed is a single character string literal. The character
literal overlo

clang-tidy: Enable performance-faster-string-find check

This check optimizes the calls to std::string::find() when the
input passed is a single character string literal. The character
literal overload is more efficient.

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I72ae6f1506d2298a067e6463bd3718d64d23fdb2

show more ...

12345