Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3033544imj; Mon, 11 Feb 2019 12:39:25 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaa8Fx1EcBpqxg/IncbUXKE4itUFtp/uIs8l3i/NfsqkFsZA4YjPA46p6Ss0JSDO+pAx2rI X-Received: by 2002:a62:26c7:: with SMTP id m190mr95367pfm.79.1549917565190; Mon, 11 Feb 2019 12:39:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549917565; cv=none; d=google.com; s=arc-20160816; b=Z/L7cWkQ0W5xRVLotBI7MbeQdiQnE0Itn3tW641Hv65mXy9MWOk5pFwBKec2vYPgOZ IZSX9lneL+kLtQuncoSxHN+gInpLJD4+BmWtHB8e14flu42eUEaKWQxTEyxLVZAwrk6E OHx+9Axg01ftxmY7mYe9cWd+3W78uKO2w/2RAAqJVciUBvps4PT+hOjZkchiVIoTVZaP mDrneqr1H0zrwRs21wJVYJh/z571lKmYthaNhg1k5BD3ZKHk3IwjZHjewAM/9iOAbrrc c/4oSa4A6txAMZaiL9BY6fK2ec+xhLw779HxtpYDF7kAikwaddbiycOtDq1YYwkKdDAX A7DQ== 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:dkim-signature; bh=DhKjhXTg7EoluGwV0Yz7dSd81BAWpoIOvlQsZIOWy+c=; b=r2ZA6FSd7fhbTLZ9YcgOBdpQVdyU4YFQCAussSv6SV2rKdgs34RqYZIQ2mIdcz8UfQ VCsYNXODKGjDFBgszQ0XEFdAe5+jEkv5AXO2gXMEZolAAVZLFgcI1zGI+gklmR6ZIUAW rA1LiJuEAuPxPPeXjcOtGcGodSDUMs+eEBwou/3ScLY1bp5w6VYbGWKYMXJcEtK7KQ5S 2BbZphbfX8EKEx4O8F7Ct0I0WIFAdXqWT6BYl5oOIV5cDow0i/GX79AtEELURoFKj2TR Bw1RmBgb26CZG/E6mN9qyH1rH4zEMnHkRTqH6j7i8cARuGIAnqzq8LuWhn65++vz4XMo CQyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oUbdjMKc; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si10384198pgh.392.2019.02.11.12.39.09; Mon, 11 Feb 2019 12:39:25 -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; dkim=pass header.i=@kernel.org header.s=default header.b=oUbdjMKc; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733125AbfBKSzQ (ORCPT + 99 others); Mon, 11 Feb 2019 13:55:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:58276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728090AbfBKSzQ (ORCPT ); Mon, 11 Feb 2019 13:55:16 -0500 Received: from quaco.ghostprotocols.net (unknown [190.15.121.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C0C7721B25; Mon, 11 Feb 2019 18:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549911315; bh=pJjdYoqa+V/V8dS/k51x5ZNl78XMZPxxwZ5+NOFbvQw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oUbdjMKcvNGBy7h++SpNGbiED3QhgTkqh7/ZidaLZiB1CLPOuld9g6G1N6FMnI4Ej bgwUihWaMnXEBC0n47LQ/VeRPnJo56BfUPMU4iGNfsipV+S7BPicS2aJuuwUpRp26l 76j1HiOo2TOhvKyKZNruOkBW2dFLQmGj7uuKUJ94= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 741D6410D5; Mon, 11 Feb 2019 15:55:10 -0300 (-03) Date: Mon, 11 Feb 2019 15:55:10 -0300 From: Arnaldo Carvalho de Melo To: Stephane Eranian Cc: Jiri Olsa , Alexey Budankov , Jiri Olsa , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Adrian Hunter , Andi Kleen , Song Liu Subject: Re: [RFC/PATCH 00/14] perf record: Add support to store data in directory Message-ID: <20190211185510.GF3269@kernel.org> References: <6bf24b7d-2bd3-8091-cf49-363c91e4e864@linux.intel.com> <20190204114144.GC18141@krava> <20190204192721.GI5593@kernel.org> <20190204202818.GC4794@krava> <20190205133727.GF4794@krava> <20190211101957.GB14253@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Mon, Feb 11, 2019 at 10:34:16AM -0800, Stephane Eranian escreveu: > Jiri, > > On Mon, Feb 11, 2019 at 2:20 AM Jiri Olsa wrote: > > > > On Tue, Feb 05, 2019 at 02:37:27PM +0100, Jiri Olsa wrote: > > > 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 > > > > so following features are not synthesized: > > > > FEAT_OPN(TRACING_DATA, tracing_data, false), > > FEAT_OPN(BUILD_ID, build_id, false), > > FEAT_OPN(BRANCH_STACK, branch_stack, false), > > FEAT_OPN(AUXTRACE, auxtrace, false), > > FEAT_OPN(STAT, stat, false), > > FEAT_OPN(CACHE, cache, true), > > > What do you need for BRANCH_STACK? > > > I think all could be added and worked around with exception > > of BUILD_ID, which we store at the end (after processing > > all data) and we need it early in the report phase > > > Buildids are injected after the fact via perf inject when in pipe mode. > > > maybe it's time to re-think that buildid -> mmap event > > association again, because it's pain in current implementation > > as well > > > Sure, but what do you propose? this keeps resurfacing, the idea is to have the building go together with the PERF_RECORD_MMAP3 event, i.e. as part of setting up an executable mapping the loader would get the buildid and ask the kernel to keep it aroung, then when a PERF_RECORD_MMAP needs to be issued, it can include the build id, so tooling will not need to get it. Alternatively, we would have a separate thread to process PERF_RECORD_MMAP events, and as soon as it gets one from the kernel, augment it straight away with the build-id it reads from the ELF file, i.e. no need to have the kernel provide it, do it just like we do with PERF_RECORD_BPF_EVENT, which reminds me Song probably already posted thise bits... > > looks like bpf code is actualy getting build ids and storing > > it for the callchains in kernel.. we can check if we can do > > something similar for mmap events > > > > jirka -- - Arnaldo