[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM9d7cixP+28ifLT4sd1Q-eXsqOrGi=kbOx5tDBZ3uCu2KZHgw@mail.gmail.com>
Date: Mon, 1 Mar 2021 23:20:08 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: "Bayduraev, Alexey V" <alexey.v.bayduraev@...ux.intel.com>
Cc: Alexei Budankov <abudankov@...wei.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
Andi Kleen <ak@...ux.intel.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Alexander Antonov <alexander.antonov@...ux.intel.com>
Subject: Re: [PATCH v3 07/12] perf record: init data file at mmap buffer object
On Mon, Mar 1, 2021 at 10:33 PM Bayduraev, Alexey V
<alexey.v.bayduraev@...ux.intel.com> wrote:
>
> On 01.03.2021 14:44, Namhyung Kim wrote:
> > Hello,
> >
> > On Mon, Mar 1, 2021 at 8:16 PM Bayduraev, Alexey V
> > <alexey.v.bayduraev@...ux.intel.com> wrote:
> >>
> >> Hi,
> >>
> >> On 20.11.2020 13:49, Namhyung Kim wrote:
> >>> On Mon, Nov 16, 2020 at 03:19:41PM +0300, Alexey Budankov wrote:
> >>
> >> <SNIP>
> >>
> >>>>
> >>>> @@ -1400,8 +1417,12 @@ static int record__mmap_read_evlist(struct record *rec, struct evlist *evlist,
> >>>> /*
> >>>> * Mark the round finished in case we wrote
> >>>> * at least one event.
> >>>> + *
> >>>> + * No need for round events in directory mode,
> >>>> + * because per-cpu maps and files have data
> >>>> + * sorted by kernel.
> >>>
> >>> But it's not just for single cpu since task can migrate so we need to
> >>> look at other cpu's data too. Thus we use the ordered events queue
> >>> and round events help to determine when to flush the data. Without
> >>> the round events, it'd consume huge amount of memory during report.
> >>>
> >>> If we separate tracking records and process them first, we should be
> >>> able to process samples immediately without sorting them in the
> >>> ordered event queue. This will save both cpu cycles and memory
> >>> footprint significantly IMHO.
> >>>
> >>> Thanks,
> >>> Namhyung
> >>>
> >>
> >> As far as I understand, to split tracing records (FORK/MMAP/COMM) into
> >> a separate file, we need to implement a runtime trace decoder on the
> >> perf-record side to recognize such tracing records coming from the kernel.
> >> Is that what you mean?
> >
> > No, I meant separating the mmap buffers so that the record process
> > can save the data without decoding.
> >
>
> Thanks,
>
> Do you think this can be implemented only on the user side by creating a dummy
> event and manipulating by mmap/comm/task flags of struct perf_event_attr?
> Or some changes on the kernel side are necessary?
It's only user space changes but it can be large. Actually I worked
on parallelizing
perf report several years ago (not finished, but I don't have time for
it now). At the
time, perf record didn't support directory output so I made it have indexes to
different data parts. But you can get the idea from the code in
https://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git/log/?h=perf/threaded-v5
Thanks,
Namhyung
Powered by blists - more mailing lists