Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-25 Thread Alexey Budankov
On 20.02.2019 18:09, Alexey Budankov wrote: > > On 12.02.2019 16:09, Jiri Olsa wrote: >> On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: >> >> SNIP >> >>> + compress_fn = (record__comp_enabled(rec) ? >>> + perf_session__zstd_compress : perf_session__zstd_copy); >>> +

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-21 Thread Alexey Budankov
On 21.02.2019 12:43, Jiri Olsa wrote: > On Wed, Feb 20, 2019 at 06:13:02PM +0300, Alexey Budankov wrote: >> >> On 12.02.2019 16:08, Jiri Olsa wrote: >>> On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: >>> >>> SNIP >>> diff --git a/tools/perf/util/session.c b/tools/perf/util/

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-21 Thread Alexey Budankov
On 21.02.2019 12:43, Jiri Olsa wrote: > On Wed, Feb 20, 2019 at 05:53:17PM +0300, Alexey Budankov wrote: >> >> On 12.02.2019 16:08, Jiri Olsa wrote: >>> On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: >>> >>> SNIP >>> @@ -774,6 +775,8 @@ static int record__mmap_read_evlist(s

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-21 Thread Jiri Olsa
On Wed, Feb 20, 2019 at 05:53:17PM +0300, Alexey Budankov wrote: > > On 12.02.2019 16:08, Jiri Olsa wrote: > > On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: > > > > SNIP > > > >> @@ -774,6 +775,8 @@ static int record__mmap_read_evlist(struct record > >> *rec, struct perf_evli

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-21 Thread Jiri Olsa
On Wed, Feb 20, 2019 at 06:13:02PM +0300, Alexey Budankov wrote: > > On 12.02.2019 16:08, Jiri Olsa wrote: > > On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: > > > > SNIP > > > >> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c > >> index 18fb9c8cbf9c..5d406e

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-20 Thread Alexey Budankov
On 12.02.2019 16:08, Jiri Olsa wrote: > On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: > > SNIP > >> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c >> index 18fb9c8cbf9c..5d406eebd058 100644 >> --- a/tools/perf/util/session.c >> +++ b/tools/perf/util/sessio

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-20 Thread Alexey Budankov
On 12.02.2019 16:09, Jiri Olsa wrote: > On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: > > SNIP > >> diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c >> index 239e9a13c2b7..980784b77fe2 100644 >> --- a/tools/perf/util/mmap.c >> +++ b/tools/perf/util/mmap.c >> @@ -1

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-20 Thread Alexey Budankov
On 12.02.2019 16:09, Jiri Olsa wrote: > On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: > > SNIP > >> +compress_fn = (record__comp_enabled(rec) ? >> +perf_session__zstd_compress : perf_session__zstd_copy); >> + >> if (record__aio_enabled(rec)) >>

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-20 Thread Alexey Budankov
On 12.02.2019 16:09, Jiri Olsa wrote: > On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: >> >> Compression is implemented using simple Zstd API and employs AIO data >> buffer as the memory to operate on. If the API call fails for some >> reason compression falls back to memcpy().

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-20 Thread Alexey Budankov
On 12.02.2019 16:09, Jiri Olsa wrote: > On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: > > SNIP > >> diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c >> index 239e9a13c2b7..980784b77fe2 100644 >> --- a/tools/perf/util/mmap.c >> +++ b/tools/perf/util/mmap.c >> @@ -1

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-20 Thread Alexey Budankov
On 12.02.2019 16:08, Jiri Olsa wrote: > On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: > > SNIP > >> @@ -774,6 +775,8 @@ static int record__mmap_read_evlist(struct record *rec, >> struct perf_evlist *evli >> struct perf_mmap *maps; >> int trace_fd = rec->data.file.f

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-12 Thread Jiri Olsa
On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: > > Compression is implemented using simple Zstd API and employs AIO data > buffer as the memory to operate on. If the API call fails for some > reason compression falls back to memcpy(). > > Data chunks are split and packed into PE

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-12 Thread Jiri Olsa
On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: SNIP > diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c > index 239e9a13c2b7..980784b77fe2 100644 > --- a/tools/perf/util/mmap.c > +++ b/tools/perf/util/mmap.c > @@ -156,6 +156,86 @@ void __weak auxtrace_mmap_params__set

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-12 Thread Jiri Olsa
On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: SNIP > diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c > index 239e9a13c2b7..980784b77fe2 100644 > --- a/tools/perf/util/mmap.c > +++ b/tools/perf/util/mmap.c > @@ -156,6 +156,86 @@ void __weak auxtrace_mmap_params__set

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-12 Thread Jiri Olsa
On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: SNIP > + compress_fn = (record__comp_enabled(rec) ? > + perf_session__zstd_compress : perf_session__zstd_copy); > + > if (record__aio_enabled(rec)) > off = record__aio_get_pos(trace_fd); > > @@

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-12 Thread Jiri Olsa
On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: SNIP > @@ -774,6 +775,8 @@ static int record__mmap_read_evlist(struct record *rec, > struct perf_evlist *evli > struct perf_mmap *maps; > int trace_fd = rec->data.file.fd; > off_t off; > + struct perf_session

Re: [PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-12 Thread Jiri Olsa
On Mon, Feb 11, 2019 at 11:23:40PM +0300, Alexey Budankov wrote: SNIP > diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c > index 18fb9c8cbf9c..5d406eebd058 100644 > --- a/tools/perf/util/session.c > +++ b/tools/perf/util/session.c > @@ -29,6 +29,112 @@ > #include "stat.h" > #i

[PATCH v2 3/4] perf record: enable runtime trace compression

2019-02-11 Thread Alexey Budankov
Compression is implemented using simple Zstd API and employs AIO data buffer as the memory to operate on. If the API call fails for some reason compression falls back to memcpy(). Data chunks are split and packed into PERF_RECORD_COMPRESSED records by 64KB at max. mmap-flush option value can be

[PATCH v2 3/4] perf record: enable runtime trace compression

2019-01-27 Thread Alexey Budankov
Compression is implemented using simple Zstd API and employs AIO data buffer as the memory to operate on. If the API call fails for some reason compression falls back to memcpy(). Data chunks are split and packed into PERF_RECORD_COMPRESSED records by 64KB at max. mmap-flush option value can be