[libcamera-devel] libcamera: request: Add log point on a completed request

Message ID 20200724112950.957955-1-naush@raspberrypi.com
State Accepted
Headers show
Series
  • [libcamera-devel] libcamera: request: Add log point on a completed request
Related show

Commit Message

Naushir Patuck July 24, 2020, 11:29 a.m. UTC
Add a debug log point to indicate a request has completed.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
 src/libcamera/request.cpp | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Laurent Pinchart July 24, 2020, 6:10 p.m. UTC | #1
Hi Naush,

Thank you for the patch.

On Fri, Jul 24, 2020 at 12:29:50PM +0100, Naushir Patuck wrote:
> Add a debug log point to indicate a request has completed.
> 
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> ---
>  src/libcamera/request.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> index 6b9e0b4a..bcb0a1a7 100644
> --- a/src/libcamera/request.cpp
> +++ b/src/libcamera/request.cpp
> @@ -212,6 +212,10 @@ void Request::complete()
>  {
>  	ASSERT(!hasPendingBuffers());
>  	status_ = cancelled_ ? RequestCancelled : RequestComplete;
> +
> +	LOG(Request, Debug) << "Request has completed - cookie: "
> +			    << cookie_
> +			    << (cancelled_ ? " [Cancelled]" : "");

To avoid pushing the lines towards the right, you can write this

	LOG(Request, Debug)
		<< "Request has completed - cookie: " << cookie_
		<< (cancelled_ ? " [Cancelled]" : "");

We customarily use that style through the code base.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

No need to resubmit. I'll give a couple of days to others to review the
patch and will then merge it as it has no dependency on the rest of the
series.

>  }
>  
>  /**
Kieran Bingham July 27, 2020, 11:53 a.m. UTC | #2
Hi Naush,

On 24/07/2020 12:29, Naushir Patuck wrote:
> Add a debug log point to indicate a request has completed.
> 
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>


Thanks, and looks good to me, I think it's useful to have as a common
path to show the completion points..

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  src/libcamera/request.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
> index 6b9e0b4a..bcb0a1a7 100644
> --- a/src/libcamera/request.cpp
> +++ b/src/libcamera/request.cpp
> @@ -212,6 +212,10 @@ void Request::complete()
>  {
>  	ASSERT(!hasPendingBuffers());
>  	status_ = cancelled_ ? RequestCancelled : RequestComplete;
> +
> +	LOG(Request, Debug) << "Request has completed - cookie: "
> +			    << cookie_
> +			    << (cancelled_ ? " [Cancelled]" : "");
>  }
>  
>  /**
>

Patch

diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
index 6b9e0b4a..bcb0a1a7 100644
--- a/src/libcamera/request.cpp
+++ b/src/libcamera/request.cpp
@@ -212,6 +212,10 @@  void Request::complete()
 {
 	ASSERT(!hasPendingBuffers());
 	status_ = cancelled_ ? RequestCancelled : RequestComplete;
+
+	LOG(Request, Debug) << "Request has completed - cookie: "
+			    << cookie_
+			    << (cancelled_ ? " [Cancelled]" : "");
 }
 
 /**