lkml.org 
[lkml]   [2021]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 06/24] perf daemon: Add config file support
Hi Jiri,

On Sun, Jan 31, 2021 at 8:49 AM Jiri Olsa <jolsa@kernel.org> wrote:
[SNIP]
> +#define SESSION_OUTPUT "output"
> +
> +/*
> + * Session states:
> + *
> + * OK - session is up and running
> + * RECONFIG - session is pending for reconfiguration,
> + * new values are already loaded in session object
> + * KILL - session is pending to be killed
> + *
> + * Session object life and its state is maintained by
> + * following functions:
> + *
> + * setup_server_config
> + * - reads config file and setup session objects
> + * with following states:
> + *
> + * OK - no change needed
> + * RECONFIG - session needs to be changed
> + * (run variable changed)
> + * KILL - session needs to be killed
> + * (session is no longer in config file)
> + *
> + * daemon__reconfig
> + * - scans session objects and does following actions
> + * for states:
> + *
> + * OK - skip
> + * RECONFIG - session is killed and re-run with new config
> + * KILL - session is killed
> + *
> + * - all sessions have OK state on the function exit
> + */
> +enum session_state {
> + SESSION_STATE__OK,
> + SESSION_STATE__RECONFIG,
> + SESSION_STATE__KILL,
> +};
> +
> +struct session {
> + char *base;
> + char *name;
> + char *run;
> + int pid;
> + struct list_head list;
> + enum session_state state;
> +};

Although I think calling it 'session' is intuitive, it's also confusing
as we already have struct perf_session...

Thanks,
Namhyung

\
 
 \ /
  Last update: 2021-02-04 13:45    [W:0.313 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site