[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201216081439.GA4153@krava>
Date: Wed, 16 Dec 2020 09:14:39 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Alexei Budankov <abudankov@...wei.com>
Cc: Jiri Olsa <jolsa@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
lkml <linux-kernel@...r.kernel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Michael Petlan <mpetlan@...hat.com>,
Ian Rogers <irogers@...gle.com>,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 4/8] perf daemon: Add daemon command
On Wed, Dec 16, 2020 at 10:54:43AM +0300, Alexei Budankov wrote:
>
> On 15.12.2020 22:43, Jiri Olsa wrote:
> > On Tue, Dec 15, 2020 at 06:40:26PM +0300, Alexei Budankov wrote:
> >> Hi,
> >>
> >> On 12.12.2020 13:43, Jiri Olsa wrote:
> >>> Adding daemon command that allows to run record sessions
> >>> on background. Each session represents one perf record
> >>> process and is configured in config file.
> >>>
> >>> Example:
> >>>
> >>> # cat config.daemon
> >>> [daemon]
> >>> base=/opt/perfdata
> >>
> >> It could probably make sense to consider using locations at /var/
> >> directory, similar to other already existing daemon processes in
> >> system so admin and user experience would be easily reusabe for
> >> performance monitoring daemon (service).
> >
> > hm, you can specify any /var path in there if you like,
> > do you suggest to hardcode it?
>
> This thing: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
> Since Perf is a part of OS it would better use some standardized locations.
sure, user is free to configure that
SNIP
> >>> + start = current = time(NULL);
> >>> +
> >>> + do {
> >>> + usleep(500);
> >>
> >> This polling design is actually sub-optimal because it induces redundant
> >> noise in a system. Ideally it should be implemented in async fashion so
> >> kernel would atomically notify daemon process on event happened in some
> >> of record processes e.g. using of poll-like() system call.
> >
> > ok, any suggestion?
>
> Possibly, checking SIGCHLDs via signalfd [1] OR using pidfd [2] on kernel v5.3+
>
> [1] https://man7.org/linux/man-pages/man2/signalfd.2.html
> [2] https://man7.org/linux/man-pages/man2/pidfd_open.2.html
will check, thanks
jirka
Powered by blists - more mailing lists