[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <92556e66-4942-c186-7562-a0ee6964d5f8@linux.intel.com>
Date: Mon, 25 Feb 2019 18:27:27 +0300
From: Alexey Budankov <alexey.budankov@...ux.intel.com>
To: Jiri Olsa <jolsa@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Andi Kleen <ak@...ux.intel.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 3/4] perf record: enable runtime trace compression
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);
>>> +
>>> if (record__aio_enabled(rec))
>>> off = record__aio_get_pos(trace_fd);
>>>
>>> @@ -799,11 +805,21 @@ static int record__mmap_read_evlist(struct record *rec, struct perf_evlist *evli
>>> map->flush = MMAP_FLUSH_DEFAULT;
>>> }
>>> if (!record__aio_enabled(rec)) {
>>> - if (perf_mmap__push(map, rec, record__pushfn) != 0) {
>>> - if (sync)
>>> - map->flush = flush;
>>> - rc = -1;
>>> - goto out;
>>> + if (!record__comp_enabled(rec)) {
>>> + if (perf_mmap__push(map, rec, record__pushfn) != 0) {
>>> + if (sync)
>>> + map->flush = flush;
>>> + rc = -1;
>>> + goto out;
>>> + }
>>> + } else {
>>> + if (perf_mmap__pack(map, rec, record__pushfn,
>>> + compress_fn, session) != 0) {
>>> + if (sync)
>>> + map->flush = flush;
>>> + rc = -1;
>>> + goto out;
>>> + }
>>
>> I really dont like this.. the non-compression flow needs to stay untouched
>>
>> why don't you overload the record__pushfn function for compression
>> processing and stash the data in there?
>
> Yes, this becomes complicated and overloading could be an option to simplify it.
Redesigned compress() to be the param for __push() __aio_push() so this
__comp_enabled() if could be avoided. Overloading of __pushfn() doesn't
fit for aio case.
>
> Thanks,
> Alexey
>
>>
>> thanks,
>> jirka
>>
>
Powered by blists - more mailing lists