Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5627181pxu; Thu, 22 Oct 2020 07:16:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGxEJVHyct0t7bif0x+3Mo/2WzoLa/ZT4WkzoRoWl7grSADtavw0S5UFimoVAfUPsuwm8L X-Received: by 2002:a05:6402:31af:: with SMTP id dj15mr2320193edb.275.1603376204571; Thu, 22 Oct 2020 07:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603376204; cv=none; d=google.com; s=arc-20160816; b=GJRK9PiQzdk4PYcyaqurWOsx1b1UdbQFBseajDvXClNPgT9r8etJs9cjNJiD7sjvgR a0wXAjA+3K+FLccKPOOj9KYTGn+Y5cwBu4M2gdOWg6LYyVh2PytEynyFDhHI+Prr44Jw puc6y98Bhpt5ZLlC7/iGAZCuQJYPnBT5KuBPeY9JUw0hb047d+Vcm+u3MPSxJR4Wpujd csGdT7LCVQuPV4cuZ2dBt1TniSXWSbw+/aKhiMlCt9DMTuixTPWUwBXiqSf4NBr/kuoT NV+928r0razDydHr9HnmPFrWFW7GaarNfRr+SdGcx1oTWI3yu95OaFpJsLbqjxUD5tYl 0Zog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=hc/tVgY/tw8iRj/ePwmccLYyEyi2uJxxtFlcvBAdZdM=; b=js1If71aZPp+xqc05lYcbxxmcmf4OVz/7ENcw+zc+vBSy9PoquGgGPVPIdfTaT5ntG dg3rtWDFb8KrYIirxfMA0VVyuZiKSfzfCvn029SVi6YEi4tsib6Do+/QkztXJzKgjKfI A678raJ92SQ3xx1oxIKBueu5G/2+RL7175gdl9SLUUJZSdRUyyaq0URenqiXt/ZMSQHb A1FyPZIfXxKAGPcrxkfzNJeX6YrLlIKK60ldI/MYhLQ4yuCAlhZP3JOwv9YEAp++hvj7 4PkF87hO+efTpnxZFDu7/BeC79zgzaCoWIoL6BdK0nHlUaM07aKjynHpGS9kTQdfhTZH GjXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si992561edw.363.2020.10.22.07.16.22; Thu, 22 Oct 2020 07:16:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2443930AbgJVEgO (ORCPT + 99 others); Thu, 22 Oct 2020 00:36:14 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:36475 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2443812AbgJVEgN (ORCPT ); Thu, 22 Oct 2020 00:36:13 -0400 Received: by mail-wr1-f65.google.com with SMTP id x7so402191wrl.3 for ; Wed, 21 Oct 2020 21:36:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hc/tVgY/tw8iRj/ePwmccLYyEyi2uJxxtFlcvBAdZdM=; b=gZxHqyek3qmjjYDY6oedNftdNwfURAy+08ck8gvdXbdbZUTAU0TY2t1i4zgnQqNdfy on4invOMnjoc69lr5qfoMKkTPeEJHHQstiMwU7AzhrmhFbhA/bqyWmrT0JhE/3CiQMNI C/0aMd7DoZRgCnoD7r3hihchdpLctaszAz981383hbKY84MAraiL7d8rat5kySx5q3GO PKjxsTfipBz6j/jOuHzKG85ws+mHa4qQQAWWQBuTeYBpGAnCCfYSEugWpyTex+UXO8pQ Cbh+P3YzCQj7hL9hPY4jOU29lrItQXtGGs68veISHGYtEmlX99Mt/mm9ZsdDG2PZDW/X HV8g== X-Gm-Message-State: AOAM531OKjObmFNeU0aVg3Vvd5UTfeCOYjpdF3G5Y7D01254JY73kEZQ FL3izenmYxKREMn06mMtPL1XFVa48JCMRAWqdoI= X-Received: by 2002:adf:a553:: with SMTP id j19mr505099wrb.349.1603341372011; Wed, 21 Oct 2020 21:36:12 -0700 (PDT) MIME-Version: 1.0 References: <1ec29ed6-0047-d22f-630b-a7f5ccee96b4@linux.intel.com> In-Reply-To: From: Namhyung Kim Date: Thu, 22 Oct 2020 13:36:01 +0900 Message-ID: Subject: Re: [PATCH v2 05/15] perf session: introduce decompressor into trace reader object To: Alexey Budankov Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Alexander Shishkin , Adrian Hunter , Andi Kleen , Peter Zijlstra , Ingo Molnar , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 22, 2020 at 1:00 AM Alexey Budankov wrote: > > > Introduce decompressor to trace reader object so that decompression > could be executed on per trace file basis separately for every > trace file located in trace directory. I'm slightly uncomfortable with the word 'trace' here as it's used for other cases like perf trace and ftrace. Maybe we can change it to 'profile' and/or 'data file'? Thanks Namhyung > > Signed-off-by: Alexey Budankov > --- > tools/perf/util/session.c | 4 +++- > tools/perf/util/session.h | 1 + > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c > index 911b2dbcd0ac..6afc670fdf0c 100644 > --- a/tools/perf/util/session.c > +++ b/tools/perf/util/session.c > @@ -44,6 +44,8 @@ static int perf_session__process_compressed_event(struct perf_session *session, > u64 decomp_last_rem = 0; > size_t mmap_len, decomp_len = session->header.env.comp_mmap_len; > struct decomp *decomp, *decomp_last = session->decomp_last; > + struct zstd_data *zstd_data = session->reader ? > + &(session->reader->zstd_data) : &(session->zstd_data); > > if (decomp_last) { > decomp_last_rem = decomp_last->size - decomp_last->head; > @@ -71,7 +73,7 @@ static int perf_session__process_compressed_event(struct perf_session *session, > src = (void *)event + sizeof(struct perf_record_compressed); > src_size = event->pack.header.size - sizeof(struct perf_record_compressed); > > - decomp_size = zstd_decompress_stream(&(session->zstd_data), src, src_size, > + decomp_size = zstd_decompress_stream(zstd_data, src, src_size, > &(decomp->data[decomp_last_rem]), decomp_len - decomp_last_rem); > if (!decomp_size) { > munmap(decomp, mmap_len); > diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h > index abdb8518a81f..4fc9ccdf7970 100644 > --- a/tools/perf/util/session.h > +++ b/tools/perf/util/session.h > @@ -42,6 +42,7 @@ struct reader { > u64 data_size; > u64 data_offset; > reader_cb_t process; > + struct zstd_data zstd_data; > }; > > struct perf_session { > -- > 2.24.1 > >