From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 017EEC43381 for ; Thu, 21 Feb 2019 09:43:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CFBD62086C for ; Thu, 21 Feb 2019 09:43:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727992AbfBUJnh (ORCPT ); Thu, 21 Feb 2019 04:43:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48514 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725932AbfBUJnf (ORCPT ); Thu, 21 Feb 2019 04:43:35 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9DFE33097032; Thu, 21 Feb 2019 09:43:35 +0000 (UTC) Received: from krava (unknown [10.43.17.20]) by smtp.corp.redhat.com (Postfix) with SMTP id F1AA65D707; Thu, 21 Feb 2019 09:43:33 +0000 (UTC) Date: Thu, 21 Feb 2019 10:43:33 +0100 From: Jiri Olsa To: Alexey Budankov Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Namhyung Kim , Alexander Shishkin , Andi Kleen , linux-kernel Subject: Re: [PATCH v2 3/4] perf record: enable runtime trace compression Message-ID: <20190221094333.GB10990@krava> References: <044ee2be-2e1d-e90f-7317-40083b5e716c@linux.intel.com> <5bc6958d-f4bc-d4ea-e5d0-16c5e7b73911@linux.intel.com> <20190212130856.GH775@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 21 Feb 2019 09:43:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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_evlist *evli > >> struct perf_mmap *maps; > >> int trace_fd = rec->data.file.fd; > >> off_t off; > >> + struct perf_session *session = rec->session; > >> + perf_mmap__compress_fn_t compress_fn; > >> > >> if (!evlist) > >> return 0; > >> @@ -785,6 +788,9 @@ static int record__mmap_read_evlist(struct record *rec, struct perf_evlist *evli > >> if (overwrite && evlist->bkw_mmap_state != BKW_MMAP_DATA_PENDING) > >> return 0; > >> > >> + compress_fn = (record__comp_enabled(rec) ? > >> + perf_session__zstd_compress : perf_session__zstd_copy); > >> + > > > > I don't follow what's the perf_session__zstd_copy function for..? > > It bridges AIO without compression case. so current state then.. why do we need new function for that? jirka > > Thanks, > Alexey > > > > > for !record__comp_enabled case we seem not to use it > > and calling the current perf_mmap__push interface > > > > however I dont see point to have this function at all > > > > jirka > > > > > >> 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; > >> + } > > > > SNIP > >