[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <18730616-8e60-70df-9624-d1fbc0a0893e@gmail.com>
Date: Mon, 26 Oct 2020 11:39:43 +0300
From: Alexei Budankov <budankov.lore@...il.com>
To: Jiri Olsa <jolsa@...hat.com>,
Alexey Budankov <alexey.budankov@...ux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Andi Kleen <ak@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
budankov.lore@...il.com
Subject: Re: [PATCH v2 14/15] perf record: start threads in the beginning of
trace streaming
On 24.10.2020 18:44, Jiri Olsa wrote:
> On Wed, Oct 21, 2020 at 07:10:09PM +0300, Alexey Budankov wrote:
>>
>> Start threads in detached state because its management is possible
>> via messaging. Block signals prior the threads start so only main
>> tool thread would be notified on external async signals during data
>> collection. Streaming threads connect one-to-one to mapped data
>> buffers and write into per-CPU trace files located at data directory.
>> Data buffers and threads are affined to local NUMA nodes and monitored
>> CPUs according to system topology. --cpu option can be used to specify
>> CPUs to be monitored.
>>
>> Signed-off-by: Alexey Budankov <alexey.budankov@...ux.intel.com>
>> ---
>> tools/perf/builtin-record.c | 128 +++++++++++++++++++++++++++++++++---
>> 1 file changed, 120 insertions(+), 8 deletions(-)
>>
>> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
>> index a15642656066..1d41e996a994 100644
>> --- a/tools/perf/builtin-record.c
>> +++ b/tools/perf/builtin-record.c
>> @@ -56,6 +56,7 @@
>> #include <poll.h>
>> #include <pthread.h>
>> #include <unistd.h>
>> +#include <sys/syscall.h>
>> #include <sched.h>
>> #include <signal.h>
>> #ifdef HAVE_EVENTFD_SUPPORT
>> @@ -1377,6 +1378,62 @@ static void record__thread_munmap_filtered(struct fdarray *fda, int fd,
>> perf_mmap__put(map);
>> }
>>
>> +static void *record__thread(void *arg)
>> +{
>> + enum thread_msg msg = THREAD_MSG__READY;
>> + bool terminate = false;
>> + struct fdarray *pollfd;
>> + int err, ctlfd_pos;
>> +
>> + thread = arg;
>> + thread->tid = syscall(SYS_gettid);
>> +
>> + err = write(thread->comm.ack[1], &msg, sizeof(msg));
>> + if (err == -1)
>> + pr_err("threads: %d failed to notify on start. Error %m", thread->tid);
>> +
>> + pollfd = &(thread->pollfd);
>
> I don't think braces are necessary in here
Corrected in v3.
Alexei
Powered by blists - more mailing lists