Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp719248yba; Wed, 15 May 2019 08:47:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMj8Ufag5NPETcw/PVljnQT82xTG44zt8i3Y2pik2Q2m0y7br3B67ChsKVv5W8PdTZDZI+ X-Received: by 2002:aa7:951c:: with SMTP id b28mr30076086pfp.99.1557935256826; Wed, 15 May 2019 08:47:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557935256; cv=none; d=google.com; s=arc-20160816; b=bMITOQ6/ukrPqHY2yJ+T+ZJrEjnvRDRjVq8pjTQaFT+je6LhTMmJdaVp8EYO3F+O5e eTuaa+wCAhIXCm49eVquZw3Q5fRSeCusZ/0UWvKNGe7+eWis+oPkpn8mLEORgkZGSWxo a9dDGkH7NaD6eZhV+FjEVI1Tx612KMI04lt+KiekB1QCpltw0019xUuxuTtwpVS6Mog6 gIW6PNEeQj62YJqKaLzPX1oeZ9Ye7Op1U38m8vC/kE7J/3NI3ITwgfJ561+7LKr11tR5 rkJDAS+i63wQXwvbSgnF4gXH5xLPxckmIBNbQE6OmpvpySHiaSGZ4WJ5sKXDZnNjH61Z 5a4Q== 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=bzOwagVNxxVCcR78S5napYEPlCZI0R/CEJuU3xnxZPc=; b=RWQXs9X5euQGg20MARGSuEO8WO1GzzSWqn0TPFMJmtfyt5c+DvAt3yRveeXd8v/mxo MkVbRhUcEpUntccfB9JytF67cnWGqiwLaw1FDO1RevUiWflMnYdJuixBNvWgGpadIjzv CE/Q2AX13wdhuff4xXzxaqEmB4kF9b8g39sx6g/jKjqK0M0ZkmAQbNEQ+jtVnsM6yz8/ MvjAJYDqK0Zpltgh9kK0CXAmuFYPRbKkNoGe2iPhjVVggPkrTOSr426qQgpLehAfo52/ TR2dXcwpo6M3+Zl4FhHy1lgm5an/0qRW8JFnBacviVvkaj1ZF3j8PIt9y9Twu05LF+cE Nzug== 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 m9si2029018plt.182.2019.05.15.08.47.15; Wed, 15 May 2019 08:47:36 -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 S1728407AbfEOPoe (ORCPT + 99 others); Wed, 15 May 2019 11:44:34 -0400 Received: from mga01.intel.com ([192.55.52.88]:31257 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbfEOPod (ORCPT ); Wed, 15 May 2019 11:44:33 -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; 15 May 2019 08:44:33 -0700 X-ExtLoop1: 1 Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP; 15 May 2019 08:44:33 -0700 Received: from [10.251.93.126] (abudanko-mobl.ccr.corp.intel.com [10.251.93.126]) by linux.intel.com (Postfix) with ESMTP id BF79158040E; Wed, 15 May 2019 08:44:30 -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: <20190515123802.GA23162@kernel.org> From: Alexey Budankov Organization: Intel Corp. Message-ID: <175a0cd8-226f-dee4-8919-89f844a6dc8b@linux.intel.com> Date: Wed, 15 May 2019 18:44:29 +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: <20190515123802.GA23162@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 15.05.2019 15:59, Arnaldo Carvalho de Melo wrote: > Em Wed, May 15, 2019 at 11:43:30AM +0300, Alexey Budankov escreveu: >> On 15.05.2019 0:46, Arnaldo Carvalho de Melo wrote: >>> Em Tue, May 14, 2019 at 05:20:41PM -0300, Arnaldo Carvalho de Melo escreveu: >>>> 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). > >>> > >>>> [root@quaco ~]# perf record -z2 >>>> ^C[ perf record: Woken up 1 times to write data ] >>>> 0x1746e0 [0x76]: failed to process type: 81 [Invalid argument] >>>> [ perf record: Captured and wrote 1.568 MB perf.data, compressed (original 0.452 MB, ratio is 3.995) ] > >>>> [root@quaco ~]# > >>> So, its the buildid processing at the end, so we can't do build-id >>> processing when using PERF_RECORD_COMPRESSED, otherwise we'd have to >>> uncompress at the end to find the PERF_RECORD_FORK/PERF_RECORD_MMAP, >>> etc. > >>> [root@quaco ~]# perf record -z2 --no-buildid sleep 1 >>> [ perf record: Woken up 1 times to write data ] >>> [ perf record: Captured and wrote 0.020 MB perf.data, compressed (original 0.001 MB, ratio is 2.153) ] >>> [root@quaco ~]# perf report -D | grep PERF_RECORD_COMP >>> 0x4f40 [0x195]: failed to process type: 81 [Invalid argument] >>> Error: >>> failed to process sample >>> 0 0x4f40 [0x195]: PERF_RECORD_COMPRESSED >>> [root@quaco ~]# > >>> I'll play with it tomorrow. > >> Applied the whole patch set on top of the current perf/core >> and the whole thing functions as expected. > > It doesn't, see the reported error above, these three lines, that > shouldn't be there: > > 0x4f40 [0x195]: failed to process type: 81 [Invalid argument] > Error: > failed to process sample > > That is because at this point in the patch series a record was > introduced that is not being handled by the build id processing done, by > default, at the end of the 'perf record' session, and, as explained > above, needs fixing so that when we do 'git bisect' looking for a non > expected "failed to process type: 81" kind of error, this doesn't > appear. > > I added the changes below to this cset and will continue from there: > > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c > index d84a4885e341..f8d21991f94c 100644 > --- a/tools/perf/builtin-record.c > +++ b/tools/perf/builtin-record.c > @@ -2284,6 +2284,12 @@ int cmd_record(int argc, const char **argv) > "cgroup monitoring only available in system-wide mode"); > > } > + > + if (rec->opts.comp_level != 0) { > + pr_debug("Compression enabled, disabling build id collection at the end of the session\n"); > + rec->no_buildid = true; > + } > + > if (rec->opts.record_switch_events && > !perf_can_record_switch_events()) { > ui__error("kernel does not support recording context switch events\n"); > > --------------------------------------------------------------------------- > > [acme@quaco perf]$ perf record -z2 sleep 1 > [ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.001 MB perf.data, compressed (original 0.001 MB, ratio is 2.292) ] > [acme@quaco perf]$ perf record -v -z2 sleep 1 > Compression enabled, disabling build id collection at the end of the session > Using CPUID GenuineIntel-6-8E-A > nr_cblocks: 0 > affinity: SYS > mmap flush: 1 > comp level: 2 > mmap size 528384B > Couldn't start the BPF side band thread: > BPF programs starting from now on won't be annotatable > perf_event__synthesize_bpf_events: can't get next program: Operation not permitted > [ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.001 MB perf.data, compressed (original 0.001 MB, ratio is 2.305) ] > [acme@quaco perf]$ > > Will check if its possible to get rid of the following in this patch, to > keep bisection working for this case as well: > > [acme@quaco perf]$ perf report -D | grep COMPRESS > 0x1b8 [0x169]: failed to process type: 81 [Invalid argument] > Error: > failed to process sample > 0 0x1b8 [0x169]: PERF_RECORD_COMPRESSED > [acme@quaco perf]$ Makes sense. Thanks. ~Alexey > > - Arnaldo >