[RFC,v2,23/43] ipa: libipa: agc: Adjust debug messages slightly
diff mbox series

Message ID 20260723154327.1357866-24-barnabas.pocze@ideasonboard.com
State Superseded
Headers show
Series
  • ipa: libipa: agc rework
Related show

Commit Message

Barnabás Pőcze July 23, 2026, 3:43 p.m. UTC
The log message showing the result of AGC seems too verbose to me,
and the labels and values are far from each other. And also log the
line duration when showing exposure and gain limits.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 src/ipa/libipa/agc.cpp | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

Comments

Jacopo Mondi July 27, 2026, 1:56 p.m. UTC | #1
Hi Barnabás

On Thu, Jul 23, 2026 at 05:43:06PM +0200, Barnabás Pőcze wrote:
> The log message showing the result of AGC seems too verbose to me,
> and the labels and values are far from each other. And also log the
> line duration when showing exposure and gain limits.
>
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> ---
>  src/ipa/libipa/agc.cpp | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp
> index 8a2525ec98..49b3034746 100644
> --- a/src/ipa/libipa/agc.cpp
> +++ b/src/ipa/libipa/agc.cpp
> @@ -294,8 +294,11 @@ int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state, cons
>  	};
>
>  	LOG(Agc, Debug)
> -		<< "Exposure: [" << minExposure << ", " << maxExposure
> -		<< "], gain: [" << minGain << ", " << maxGain << "]";
> +		<< "exposure:[" << minExposure << ',' << maxExposure << ']'
> +		<< " gain: [" << minGain << ',' << maxGain << ']'
> +		<< " line-duration:" << session.lineDuration
> +		<< " sensor-output:" << session.sensor.outputSize
> +	;

why ; on a separate line ?
>
>  	/*
>  	 * Compute the frame duration limits.
> @@ -615,9 +618,11 @@ void AgcAlgorithm::process(const agc::Session &session, agc::ActiveState &state,
>  		});
>
>  		LOG(Agc, Debug)
> -			<< "Divided up exposure time, analogue gain, quantization gain"
> -			<< " and digital gain are " << newEv.exposureTime << ", " << newEv.analogueGain
> -			<< ", " << newEv.quantizationGain << " and " << newEv.digitalGain;
> +			<< "exposure-time:" << newEv.exposureTime
> +			<< " analogue-gain" << newEv.analogueGain
> +			<< " quantization-gain" << newEv.quantizationGain
> +			<< " digital-gain: " << newEv.digitalGain
> +		;

same question

The message is certainly easier to read in this format
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

>
>  		/* Update the estimated exposure and gain. */
>  		state.automatic.exposure = clampExposure(newEv.exposureTime, session);
> --
> 2.55.0
>
Barnabás Pőcze July 27, 2026, 3:01 p.m. UTC | #2
2026. 07. 27. 15:56 keltezéssel, Jacopo Mondi írta:
> Hi Barnabás
> 
> On Thu, Jul 23, 2026 at 05:43:06PM +0200, Barnabás Pőcze wrote:
>> The log message showing the result of AGC seems too verbose to me,
>> and the labels and values are far from each other. And also log the
>> line duration when showing exposure and gain limits.
>>
>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
>> ---
>>   src/ipa/libipa/agc.cpp | 15 ++++++++++-----
>>   1 file changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp
>> index 8a2525ec98..49b3034746 100644
>> --- a/src/ipa/libipa/agc.cpp
>> +++ b/src/ipa/libipa/agc.cpp
>> @@ -294,8 +294,11 @@ int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state, cons
>>   	};
>>
>>   	LOG(Agc, Debug)
>> -		<< "Exposure: [" << minExposure << ", " << maxExposure
>> -		<< "], gain: [" << minGain << ", " << maxGain << "]";
>> +		<< "exposure:[" << minExposure << ',' << maxExposure << ']'
>> +		<< " gain: [" << minGain << ',' << maxGain << ']'
>> +		<< " line-duration:" << session.lineDuration
>> +		<< " sensor-output:" << session.sensor.outputSize
>> +	;
> 
> why ; on a separate line ?

Ahh, it's something I like to do in order not to have to shuffle the `;` all
the time, but clang-format does not seem to like it too much, so I'll adjust it.


>>
>>   	/*
>>   	 * Compute the frame duration limits.
>> @@ -615,9 +618,11 @@ void AgcAlgorithm::process(const agc::Session &session, agc::ActiveState &state,
>>   		});
>>
>>   		LOG(Agc, Debug)
>> -			<< "Divided up exposure time, analogue gain, quantization gain"
>> -			<< " and digital gain are " << newEv.exposureTime << ", " << newEv.analogueGain
>> -			<< ", " << newEv.quantizationGain << " and " << newEv.digitalGain;
>> +			<< "exposure-time:" << newEv.exposureTime
>> +			<< " analogue-gain" << newEv.analogueGain
>> +			<< " quantization-gain" << newEv.quantizationGain
>> +			<< " digital-gain: " << newEv.digitalGain
>> +		;
> 
> same question
> 
> The message is certainly easier to read in this format
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> 
>>
>>   		/* Update the estimated exposure and gain. */
>>   		state.automatic.exposure = clampExposure(newEv.exposureTime, session);
>> --
>> 2.55.0
>>

Patch
diff mbox series

diff --git a/src/ipa/libipa/agc.cpp b/src/ipa/libipa/agc.cpp
index 8a2525ec98..49b3034746 100644
--- a/src/ipa/libipa/agc.cpp
+++ b/src/ipa/libipa/agc.cpp
@@ -294,8 +294,11 @@  int AgcAlgorithm::configure(agc::Session &session, agc::ActiveState &state, cons
 	};
 
 	LOG(Agc, Debug)
-		<< "Exposure: [" << minExposure << ", " << maxExposure
-		<< "], gain: [" << minGain << ", " << maxGain << "]";
+		<< "exposure:[" << minExposure << ',' << maxExposure << ']'
+		<< " gain: [" << minGain << ',' << maxGain << ']'
+		<< " line-duration:" << session.lineDuration
+		<< " sensor-output:" << session.sensor.outputSize
+	;
 
 	/*
 	 * Compute the frame duration limits.
@@ -615,9 +618,11 @@  void AgcAlgorithm::process(const agc::Session &session, agc::ActiveState &state,
 		});
 
 		LOG(Agc, Debug)
-			<< "Divided up exposure time, analogue gain, quantization gain"
-			<< " and digital gain are " << newEv.exposureTime << ", " << newEv.analogueGain
-			<< ", " << newEv.quantizationGain << " and " << newEv.digitalGain;
+			<< "exposure-time:" << newEv.exposureTime
+			<< " analogue-gain" << newEv.analogueGain
+			<< " quantization-gain" << newEv.quantizationGain
+			<< " digital-gain: " << newEv.digitalGain
+		;
 
 		/* Update the estimated exposure and gain. */
 		state.automatic.exposure = clampExposure(newEv.exposureTime, session);