Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3953985pxu; Mon, 12 Oct 2020 05:57:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOIaxMNiv+kTSltujp09v39VAGrEceYqRwE7Vn+55pxq0nCh5cb3YsNDdioi3/WrgqArtO X-Received: by 2002:a05:6402:1012:: with SMTP id c18mr13837351edu.77.1602507453148; Mon, 12 Oct 2020 05:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602507453; cv=none; d=google.com; s=arc-20160816; b=xfxj3tFNWbf0ASJMGlX0CEB/FoXQMeT5aoe7aV1QFAZoPkYbTkpWHdX9hccIhZ6Gjq HTNCTIAd28FEZ5Jx87I+/ryFyHDzuBz1x0cL29a6JKHpMAe6YkWNmuUtkVUKTjhih3pR 9mwVBT5PnVyXsN05Y7LktD+zCrzweTSYJ133iG2+yTOzFom9jFk/jehQw9CXjg4C7Mg8 gN3k6TAap8alRdrRutWOCzJGqi9z03yy1C1inw3l/6tCqco8rq1Os9LsyRdUHih5bvJi XOdOWC57d3jK2qdOssJvu8xmub/OADOszKm4ut+VYCVJbdVXb0rR9WMDXbf3ZghZgoIA 7XXw== 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:ironport-sdr:ironport-sdr; bh=hySNKlyAcOPY4SH3Ft4lhMhR8WpNXTe0mpvP/zSRD5E=; b=qHlKM5sWXt1RerOQm0tywDkJHaq5K8FtnJs99D4oIuOrEZ15CmBAR2XBHMuCBcEGc5 X/5pBD0RTnzzGm9hYIQoq6t90HpZvv4NlAqoZNVZTbbDJKagZBCh0XhYDpEkBDOFPfu/ 74RXscpD5EgO2fkwwiDRGETjpCkrPofKHRMjgcsICOKjdoI3PtJ/DK77wzMDOJMduXGi SLeIEcw2ZDOe1mtbpMoj6zAY48d6aYqVpN7PwPrs4lD5M1TerK6mc93Og59i6Bliruev xtkO/BjpqhSKUHuSp/Sm3WMmSFJ7wcElnrCDRrXEyE1W0WIdn6VRN8s8rVcACTSqb41r hZYA== 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f26si718055edq.430.2020.10.12.05.57.10; Mon, 12 Oct 2020 05:57:33 -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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728854AbgJLI5G (ORCPT + 99 others); Mon, 12 Oct 2020 04:57:06 -0400 Received: from mga18.intel.com ([134.134.136.126]:30277 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726104AbgJLI5G (ORCPT ); Mon, 12 Oct 2020 04:57:06 -0400 IronPort-SDR: EQKaHuhpNKHV196kVb5jZaTd6S8GTyDQjW23fF6QWf9HqS5z41wCjMZJCGGvrQtmlne90iAH73 006KOZxW0+BA== X-IronPort-AV: E=McAfee;i="6000,8403,9771"; a="153540071" X-IronPort-AV: E=Sophos;i="5.77,366,1596524400"; d="scan'208";a="153540071" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 01:57:04 -0700 IronPort-SDR: zwAvp9tbj9CscFsxBTroJaWpbR+6PyB3989f4TMURwbpWthze4UMrqzJniSTQzu33yjvVWkPsE OLxTttoQMp5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,366,1596524400"; d="scan'208";a="420163741" Received: from linux.intel.com ([10.54.29.200]) by fmsmga001.fm.intel.com with ESMTP; 12 Oct 2020 01:57:03 -0700 Received: from [10.249.225.186] (abudanko-mobl.ccr.corp.intel.com [10.249.225.186]) by linux.intel.com (Postfix) with ESMTP id 7BE575805EC; Mon, 12 Oct 2020 01:57:01 -0700 (PDT) Subject: [PATCH v1 05/15] perf session: introduce decompressor into trace reader object To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Namhyung Kim , Alexander Shishkin , Andi Kleen , Adrian Hunter , Peter Zijlstra , Ingo Molnar , linux-kernel References: <810f3a69-0004-9dff-a911-b7ff97220ae0@linux.intel.com> From: Alexey Budankov Organization: Intel Corp. Message-ID: Date: Mon, 12 Oct 2020 11:57:00 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <810f3a69-0004-9dff-a911-b7ff97220ae0@linux.intel.com> 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 Introduce decompressor to trace reader object so that decompression could be executed on per trace file basis separately for every trace file located at data 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); 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