Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5053606ima; Tue, 5 Feb 2019 05:45:24 -0800 (PST) X-Google-Smtp-Source: AHgI3IbnVWeIUBCrXoB3La49Ye+TzGrnFq84pemCsELzFg6p7e+MvF/Iqj8O+FN+mWgcR4J3WMDn X-Received: by 2002:a63:160d:: with SMTP id w13mr4743790pgl.43.1549374324711; Tue, 05 Feb 2019 05:45:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549374324; cv=none; d=google.com; s=arc-20160816; b=YREsseOe4PYxR5pQKkb9QP0s1AGHmewkU3GDpIBj+vUgRWoCzukDrV69ectgck7mrp ww3T7UptvriKI5rDxWPZz1yE66OOxs2ZWS++rODdsl11sf6lGXpw25PiplfXvNR6vul7 AN+58huI+LS0HKUxTrJSUml4aBLmHET5V72bvKhxntq/yTsk//WtZw4wi9N4F5yILd2u 0yxEQ3LLW7THILmY0jzCbcnuqiqmMzOF0HrBCmCYPKzkgk8+XhH9VuS2E6sLeooSOa0+ JMG8ofnC+srlBorKr3Haajs1q72vcFf2JlOhMWawQbb3h7C6OC8h3KtNzK9KRBcyZ5io DuIw== 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:from:date; bh=G91iM9fbWkAQTHDxHwmnUYfDWjVrWDppVPrUSFh16Kc=; b=mP4r37e8DE0wGnfGTYH1K4OiqqQk3KWUhbRU8/gtUrOvgFOok8QRQAuB9DSr9Y65Td PrwSjRKPePXL4jUHRNgC7cGKoCCTpmkYB8JysNnux5PahHU5BSvwpwR8ePcOQp0Q1veG qtO6u21rPvzApalRCCxUd22Oi2d7hSWWKkVOjoMenWj1FbTpiGDtX8VRUV1TOQ2MqtJy AJjoGuqlAdANBkhowM9yIxWUBS4k/mZ1Ne3IJW19oKjXUTkkb2JEHZk0SIBVQZc0Vmhj 8jnS/4t9EJv5UVqoe7ryHteLTtEVWyRORt7LZPSsoqNXru1iQ47s4WJaOkXrYh68VMNT BaRA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si3268950pfi.286.2019.02.05.05.45.09; Tue, 05 Feb 2019 05:45:24 -0800 (PST) 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728634AbfBENhc (ORCPT + 99 others); Tue, 5 Feb 2019 08:37:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52624 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726731AbfBENhc (ORCPT ); Tue, 5 Feb 2019 08:37:32 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E3008653C6; Tue, 5 Feb 2019 13:37:30 +0000 (UTC) Received: from krava (unknown [10.43.17.224]) by smtp.corp.redhat.com (Postfix) with SMTP id 6071683BB0; Tue, 5 Feb 2019 13:37:28 +0000 (UTC) Date: Tue, 5 Feb 2019 14:37:27 +0100 From: Jiri Olsa To: Stephane Eranian Cc: Arnaldo Carvalho de Melo , Alexey Budankov , Jiri Olsa , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Adrian Hunter , Andi Kleen Subject: Re: [RFC/PATCH 00/14] perf record: Add support to store data in directory Message-ID: <20190205133727.GF4794@krava> References: <20190203153018.9650-1-jolsa@kernel.org> <8d8b3f0d-cea8-2daf-249f-29f485c49a46@linux.intel.com> <20190204103643.GA18141@krava> <6bf24b7d-2bd3-8091-cf49-363c91e4e864@linux.intel.com> <20190204114144.GC18141@krava> <20190204192721.GI5593@kernel.org> <20190204202818.GC4794@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 05 Feb 2019 13:37:31 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 04, 2019 at 02:44:37PM -0800, Stephane Eranian wrote: > Jiri, > > While you're looking at the output format, I think it would be good > time to simplify the code handling perf.data file. > Today, perf record can emit in two formats: file mode or pipe mode. > This adds complexity in the code and > is error prone as the file mode path is tested more than the pipe mode > path. We have run into multiple issues with > the pipe mode in recent years. There is no real reason why we need to > maintain two formats. If I recall, the pipe format > was introduced because on pipes you cannot lseek to update the headers > and therefore some of the information present as tables > updated on the fly needed to be generated as pseudo records by the > tool. I believe that the pipe format covers all the needs and could > supersede the file mode format. That would simplify code in perf > record and eliminate the risk of errors when new headers > are introduced. yep, I think we have almost all the features covered for pipe mode, and we have all necessary events to describe events features so with some effort we could switch off the superfluos file header and use only events to describe events ;-) make sense, I'll check on it > > Related to your effort to make perf record multi-threaded, I was > wondering how this would impact pipe mode. > Could you explain? there's no support for threaded pipe processing at the moment, currently the data are stored in directory: $ ls -l perf.data total 344 -rw-------. 1 jolsa jolsa 43864 Jan 20 22:26 data.0 -rw-------. 1 jolsa jolsa 30464 Jan 20 22:26 data.1 -rw-------. 1 jolsa jolsa 53816 Jan 20 22:26 data.2 -rw-------. 1 jolsa jolsa 30368 Jan 20 22:26 data.3 -rw-------. 1 jolsa jolsa 40088 Jan 20 22:26 data.4 -rw-------. 1 jolsa jolsa 42592 Jan 20 22:26 data.5 -rw-------. 1 jolsa jolsa 56136 Jan 20 22:26 data.6 -rw-------. 1 jolsa jolsa 25992 Jan 20 22:26 data.7 ^^^^ those are raw data files, contains only events with common header as stored by perf or kernel -rw-------. 1 jolsa jolsa 8832 Jan 20 22:26 header ^^^^ this one currently holds perf.data file header, describing events and features if we switched to pipe mode by default we could omit the header file and find a way to push the data streams through single file, like with a new event describing the data stream.. we can have an option for that so you could do something like: # perf record --threads --single-file -a ... | perf report -i - however having single thread storing storing into single file without any other processing is important on record side (for minimal overhead), so I think we should keep creating the directory with data files also for pipe mode to have minimal overhead jirka