Initialize a watcher instance from configuration.
This routine:
- Applies low-CPU mode selection to the sleep implementation.
- Enables requested feature plugins and calls their init/start callbacks.
- Builds the initial watch list and fingerprints.
- Optionally performs an initial run (w%run_on_start).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(watcher_t), | intent(inout) | :: | self | |||
| type(watch_config_t), | intent(in) | :: | cfg |
subroutine watcher_init(self, cfg) class(watcher_t), intent(inout) :: self type(watch_config_t), intent(in) :: cfg self%cfg = cfg call set_low_cpu(self%cfg%w%low_cpu) call enable_features(self%fm, self%cfg%w) call self%fm%init_all(self%cfg) call self%fm%on_start_all() call rebuild_watch_list(self, print_header=.true.) if (self%cfg%w%run_on_start) then call run_once(self, trim(self%cfg%fpm_cmdline)) end if end subroutine watcher_init