[libcamera-devel] Log output of isolated IPA module

Matthias Fend matthias.fend at emfend.at
Tue Nov 15 09:23:26 CET 2022


Hi Laurent,

Am 08.11.2022 um 22:30 schrieb Laurent Pinchart:
> Hi Matthias,
> 
> On Tue, Nov 08, 2022 at 08:54:04PM +0100, Matthias Fend via libcamera-devel wrote:
>> Hi everyone
>>
>> When searching for the reason for missing log outputs from an isolated
>> running IPA module, I found that this is done explicitly by calling
>> unsetenv("LIBCAMERA_LOG_FILE") and closing all fds.
>>
>> So I was wondering what the reason for this is and what the intended way
>> is to enable log information in such a case (without modifying the source)?
> 
> As isolated IPA modules run in a different process, they can't log to
> the same file as the main libcamera process without causing corruption.
> The proxy worker that runs the IPA module has the following code (in
> utils/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl):
> 
> {#- \todo Handle enabling debugging more dynamically. #}
>          /* Uncomment this for debugging. */
> #if 0
>          std::string logPath = "/tmp/libcamera.worker." +
>                                std::to_string(getpid()) + ".log";
>          logSetFile(logPath.c_str());
> #endif
> 
> This is thus a known issue, which we haven't addressed yet. I haven't
> really taken the time myself to figure out what a good mechanism would
> be.

Thanks for your explanation.
True, when logging to a file the problem seems obvious. But if syslog is 
used, like in my case, it's not that big of a problem.
I'm currently using a small patch that just skips the unset when using 
syslog. But of course that only solves part of the issue.

~Matthias

> 


More information about the libcamera-devel mailing list