[RFC,v1,4/8] utils: codegen: ipc: Log error code when remote call fails
diff mbox series

Message ID 20250515120012.3127231-5-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • utils: codegen: ipc: Simplify deserialization
Related show

Commit Message

Barnabás Pőcze May 15, 2025, noon UTC
The error code can be useful in diagnosing the underlying issue,
so log that as well, not just the existence of the issue.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 .../generators/libcamera_templates/module_ipa_proxy.cpp.tmpl    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul Elder May 15, 2025, 12:25 p.m. UTC | #1
Quoting Barnabás Pőcze (2025-05-15 14:00:08)
> The error code can be useful in diagnosing the underlying issue,
> so log that as well, not just the existence of the issue.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  .../generators/libcamera_templates/module_ipa_proxy.cpp.tmpl    | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> index 07165821e..effc8f7dd 100644
> --- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> +++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> @@ -206,7 +206,7 @@ void {{proxy_name}}::recvMessage(const IPCMessage &data)
>  );
>  {%- endif %}
>         if (_ret < 0) {
> -               LOG(IPAProxy, Error) << "Failed to call {{method.mojom_name}}";
> +               LOG(IPAProxy, Error) << "Failed to call {{method.mojom_name}}: " << _ret;
>  {%- if method|method_return_value != "void" %}
>                 return static_cast<{{method|method_return_value}}>(_ret);
>  {%- else %}
> -- 
> 2.49.0
>

Patch
diff mbox series

diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
index 07165821e..effc8f7dd 100644
--- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
+++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
@@ -206,7 +206,7 @@  void {{proxy_name}}::recvMessage(const IPCMessage &data)
 );
 {%- endif %}
 	if (_ret < 0) {
-		LOG(IPAProxy, Error) << "Failed to call {{method.mojom_name}}";
+		LOG(IPAProxy, Error) << "Failed to call {{method.mojom_name}}: " << _ret;
 {%- if method|method_return_value != "void" %}
 		return static_cast<{{method|method_return_value}}>(_ret);
 {%- else %}