[libcamera-devel] tracing: pipeline_handler: Queue Requests
diff mbox series

Message ID 20210302155041.110853-1-kieran.bingham@ideasonboard.com
State Accepted
Commit a36cde7834c114fd14ef07781742b5aa25d0b5d9
Headers show
Series
  • [libcamera-devel] tracing: pipeline_handler: Queue Requests
Related show

Commit Message

Kieran Bingham March 2, 2021, 3:50 p.m. UTC
Add tracing to the base pipeline handler class to track when requests are queued.

Tracing is already available for other Request operations, but queuing a Request
is not an operation handled by the Request itself.

Add the tracepoint to the PipelineHandler::queueRequest() so the lifetime of a
Request can be viewed when tracing.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 include/libcamera/internal/tracepoints/request.tp | 9 +++++++++
 src/libcamera/pipeline_handler.cpp                | 3 +++
 2 files changed, 12 insertions(+)

Comments

Paul Elder March 3, 2021, 12:24 a.m. UTC | #1
Hi Kieran,

On Tue, Mar 02, 2021 at 03:50:41PM +0000, Kieran Bingham wrote:
> Add tracing to the base pipeline handler class to track when requests are queued.
> 
> Tracing is already available for other Request operations, but queuing a Request
> is not an operation handled by the Request itself.
> 
> Add the tracepoint to the PipelineHandler::queueRequest() so the lifetime of a
> Request can be viewed when tracing.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

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

> ---
>  include/libcamera/internal/tracepoints/request.tp | 9 +++++++++
>  src/libcamera/pipeline_handler.cpp                | 3 +++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp
> index 7ffc606182f6..9e872951374d 100644
> --- a/include/libcamera/internal/tracepoints/request.tp
> +++ b/include/libcamera/internal/tracepoints/request.tp
> @@ -48,6 +48,15 @@ TRACEPOINT_EVENT_INSTANCE(
>  	)
>  )
>  
> +TRACEPOINT_EVENT_INSTANCE(
> +	libcamera,
> +	request,
> +	request_queue,
> +	TP_ARGS(
> +		libcamera::Request *, req
> +	)
> +)
> +
>  TRACEPOINT_EVENT_INSTANCE(
>  	libcamera,
>  	request,
> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
> index f72d26c793cd..d22991d318c9 100644
> --- a/src/libcamera/pipeline_handler.cpp
> +++ b/src/libcamera/pipeline_handler.cpp
> @@ -16,6 +16,7 @@
>  #include "libcamera/internal/device_enumerator.h"
>  #include "libcamera/internal/log.h"
>  #include "libcamera/internal/media_device.h"
> +#include "libcamera/internal/tracepoints.h"
>  #include "libcamera/internal/utils.h"
>  
>  /**
> @@ -375,6 +376,8 @@ const ControlList &PipelineHandler::properties(const Camera *camera) const
>   */
>  int PipelineHandler::queueRequest(Request *request)
>  {
> +	LIBCAMERA_TRACEPOINT(request_queue, request);
> +
>  	Camera *camera = request->camera_;
>  	CameraData *data = cameraData(camera);
>  	data->queuedRequests_.push_back(request);
> -- 
> 2.25.1
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch
diff mbox series

diff --git a/include/libcamera/internal/tracepoints/request.tp b/include/libcamera/internal/tracepoints/request.tp
index 7ffc606182f6..9e872951374d 100644
--- a/include/libcamera/internal/tracepoints/request.tp
+++ b/include/libcamera/internal/tracepoints/request.tp
@@ -48,6 +48,15 @@  TRACEPOINT_EVENT_INSTANCE(
 	)
 )
 
+TRACEPOINT_EVENT_INSTANCE(
+	libcamera,
+	request,
+	request_queue,
+	TP_ARGS(
+		libcamera::Request *, req
+	)
+)
+
 TRACEPOINT_EVENT_INSTANCE(
 	libcamera,
 	request,
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index f72d26c793cd..d22991d318c9 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -16,6 +16,7 @@ 
 #include "libcamera/internal/device_enumerator.h"
 #include "libcamera/internal/log.h"
 #include "libcamera/internal/media_device.h"
+#include "libcamera/internal/tracepoints.h"
 #include "libcamera/internal/utils.h"
 
 /**
@@ -375,6 +376,8 @@  const ControlList &PipelineHandler::properties(const Camera *camera) const
  */
 int PipelineHandler::queueRequest(Request *request)
 {
+	LIBCAMERA_TRACEPOINT(request_queue, request);
+
 	Camera *camera = request->camera_;
 	CameraData *data = cameraData(camera);
 	data->queuedRequests_.push_back(request);