[libcamera-devel,v2,1/2] libcamera: ipa_module: add path to module loading error message

Message ID 20190701141336.10273-1-paul.elder@ideasonboard.com
State Superseded
Headers show
Series
  • [libcamera-devel,v2,1/2] libcamera: ipa_module: add path to module loading error message
Related show

Commit Message

Paul Elder July 1, 2019, 2:13 p.m. UTC
Add an error message to tell, if an IPA module failed to load, the
path to the IPA module shared object that was attempted to be loaded.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
---
Changes in v2: don't show module version

 src/libcamera/ipa_module.cpp | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Laurent Pinchart July 1, 2019, 5:45 p.m. UTC | #1
Hi Paul,

Thank you for the patch.

On Mon, Jul 01, 2019 at 11:13:35PM +0900, Paul Elder wrote:
> Add an error message to tell, if an IPA module failed to load, the
> path to the IPA module shared object that was attempted to be loaded.
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> ---
> Changes in v2: don't show module version
> 
>  src/libcamera/ipa_module.cpp | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp
> index 58e8d1d..5a46ec3 100644
> --- a/src/libcamera/ipa_module.cpp
> +++ b/src/libcamera/ipa_module.cpp
> @@ -286,6 +286,11 @@ int IPAModule::loadIPAModuleInfo()
>  		ret = -EINVAL;
>  	}
>  
> +	if (ret)
> +		LOG(IPAModule, Error)
> +			<< "Error loading IPA module at "

I would s/at //

> +			<< libPath_;
> +

Would it make sensor to move this under the close: label ?

While at it, I think you need a

	if (ret)
		goto unmap;

after the elfLoadSymbol() calls.

>  unmap:
>  	munmap(map, soSize);
>  close:

Patch

diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp
index 58e8d1d..5a46ec3 100644
--- a/src/libcamera/ipa_module.cpp
+++ b/src/libcamera/ipa_module.cpp
@@ -286,6 +286,11 @@  int IPAModule::loadIPAModuleInfo()
 		ret = -EINVAL;
 	}
 
+	if (ret)
+		LOG(IPAModule, Error)
+			<< "Error loading IPA module at "
+			<< libPath_;
+
 unmap:
 	munmap(map, soSize);
 close: