Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp190919yba; Tue, 14 May 2019 22:49:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyv6S1vdYJq+7u0hEn1WWDfAy2uILCVQoJ/4m99xS85rKMglD6cjVbUeRyy1haago+J1xV7 X-Received: by 2002:a63:1701:: with SMTP id x1mr42082578pgl.153.1557899373986; Tue, 14 May 2019 22:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557899373; cv=none; d=google.com; s=arc-20160816; b=lA9CZGwNPPPHe/91754Z4ChQhVfglwAsjVHZN/rVqKNEnjvhZOaE+08DdQnvogmFr1 hZAnEz04lVIJyxuDgH1TZT8WJbUR5kjB2lxSl3JEYlchC1yn5ucosThW78M+d6QkncNS QbZVH4f4541x9h8i1L3GcM89q9iyesPw9lSeajF18s3h542MSMOYkkr7+atzd7WQ/Qh5 8uTpKMRxPwwVgMpStbgNyJYNuteHnLHufa2Nnw+HIY1Z0jOpoKRV9oLmB0Ii6i4tHZcS tabkFc1UTKxbXOdaAuLKP63nCgVKd/fFV8twbX8ZDWPO/sn9jV4wABrMTtNp/nx/gd0p u45A== 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:from:references:cc:to:subject; bh=1tdwhDuLw6YimbGI59sqQc5TAN1NDjq6elwb9TEhoaU=; b=cGzvJLRoHNTAvTEeNDIyFfsjgKWbm328b6J6v8uh6SrcRQqvmtX9RVyw7nipPpjLMW aA+5xRkYAjMcIw+1N2JpwcWjaXKkmiFGE3rJEsvZBG78MGiTfn8VZXG6TGmkNaw8ti8D BHQQiaG1E6rk4ynhbjCKz7rM7qnkXcpZAvf5i6BJneAmnGPGA4buMGcDF3RdrltvQzZ9 FtWt6OsaKAkOPOsgAxml1YnxOAHESYgKypN4OveVq2cgGzT+FASdECx74y631sDH8iHx TPYhFVNK4PZmBWoiaAbfvbeaAvs2VfJiPVBsn4wML4sASJAVXS+nzmp3sMzbAWx/Mx8u zvDw== 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 f197si1174139pfa.276.2019.05.14.22.49.17; Tue, 14 May 2019 22:49:33 -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 S1726347AbfEOFqq (ORCPT + 99 others); Wed, 15 May 2019 01:46:46 -0400 Received: from mga06.intel.com ([134.134.136.31]:51202 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbfEOFqq (ORCPT ); Wed, 15 May 2019 01:46:46 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 May 2019 22:46:45 -0700 X-ExtLoop1: 1 Received: from linux.intel.com ([10.54.29.200]) by FMSMGA003.fm.intel.com with ESMTP; 14 May 2019 22:46:45 -0700 Received: from [10.252.16.172] (abudanko-mobl.ccr.corp.intel.com [10.252.16.172]) by linux.intel.com (Postfix) with ESMTP id 9ED8F5800CB; Tue, 14 May 2019 22:46:42 -0700 (PDT) Subject: Re: [PATCH v10 09/12] perf record: implement -z,--compression_level[=] option 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> <9ff06518-ae63-a908-e44d-5d9e56dd66d9@linux.intel.com> <20190514200424.GB8945@kernel.org> From: Alexey Budankov Organization: Intel Corp. Message-ID: <08ee0c0f-fc4b-c8cb-4ab4-6f976d156004@linux.intel.com> Date: Wed, 15 May 2019 08:46:41 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190514200424.GB8945@kernel.org> 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 On 14.05.2019 23:04, Arnaldo Carvalho de Melo wrote: > Em Mon, Mar 18, 2019 at 08:44:42PM +0300, Alexey Budankov escreveu: >> >> Implemented -z,--compression_level[=] option that enables compression >> of mmaped kernel data buffers content in runtime during perf record >> mode collection. Default option value is 1 (fastest compression). >> >> Compression overhead has been measured for serial and AIO streaming >> when profiling matrix multiplication workload: >> >> ------------------------------------------------------------- >> | SERIAL | AIO-1 | >> ----------------------------------------------------------------| > > Please don't have lines starting with --- in the cset comment log > message, breaks scripts, fixing it up now. Oops, will do my best about that. Thanks. ~Alexey > > - Arnaldo > >> |-z | OVH(x) | ratio(x) size(MiB) | OVH(x) | ratio(x) size(MiB) | >> |---------------------------------------------------------------| >> | 0 | 1,00 | 1,000 179,424 | 1,00 | 1,000 187,527 | >> | 1 | 1,04 | 8,427 181,148 | 1,01 | 8,474 188,562 | >> | 2 | 1,07 | 8,055 186,953 | 1,03 | 7,912 191,773 | >> | 3 | 1,04 | 8,283 181,908 | 1,03 | 8,220 191,078 | >> | 5 | 1,09 | 8,101 187,705 | 1,05 | 7,780 190,065 | >> | 8 | 1,05 | 9,217 179,191 | 1,12 | 6,111 193,024 | >> ----------------------------------------------------------------- >> >> OVH = (Execution time with -z N) / (Execution time with -z 0) >> >> ratio - compression ratio >> size - number of bytes that was compressed >> >> size ~= trace size x ratio >> >> Signed-off-by: Alexey Budankov >> --- >> tools/perf/Documentation/perf-record.txt | 5 +++++ >> tools/perf/builtin-record.c | 25 ++++++++++++++++++++++++ >> 2 files changed, 30 insertions(+) >> >> diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt >> index 18fceb49434e..0567bacc2ae6 100644 >> --- a/tools/perf/Documentation/perf-record.txt >> +++ b/tools/perf/Documentation/perf-record.txt >> @@ -471,6 +471,11 @@ Also at some cases executing less trace write syscalls with bigger data size can >> shorter than executing more trace write syscalls with smaller data size thus lowering >> runtime profiling overhead. >> >> +-z:: >> +--compression-level[=n]:: >> +Produce compressed trace using specified level n (default: 1 - fastest compression, >> +22 - smallest trace) >> + >> --all-kernel:: >> Configure all used events to run in kernel space. >> >> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c >> index 2e083891affa..7258f2964a3b 100644 >> --- a/tools/perf/builtin-record.c >> +++ b/tools/perf/builtin-record.c >> @@ -440,6 +440,26 @@ static int record__mmap_flush_parse(const struct option *opt, >> return 0; >> } >> >> +#ifdef HAVE_ZSTD_SUPPORT >> +static unsigned int comp_level_default = 1; >> +static int record__parse_comp_level(const struct option *opt, >> + const char *str, >> + int unset) >> +{ >> + struct record_opts *opts = (struct record_opts *)opt->value; >> + >> + if (unset) { >> + opts->comp_level = 0; >> + } else { >> + if (str) >> + opts->comp_level = strtol(str, NULL, 0); >> + if (!opts->comp_level) >> + opts->comp_level = comp_level_default; >> + } >> + >> + return 0; >> +} >> +#endif >> static unsigned int comp_level_max = 22; >> >> static int record__comp_enabled(struct record *rec) >> @@ -2169,6 +2189,11 @@ static struct option __record_options[] = { >> OPT_CALLBACK(0, "affinity", &record.opts, "node|cpu", >> "Set affinity mask of trace reading thread to NUMA node cpu mask or cpu of processed mmap buffer", >> record__parse_affinity), >> +#ifdef HAVE_ZSTD_SUPPORT >> + OPT_CALLBACK_OPTARG('z', "compression-level", &record.opts, &comp_level_default, >> + "n", "Produce compressed trace using specified level (default: 1 - fastest compression, 22 - smallest trace)", >> + record__parse_comp_level), >> +#endif >> OPT_END() >> }; >> >> -- >> 2.20.1 >