[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181109082242.GJ29732@krava>
Date: Fri, 9 Nov 2018 09:22:42 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Alexey Budankov <alexey.budankov@...ux.intel.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
Andi Kleen <ak@...ux.intel.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v15 0/3]: perf: reduce data loss when profiling highly
parallel CPU bound workloads
On Tue, Nov 06, 2018 at 11:53:02AM +0300, Alexey Budankov wrote:
>
> Currently in record mode the tool implements trace writing serially.
> The algorithm loops over mapped per-cpu data buffers and stores
> ready data chunks into a trace file using write() system call.
>
> At some circumstances the kernel may lack free space in a buffer
> because the other buffer's half is not yet written to disk due to
> some other buffer's data writing by the tool at the moment.
>
> Thus serial trace writing implementation may cause the kernel
> to loose profiling data and that is what observed when profiling
> highly parallel CPU bound workloads on machines with big number
> of cores.
>
> Experiment with profiling matrix multiplication code executing 128
> threads on Intel Xeon Phi (KNM) with 272 cores, like below,
> demonstrates data loss metrics value of 98%:
>
> /usr/bin/time perf record -o /tmp/perf-ser.data -a -N -B -T -R -g \
> --call-graph dwarf,1024 --user-regs=IP,SP,BP --switch-events \
> -e cycles,instructions,ref-cycles,software/period=1,name=cs,config=0x3/Duk -- \
> matrix.gcc
>
> Data loss metrics is the ratio lost_time/elapsed_time where
> lost_time is the sum of time intervals containing PERF_RECORD_LOST
> records and elapsed_time is the elapsed application run time
> under profiling.
>
> Applying asynchronous trace streaming thru Posix AIO API [1] lowers
> data loss metrics value providing 2x improvement (from 98% to ~1%)
>
> Asynchronous trace streaming is currently limited to glibc linkage.
> musl libc [5] also provides Posix AIO API implementation, however
> the patchkit is not tested with it. There may be other libc libraries
> linked by Perf tool that currently lack Posix AIO API support [2],
> [3], [4] so NO_AIO define may be used to limit Perf tool binary to
> serial streaming only.
>
> ---
> Alexey Budankov (3):
> perf util: map data buffer for preserving collected data
> perf record: enable asynchronous trace writing
> perf record: extend trace writing to multi AIO
FYI I was rebasing my threads branch on top of this and
first 2 won't apply anymore on Arnaldo's perf/core
Arnaldo,
could we get this merged soon? the world around is moving
fast and we don't want 20th revision on this ;-)
thanks,
jirka
Powered by blists - more mailing lists