[libcamera-devel,1/2] utils: ipc: Generate tracepoints for IPA calls
diff mbox series

Message ID 20210217092937.17167-1-paul.elder@ideasonboard.com
State New
Delegated to: Paul Elder
Headers show
Series
  • [libcamera-devel,1/2] utils: ipc: Generate tracepoints for IPA calls
Related show

Commit Message

Paul Elder Feb. 17, 2021, 9:29 a.m. UTC
To ease benchmarking IPA calls, automatically generate tracepoints for
IPA calls in the IPAProxy.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
---
 .../generators/libcamera_templates/module_ipa_proxy.cpp.tmpl   | 3 +++
 1 file changed, 3 insertions(+)

Comments

Paul Elder Feb. 17, 2021, 9:47 a.m. UTC | #1
On Wed, Feb 17, 2021 at 06:29:36PM +0900, Paul Elder wrote:
> To ease benchmarking IPA calls, automatically generate tracepoints for
> IPA calls in the IPAProxy.
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> ---
>  .../generators/libcamera_templates/module_ipa_proxy.cpp.tmpl   | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> index ba34a361..5e0d3976 100644
> --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> @@ -33,6 +33,7 @@
>  #include "libcamera/internal/log.h"
>  #include "libcamera/internal/process.h"
>  #include "libcamera/internal/thread.h"
> +#include "libcamera/internal/tracepoints.h"
>  
>  namespace libcamera {
>  
> @@ -125,6 +126,7 @@ void {{proxy_name}}::recvMessage(const IPCMessage &data)
>  {% for method in interface_main.methods %}
>  {{proxy_funcs.func_sig(proxy_name, method)}}
>  {
> +	LIBCAMERA_TRACEPOINT_IPA_BEGIN({{module_name}}, {{method.mojom_name}});
>  	if (isolate_)
>  		{{"return " if method|method_return_value != "void"}}{{method.mojom_name}}IPC(
>  {%- for param in method|method_param_names -%}
> @@ -137,6 +139,7 @@ void {{proxy_name}}::recvMessage(const IPCMessage &data)
>  		{{param}}{{- ", " if not loop.last}}
>  {%- endfor -%}
>  );
> +	LIBCAMERA_TRACEPOINT_IPA_END({{module_name}}, {{method.mojom_name}});
>  }

While cleaining up patchwork, I came across this [1], and I wonder if
this patch would clutter traces if pipelines add custom IPA call
tracepoints for the "proper" response to an async call.

Would we be better off without auto IPA call tracepoints?


Paul

[1] https://patchwork.libcamera.org/patch/10311/
>  
>  {{proxy_funcs.func_sig(proxy_name, method, "Thread")}}
> -- 
> 2.27.0
>

Patch
diff mbox series

diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
index ba34a361..5e0d3976 100644
--- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
+++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
@@ -33,6 +33,7 @@ 
 #include "libcamera/internal/log.h"
 #include "libcamera/internal/process.h"
 #include "libcamera/internal/thread.h"
+#include "libcamera/internal/tracepoints.h"
 
 namespace libcamera {
 
@@ -125,6 +126,7 @@  void {{proxy_name}}::recvMessage(const IPCMessage &data)
 {% for method in interface_main.methods %}
 {{proxy_funcs.func_sig(proxy_name, method)}}
 {
+	LIBCAMERA_TRACEPOINT_IPA_BEGIN({{module_name}}, {{method.mojom_name}});
 	if (isolate_)
 		{{"return " if method|method_return_value != "void"}}{{method.mojom_name}}IPC(
 {%- for param in method|method_param_names -%}
@@ -137,6 +139,7 @@  void {{proxy_name}}::recvMessage(const IPCMessage &data)
 		{{param}}{{- ", " if not loop.last}}
 {%- endfor -%}
 );
+	LIBCAMERA_TRACEPOINT_IPA_END({{module_name}}, {{method.mojom_name}});
 }
 
 {{proxy_funcs.func_sig(proxy_name, method, "Thread")}}