Re: [RFC PATCH 4/4] tools/thermal: Add thermal daemon skeleton

From: Daniel Lezcano
Date: Mon Feb 14 2022 - 18:43:29 EST



Hi Srinivas,

On 14/02/2022 23:34, srinivas pandruvada wrote:
On Mon, 2022-02-14 at 22:04 +0100, Daniel Lezcano wrote:
This change provides a simple daemon skeleton. It provides an example
of how to use the thermal library.

The goal of this skeleton is to give a base brick for anyone
interested in writing its own thermal engine.

In the future, it will evolve with more features.

From the code, doesn't seam to have a function to daemonize.

Yes, it does, see below. If the stdout output is set, then it won't daemonize.


So may be not call a daemon if that is true. mainloop() is just an
infinite loop polling netlink messages.

Also thermald will confuse with the standard thermald distributed with
every distro. May be thermal_control_sample as this a sample for future
development.

Does thermal-engine fine ?

Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>

[ ... ]

 tools/thermal/thermald/thermald.c | 275

[ ... ]

+       if (!(options.logopt & TO_STDOUT) && daemon(0, 0))
+               return 1;

[ ... ]

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog