Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6756078yba; Tue, 14 May 2019 13:05:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4pTiODqxZE4WtRXhTSNToZIYfJ3HY9q3s9u7iSiyGzl9XS4jokLgk5KOODuuEYb3uPlU2 X-Received: by 2002:a62:54c7:: with SMTP id i190mr20982950pfb.87.1557864359669; Tue, 14 May 2019 13:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557864359; cv=none; d=google.com; s=arc-20160816; b=YrUwQS53YY79nNajE4KTxoFfTAEHd7dgjv1IYlI1UFiK/v+jlCJI/K9Vb6LJAe5BpM PuhE8dxu4T1ByWpTg8qkqL25ngDaMj6tsnoaf8j3eQEXUF9B2D5KOsxC8QpG7tpiyybS WcxSwIoTNwzxzz0njXSM+/h00NvWpbcCTGPYotRy9yLhksSyxhi3WfWp43aMj613ylqm GIs4YxtTkgIXYNsS8cdTNrOsyqP54C2Eqm/AJzSFsr0qhXa03bPtJFi+DPzu85jACfKt LCiUwuvCoQ4li26hVlYu71FNgTZS993qHyDa2cUjLCa/VktO+0bU5w8nUXIJqvHFTBPw 6uIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=2wZQ6xWxc+/+0XmEJfXIGreqSfh73KSQ5TKQRQXts58=; b=s1YUOEd4HGvdrzSrgMxU8LGRsAlLsDT2P5oHIhdrfUqiIM35o88UeUUAX4XSjvc4fj Gil5V52ct+n5vpkFHVdHpiq/TVI+zMgwI2VkgADdcDRVH3KHKZ/6FM+yBCo9iSLjMD+n ZDaroTOUrrxdEQJXeBTvL1biZiJyEXWAr9IX+o2E7lPfccVkWoLlfkU9jgnsdv4v88jp gCnHBUpDN2KjyFnXhOd2P52VTH93mAVOjw5L5TWjWlvxR+Z0fcR90f/IvmPGiPWfkeTf rB1krW1wCSMmGKhVDB+2AjYnmZViYDHXpGQPjcgH9vcrOTj0HPKTtJ4wiePgRiwLop3r sP+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XtTEYKum; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r15si9560037pgi.16.2019.05.14.13.05.44; Tue, 14 May 2019 13:05:59 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XtTEYKum; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726283AbfENUEe (ORCPT + 99 others); Tue, 14 May 2019 16:04:34 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:35213 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726143AbfENUEe (ORCPT ); Tue, 14 May 2019 16:04:34 -0400 Received: by mail-qt1-f195.google.com with SMTP id a39so582533qtk.2 for ; Tue, 14 May 2019 13:04:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2wZQ6xWxc+/+0XmEJfXIGreqSfh73KSQ5TKQRQXts58=; b=XtTEYKummlHi//ChjhE1VH9Y1m+spOUTqRcjCQJRhxc1cOI7N8azzbfCUibgdDWADS ANJ79xzwlFSQ0fLTcXSWIliRXwyKYRuzGQXm5iB1VnnPn6rU2FWTyqhcwrJyOaHLGnKz zNjoKmjsnu+PbBx40quKXVbVirwoJpsFDJ1ztemXfL2kARjy8F0n/4hRAWqSHQXr7VPX JQjjQHlDT7kqCaXzSrSyBxLNN6aIsi1WpejQpVm8nK8bG0B/LOaI2BrW28tDmKHC0RF6 lZNuZ3/Nbto98YIEfekmGXa2NJuozk/TFBtWRCG6ce3ehpOiRdv8wS/AdhwJ1HCeBHPl Kvvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2wZQ6xWxc+/+0XmEJfXIGreqSfh73KSQ5TKQRQXts58=; b=rAJJSXlunqUDKsrpk7apyF/NFbSUOMdeAXaxh//GQ67F49I1K/1a+F/j4jGdxhMse2 zKe9Rmhq5gte3YEpzPSOZZ5OJNGuBcoeC79a3hFL4nElK4R14pILW3b5q/M5TuCOXt61 GQEG/HHRvP9Sp8ROQ03v2cQYGGLm8ZBluy5TcX3LLbcafgR1IcnR4DyACuVhYMismI0U 4Y3DtGHE0qN3o5tT9Z07Q6CSScdekvQozgd8q03bEDwWdIzi06u7Dqfg+DoCqDDST3Pk eaPpeZ4ya+ypv1pjeoKpqBxSu0Nq+tQGjTjbNaylfyUaTNYlXZxBljx6V3VYzOqEDQty 0AAw== X-Gm-Message-State: APjAAAXpXtBplEcjR9ZmcZYQPPU7J3nfuGkaTnqhhhqdEHu92l4Gu1wh 7miU0hKCquXP40AdqPB4B6qN/b+J7ks= X-Received: by 2002:aed:2a25:: with SMTP id c34mr32386158qtd.62.1557864272534; Tue, 14 May 2019 13:04:32 -0700 (PDT) Received: from quaco.ghostprotocols.net (179-240-182-78.3g.claro.net.br. [179.240.182.78]) by smtp.gmail.com with ESMTPSA id o64sm9422001qke.61.2019.05.14.13.04.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 13:04:30 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id B9F0C403AD; Tue, 14 May 2019 17:04:24 -0300 (-03) Date: Tue, 14 May 2019 17:04:24 -0300 To: Alexey Budankov Cc: Jiri Olsa , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , Andi Kleen , linux-kernel Subject: Re: [PATCH v10 09/12] perf record: implement -z,--compression_level[=] option Message-ID: <20190514200424.GB8945@kernel.org> References: <12cce142-6238-475b-b9aa-236531c12c2b@linux.intel.com> <9ff06518-ae63-a908-e44d-5d9e56dd66d9@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9ff06518-ae63-a908-e44d-5d9e56dd66d9@linux.intel.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. - 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 -- - Arnaldo