Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp46642pxx; Mon, 26 Oct 2020 03:00:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBIXZ7T9ec7BZb06uugia3PtIxhAqd4oYeDFc1pLJqNdpVWhTrmOdzt2TDze76MO9rfWCg X-Received: by 2002:a50:fb0d:: with SMTP id d13mr15159001edq.85.1603706403569; Mon, 26 Oct 2020 03:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603706403; cv=none; d=google.com; s=arc-20160816; b=pNX4Jc+XftpdJo2/6TKELtA2v4vBv4PZhratCQwK2rqAdfteyzMTdX4LcjQCKSQUSl fTDo8Hd9CjXzJFRVlIq0xe0UxbMxsdajS55P8f7z2XzjaGQ6SZ8cZdiz3bG+RgEDr4a2 K6rvwbO37rYsRGz1lmkXQObFCxiy3GKFI4SsbTpLd+cyqa/WBv8Mo8O9c4QnVbFrhDnG Mmz9YYH8e96JXkurJr/zyb6CLKhD9JyW2whFUVgpOOKaKlqf1aY93pvxa89apfTSAzj6 R5Bp315+rP7lUcZX0omfWClFxb346lwTrXxtDVudFlSif9mqq9pR43Wek23St+M2bPCW CTIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=oc9dTdhucISYbXveQ3zQvg8nChQDd969gjMkRh0Lt2k=; b=eg31c0dZQfN4jxJSf9UW+57mwQiDXicQ59AQJBhmjG8Aq/xzmEa9gImKZTnMYUer1Q ioafSF0UOUoBq6xV8MTzHrEGkYj+BfEKITjRVvCbB9kYeH1/AOImtO/IntUbfgi93taD uNbySsM/qZbWy3F0JLKog1AyQxYo0Q1gFf8PuZMq0dKmSLD76WdP86unpA1D7lB2VMJ8 YdR+WRWOcxGXH6qt3lBtZ0/OnDCvTs4/MJ1WsLKQJumYEXXWh7GK9p8wsL5j3xlhP0Ye 10ey99dOOA8pW1gv1DsbuufnKYkVEDaiKdwDXsBNr90e6/8tghzQXUPtTaDeuSSJKk0O miWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CgI2FU+d; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m18si7139917ejb.604.2020.10.26.02.59.38; Mon, 26 Oct 2020 03:00:03 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CgI2FU+d; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1772275AbgJZIyM (ORCPT + 99 others); Mon, 26 Oct 2020 04:54:12 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:35945 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1772271AbgJZIyL (ORCPT ); Mon, 26 Oct 2020 04:54:11 -0400 Received: by mail-lf1-f68.google.com with SMTP id h6so10704470lfj.3 for ; Mon, 26 Oct 2020 01:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=oc9dTdhucISYbXveQ3zQvg8nChQDd969gjMkRh0Lt2k=; b=CgI2FU+dy26y1KkTzCyrbyRg68N/YAkfUNMEAjio63rO3IthrFNWUD/aB76N59oTUy K6KR6fOvFEPjNR3SJArwMjacHKkxzJ7ozU8vcLDO/rYn43vKA3PSylLBoySD166lr526 ZbpIaCvHeyD+tKPW81sbkQmcXqJO+UodJJj+99rer7r/qoy6xjgTvF5R3sLug9C/oNsu 4vnFLC7RtN/f3iafqCgrSmOxN6NRhombkNB71zRHZ6sRbpc9K/bcyPXPmRnwvdmFwAoh OFVNhhA7IyWFol/28YTFyrAiFQ3ynba+2LNVgjx7P7lz2Jgcs4iGA2r+wv6RRcLFf30G ExMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=oc9dTdhucISYbXveQ3zQvg8nChQDd969gjMkRh0Lt2k=; b=WEj+bSZDZlO5TIOFaibyTf9PzB+bgDtjHcLQ6EY9PYX/huDagIG+3UUvz/Bosenvwr j4dyikKs3Xf05+nzjwpvk9wFSkP+Dfac4ol2Fo+FBCO0+vxQBdYFzAoNBv+4chSJPlIb YZZgePOUVW7NomqtNmrUGWC6MO4By2/G862VaDNaq+Uo+KccWi+fzsLJjmYw2AUrJLOM eCJbOA5prQZb0lO/GbfcgErWAF7YntyE7mVnNauVaemAynnLDNn+PEN87MJT+nfpCdjo Oi0lW3WiGRxSng13hRk3ydG/qLoACJb7Ln3kBRu4Oz0u6QMejCy4kLyhIybs6xN1Yobx Griw== X-Gm-Message-State: AOAM532dwduMMpnZic6asZP14uyIiET9a8sj5hnAhHdGrmtjegnJNJBB we+Kfq7bMOuqKbovvU+njcGwX76rPTnyPA== X-Received: by 2002:a19:8607:: with SMTP id i7mr4460797lfd.281.1603702448460; Mon, 26 Oct 2020 01:54:08 -0700 (PDT) Received: from [192.168.0.10] (89-109-58-109.dynamic.mts-nn.ru. [89.109.58.109]) by smtp.gmail.com with ESMTPSA id o23sm1109902lji.68.2020.10.26.01.54.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Oct 2020 01:54:07 -0700 (PDT) Subject: Re: [PATCH v2 05/15] perf session: introduce decompressor into trace reader object To: Jiri Olsa , Alexey Budankov Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Adrian Hunter , Andi Kleen , Peter Zijlstra , Ingo Molnar , linux-kernel References: <1ec29ed6-0047-d22f-630b-a7f5ccee96b4@linux.intel.com> <20201024154438.GI2589351@krava> From: Alexei Budankov Organization: Intel Corp. Message-ID: <6f760b28-f4bd-9de4-fadb-1ee79b4fc33b@gmail.com> Date: Mon, 26 Oct 2020 11:54:07 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201024154438.GI2589351@krava> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24.10.2020 18:44, Jiri Olsa wrote: > On Wed, Oct 21, 2020 at 07:00:30PM +0300, 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. >> >> 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); > > I don't think we're using braces in these cases, they are not necessary Corrected in v3. Thanks, Alexei > > jirka > >> >> 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 >> >> >