[PATCH v2 22/71] efi: Improve logging in efi_disk

Heinrich Schuchardt xypron.glpk at gmx.de
Fri Jan 13 21:49:45 CET 2023


On 1/13/23 21:40, Tom Rini wrote:
> On Fri, Jan 13, 2023 at 09:35:36PM +0100, Heinrich Schuchardt wrote:
>> On 1/8/23 03:49, Simon Glass wrote:
>>> When this fails it can be time-consuming to debug. Add some debugging
>>> to help with this. Also try to return error codes instead of just using
>>> -1.
>>>
>>> Signed-off-by: Simon Glass <sjg at chromium.org>
>>> ---
>>>
>>> (no changes since v1)
>>>
>>>    lib/efi_loader/efi_disk.c | 30 +++++++++++++++++++++---------
>>>    1 file changed, 21 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
>>> index 7ea0334083f..37123dd2474 100644
>>> --- a/lib/efi_loader/efi_disk.c
>>> +++ b/lib/efi_loader/efi_disk.c
>>> @@ -421,13 +421,16 @@ static efi_status_t efi_disk_add_dev(
>>>
>>>    		if (!node) {
>>>    			ret = EFI_OUT_OF_RESOURCES;
>>> +			log_debug("no node\n");
>>
>> Please, provide a descriptive message. I would not know what "no node"
>> might mean if I were to read it.
>>
>> There is a reason why we set ret = EFI_OUT_OF_RESOURCES?
>>
>> The caller should know what this means.
>
> There's a fine balance to be struck here. An error message should be
> grep'd through in the code, for debug messages. With CONFIG_LOG we're
> already getting file, line and function.
>

CONFIG_LOG is of by default. So we are talking about a developer build.

If instead of "no node" I would see "out of resources", this would be
more helpful to me.

Best regards

Heinrich


More information about the U-Boot mailing list