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=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 B6147C388F7 for ; Thu, 22 Oct 2020 04:36:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 53B952244C for ; Thu, 22 Oct 2020 04:36:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603341375; bh=P3nFnruroMqrMHqhoW8v9oefq8FMNd+ojQNvncEYu8M=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=mRmmEfvyO8Ud5MT+MnO2I49i6mzQEEP8vwd3+h2+juBvbUVToWFW6XsygzvYNYtu3 to5VIJiJwXyTBqltjd7KUCRB5O2vNqxkxu8KqNN/xRXqeODJ8HPhm8SB87F6r0q4wj erJFJkYDR39fRmcYr/znb5R2vLN6HYK06RVxzHGI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2443995AbgJVEgO (ORCPT ); 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-Google-Smtp-Source: ABdhPJziEekR2fPhRBerNtqricUmPS/et+OY8uzsvpXbmmsSesXPpQsZ9CIewWzE7WhbAjIkCzirFDmVoPeN7OAxBQ4= 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 > >