Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp636763img; Mon, 18 Mar 2019 10:47:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUbm23qhLU8PWA5KNLy9LUuxEf8fWZhJ3ni/lOqSqUVl/zjdIuePGtVTCBDkKiwi6C4E6E X-Received: by 2002:a65:5c02:: with SMTP id u2mr19186637pgr.120.1552931234877; Mon, 18 Mar 2019 10:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552931234; cv=none; d=google.com; s=arc-20160816; b=mjXVJa0LwVWlV6USevfgYl6LDYKU8To8UX/+c/lhEeOD/Iqj0kJqq4/WO9vKxHZXKv SlVWxqeUe7inDYX5lFFogPY035w36Te0Th5ndydVmeSbiOettxvaaiI4C79xhAF9Q2f8 ISII345Zo4D7uRjUNMU4p3yUjcazLYp9sFvVVbrQ5063V/aJJoSQd+iwB6SPgdg0pQEj zANEX7fPjyX4Q5r9MlgxOAczaJknCc8bygyRUOFC1wg7qgacPTw4rUaPeafkdDryY6dS kqqWVrHxtzF8LAqU/DaThwhcUDPeY1Zlyk9e8jEp4XMcdrcSXu4PTXOkfJNFmzEolWFE 4Y9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:references:cc:to:from:subject; bh=fVWY7iEPdv0u/RHs3rWg9UF/kbye5me9Wtr0tzq3r5E=; b=YKo+xGyBpkqi068qSjE9OP516MaNxaFtYRhEdXT1GlSN+k/ymFHi/lktlPexvDBYpF yozoatvsYQIdh/L6iKTCAKs43FEXFspWwifaQJIve/Q0/apkTRAyfLcBm5oEdH0Uryjd 3yuO60QsymJOMIKdKjeQwLpf1qyHClpipenG25XC9qdTYQFXJ0V2iSaX7b7C+laSGnwG FX5PbLrgXt39oH/JTtDqRiyFsDQBWtejjhdcbvD9JIV5bnsVz83npDs/TzcJUl+RkVna FJpD14erEDsrSM5qySGkLqzy0tABBRz2wd1SA30zghgFOOB7V2HKBr3iUEbjlrwocd/o xLhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id d9si2733668pgk.100.2019.03.18.10.46.59; Mon, 18 Mar 2019 10:47:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727662AbfCRRqX (ORCPT + 99 others); Mon, 18 Mar 2019 13:46:23 -0400 Received: from mga01.intel.com ([192.55.52.88]:27340 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726626AbfCRRqV (ORCPT ); Mon, 18 Mar 2019 13:46:21 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Mar 2019 10:46:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,494,1544515200"; d="scan'208";a="153454112" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP; 18 Mar 2019 10:46:20 -0700 Received: from [10.251.91.19] (abudanko-mobl.ccr.corp.intel.com [10.251.91.19]) by linux.intel.com (Postfix) with ESMTP id 553D2580238; Mon, 18 Mar 2019 10:46:18 -0700 (PDT) Subject: [PATCH v10 12/12] perf tests: implement Zstd comp/decomp integration test From: Alexey Budankov To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel References: <12cce142-6238-475b-b9aa-236531c12c2b@linux.intel.com> Organization: Intel Corp. Message-ID: Date: Mon, 18 Mar 2019 20:46:17 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <12cce142-6238-475b-b9aa-236531c12c2b@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implemented basic integration test for Zstd based trace compression/decompression in record and report modes. Signed-off-by: Alexey Budankov --- .../tests/shell/record+zstd_comp_decomp.sh | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 tools/perf/tests/shell/record+zstd_comp_decomp.sh diff --git a/tools/perf/tests/shell/record+zstd_comp_decomp.sh b/tools/perf/tests/shell/record+zstd_comp_decomp.sh new file mode 100755 index 000000000000..c0ff142bf66a --- /dev/null +++ b/tools/perf/tests/shell/record+zstd_comp_decomp.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# record trace Zstd compression/decompression + +trace_file=$(mktemp /tmp/perf.data.XXX) +perf_tool=perf +output=/dev/null + +skip_if_no_z_record() { + $perf_tool record -h 2>&1 | grep '\-z, \-\-compression\-level' +} + +collect_z_record() { + echo "Collecting compressed record trace file:" + $perf_tool record -o $trace_file -g -z -F 25000 -- \ + dd count=1000 if=/dev/random of=/dev/null > $output 2>&1 +} + +check_compressed_stats() { + echo "Checking compressed events stats:" + $perf_tool report -i $trace_file --header --stats | \ + grep -E "(# compressed : Zstd,)|(COMPRESSED events:)" > $output 2>&1 +} + +check_compressed_output() { + $perf_tool inject -i $trace_file -o $trace_file.decomp && + $perf_tool report -i $trace_file --stdio | head -n -3 > $trace_file.comp.output && + $perf_tool report -i $trace_file.decomp --stdio | head -n -3 > $trace_file.decomp.output && + diff $trace_file.comp.output $trace_file.decomp.output > $output 2>&1 +} + +skip_if_no_z_record || exit 2 +collect_z_record && check_compressed_stats && check_compressed_output +err=$? +rm -f $trace_file* +exit $err -- 2.20.1