Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3788591ima; Tue, 23 Oct 2018 11:15:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV60DlbFQEz9Z0LhIS5EbRkor3vSnGp7oCa8Ka7ECVPs8QGYFdWJOEwgzizCi2JGCU5ImmFRV X-Received: by 2002:a63:c40c:: with SMTP id h12-v6mr35817512pgd.298.1540318552322; Tue, 23 Oct 2018 11:15:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540318552; cv=none; d=google.com; s=arc-20160816; b=usKUdaSLy7P49ZrBOeeL2DnZxq6YFj8ixzoS3T98u1rRGRNXRigt/PNuqJ9/gHg4pZ SIlJF6WUbY77Tgmj+7vZqGsj4uIZDG8fmyNjOIN+ec/mgfzQ5eV3wVWNaWQzCw4Bo8t6 uegdTYCTx92+QX/nzJ33AwZijUvsUSDwGQ3Unn5D1ezFX87HIgbHY0emR7YSged5Io1A nDz0tMYXUrXnarYOE9q9KPlFg/cD96l5KNWMmNPZl+osgsf4vUGmeF3dhhwOuxvdo+DD XNJeCUmPuXGyTXQO1QBBqS+BTtLpvgrz76N6E0Rkf7KIBqnEmwl8+p/GGdw05yoO8P5o qYKA== 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:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=SPxwen6iNSlohYad8LkSr6P9KTQ60aIDEPPANosjlXY=; b=Xkub/rBJIVOVSvRUiu+CMYkXM71Q5pMPGDtIr2yYW60lLpizsTE9qC3ulpbnPs4scE uW7jktWTQ0xztXfaXGnZo2WOXqRMJSO26XB5dSb6z9zIj+RxzuAVHlaVTRcgvNp+MsB4 XSfeiZHIUacd0ymRq6yTqzjKmifAOkUrc0gwu9sOIqlY6LwSvBdxGz8tjWiKRQJbjpNx B4UIaN94/axDokwLA+in6df7uWDAzu1hYDAE5aPmcZgHd1s4M5nTFUWjLyVcPZdr5sme E4/GOkZ6vHavZUGS1y+lwp0d/zmz7Po6IO4fiRZkldZMAji/pbummmiVmav0vqE3dEkZ aYsw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z30-v6si1832723pga.582.2018.10.23.11.15.36; Tue, 23 Oct 2018 11:15:52 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728459AbeJXCjd (ORCPT + 99 others); Tue, 23 Oct 2018 22:39:33 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:51108 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728052AbeJXCjd (ORCPT ); Tue, 23 Oct 2018 22:39:33 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::cf9]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 5AA3314723588; Tue, 23 Oct 2018 11:15:04 -0700 (PDT) Date: Tue, 23 Oct 2018 11:15:03 -0700 (PDT) Message-Id: <20181023.111503.1978409398989251135.davem@davemloft.net> To: acme@kernel.org Cc: jolsa@redhat.com, dzickus@redhat.com, linux-kernel@vger.kernel.org Subject: Re: perf overlapping maps... From: David Miller In-Reply-To: <20181023180503.GA6114@kernel.org> References: <20181023063452.GB20075@krava> <20181023.105405.364015687995752826.davem@davemloft.net> <20181023180503.GA6114@kernel.org> X-Mailer: Mew version 6.7 on Emacs 26 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 23 Oct 2018 11:15:04 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo Date: Tue, 23 Oct 2018 15:05:03 -0300 > IIRC this was first done for 'perf record', where we have to stash those > events in the perf.data file, to then, later, 'perf report' to process > those, so when working on 'perf top', it just reuses that machinery. > > Sure, with some love and care 'perf top' could do better and update all > the data structures directly :-) Thanks for the history, it is useful information :) > Anyway, have you guys considered tweaking using event->header.misc |= > PERF_RECORD_MISC_USER? The kernel leaves that as zero for the > PERF_RECORD_FORK it emits: I really would like to steer the approach away from using UAPI perf_event fields in an internal way. I am really very sorry for suggesting such a scheme myself in the first place. It really was a bad idea upon much consideration. The synthetic fork is not really a fork, it's more like a "create". And this fundamental semantic difference is why we have all of these issues wrt. handling COMM and parent map inheritance. There is also a bunch of non-trivial code to deal with whether we synthetically create the child or the parent first, wrt. finding thread leaders and parent threads. What I'm trying to say is that there is a clean design based solution hiding somewhere in here and I'd like to find it :-)