[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9bf22a7b-0b56-c55f-c8b2-60c8e6ed0ef9@linux.intel.com>
Date: Wed, 24 Jun 2020 16:39:11 +0300
From: Alexey Budankov <alexey.budankov@...ux.intel.com>
To: Jiri Olsa <jolsa@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Andi Kleen <ak@...ux.intel.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v8 09/13] perf stat: implement control commands handling
On 23.06.2020 17:54, Jiri Olsa wrote:
> On Wed, Jun 17, 2020 at 11:41:30AM +0300, Alexey Budankov wrote:
>>
>> Implement handling of 'enable' and 'disable' control commands
>> coming from control file descriptor. process_evlist() function
>> checks for events on control fds and makes required operations.
>> If poll event splits initiated timeout interval then the reminder
>> is calculated and still waited in the following poll() syscall.
>>
>> Signed-off-by: Alexey Budankov <alexey.budankov@...ux.intel.com>
>> ---
>> tools/perf/builtin-stat.c | 67 +++++++++++++++++++++++++++++----------
>> 1 file changed, 50 insertions(+), 17 deletions(-)
>>
>> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
>> index f88d5ee55022..cc56d71a3ed5 100644
>> --- a/tools/perf/builtin-stat.c
>> +++ b/tools/perf/builtin-stat.c
>> @@ -492,6 +492,31 @@ static bool process_timeout(int timeout, unsigned int interval, int *times)
>> return print_interval(interval, times);
>> }
>>
>> +static bool process_evlist(struct evlist *evlist, unsigned int interval, int *times)
>> +{
>> + bool stop = false;
>> + enum evlist_ctl_cmd cmd = EVLIST_CTL_CMD_UNSUPPORTED;
>> +
>> + if (evlist__ctlfd_process(evlist, &cmd) > 0) {
>> + switch (cmd) {
>> + case EVLIST_CTL_CMD_ENABLE:
>> + pr_info(EVLIST_ENABLED_MSG);
>> + stop = print_interval(interval, times);
>
> why is interval printed in here?
>
>> + break;
>> + case EVLIST_CTL_CMD_DISABLE:
>> + stop = print_interval(interval, times);
>
> and here?
>
> it should be called from the main loop when the interval time is elapsed no?
It is called from the main loop too and it is also additionally called here
to provide indication and counter values on commands processing times.
~Alexey
>
> jirka
>
Powered by blists - more mailing lists