[libcamera-devel] libcamera: pipeline: simple: Log pipeline topology
diff mbox series

Message ID 20210627191937.14030-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit 535820fe51ac9881ae3562ffd4a69ef3359f85f6
Headers show
Series
  • [libcamera-devel] libcamera: pipeline: simple: Log pipeline topology
Related show

Commit Message

Laurent Pinchart June 27, 2021, 7:19 p.m. UTC
Log the topology for each valid discovered pipeline to aid debugging.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/pipeline/simple/simple.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Umang Jain June 28, 2021, 4:25 a.m. UTC | #1
Hi Laurent,

Thanks for the patch.

On 6/28/21 12:49 AM, Laurent Pinchart wrote:
> Log the topology for each valid discovered pipeline to aid debugging.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>


> ---
>   src/libcamera/pipeline/simple/simple.cpp | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
> index 6ed3da423432..e214a7eb3a47 100644
> --- a/src/libcamera/pipeline/simple/simple.cpp
> +++ b/src/libcamera/pipeline/simple/simple.cpp
> @@ -342,8 +342,15 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,
>   	/* Finally also remember the sensor. */
>   	sensor_ = std::make_unique<CameraSensor>(sensor);
>   	ret = sensor_->init();
> -	if (ret)
> +	if (ret) {
>   		sensor_.reset();
> +		return;
> +	}
> +
> +	LOG(SimplePipeline, Debug)
> +		<< "Found pipeline: "
> +		<< utils::join(entities_, " -> ",
> +			       [](const Entity &e) { return e.entity->name(); });
Nice handy utility function that I learnt about it today. :-)
>   }
>   
>   int SimpleCameraData::init()
Paul Elder June 28, 2021, 4:56 a.m. UTC | #2
Hi Laurent,

On Sun, Jun 27, 2021 at 10:19:37PM +0300, Laurent Pinchart wrote:
> Log the topology for each valid discovered pipeline to aid debugging.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

> ---
>  src/libcamera/pipeline/simple/simple.cpp | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
> index 6ed3da423432..e214a7eb3a47 100644
> --- a/src/libcamera/pipeline/simple/simple.cpp
> +++ b/src/libcamera/pipeline/simple/simple.cpp
> @@ -342,8 +342,15 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,
>  	/* Finally also remember the sensor. */
>  	sensor_ = std::make_unique<CameraSensor>(sensor);
>  	ret = sensor_->init();
> -	if (ret)
> +	if (ret) {
>  		sensor_.reset();
> +		return;
> +	}
> +
> +	LOG(SimplePipeline, Debug)
> +		<< "Found pipeline: "
> +		<< utils::join(entities_, " -> ",
> +			       [](const Entity &e) { return e.entity->name(); });
>  }
>  
>  int SimpleCameraData::init()
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 6ed3da423432..e214a7eb3a47 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -342,8 +342,15 @@  SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,
 	/* Finally also remember the sensor. */
 	sensor_ = std::make_unique<CameraSensor>(sensor);
 	ret = sensor_->init();
-	if (ret)
+	if (ret) {
 		sensor_.reset();
+		return;
+	}
+
+	LOG(SimplePipeline, Debug)
+		<< "Found pipeline: "
+		<< utils::join(entities_, " -> ",
+			       [](const Entity &e) { return e.entity->name(); });
 }
 
 int SimpleCameraData::init()