Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2101047ybf; Mon, 2 Mar 2020 01:56:03 -0800 (PST) X-Google-Smtp-Source: APXvYqxthJkfFP4aXWhEy4IgIs/zymOuVgt80P9uMMVgaF+p1Pvarv/aRDRu0O0jMZ/40TSpevly X-Received: by 2002:a9d:615d:: with SMTP id c29mr12484298otk.100.1583142963693; Mon, 02 Mar 2020 01:56:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583142963; cv=none; d=google.com; s=arc-20160816; b=AQmJ7HurSvPT/HjWQJsI8Y2MTmcF4WmGCErz8iieEUCTSxlc03CMnEM9iw+YX4/L/r gJzqdpMxZ5AV0RgU2aIZcRZUWa2BsH8sBiaoFiCzBFABOnJURubmjyPjuLv8p9V0HPWO kyGWLnvlvdCb+v/W9CNidYsci/h47W/Up28uBQNPSjIrntiAVD/w0KDw0tMMNddv4ZwM e/XJB+F9LbPD7M3wkZlJva9f72Tq+b8r7ubBqcm6nrXvEtsxQ7TFfBNDwHywylg68ql6 YqWGmHqb1yTHrWQ4BmuhGV+jyDhAozL1uWICIONCxvhksqhfxcgGG3HzqYfxsAqC0jxb kLKA== 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=L3pFQ9NLTXNxgalOAVVXDxBAPiPNjQ1YAk86r0HAYHg=; b=yurOQvWEWK3zykQVB1/hmGaSMCW4aFZwoVz3I9Fk7L221F3EzKeFGzDeIUQmZN2pXv LAyi4VjmAYVQobF9+otF9GZoaiLFo1aCZUe3jOaZSYPZDeVrW+5Yfbb6i28WBMpgr6XL XKvo1J2lzrMt+g1E+xUOPWnc25Vq00XvJYP5RGxOuIy6urLeRztuFLX4imEmwLgeVbMC M90b16So+8pymC1CpISH3/rMKR2aOWbOSDW4SJc7Vxn6H1u/PdnFtgLruHByHMqFfpW9 Z3ncwl+fcn67KR5KSYXBxr8j2zJC6bfWizNoxVk1+mTpPZ8v0QYorqSD4TU6grU/KbwB VWZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZUf3riTb; 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 v25si6161903oth.274.2020.03.02.01.55.48; Mon, 02 Mar 2020 01:56:03 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZUf3riTb; 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 S1727430AbgCBJzm (ORCPT + 99 others); Mon, 2 Mar 2020 04:55:42 -0500 Received: from merlin.infradead.org ([205.233.59.134]:54990 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726956AbgCBJzl (ORCPT ); Mon, 2 Mar 2020 04:55:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=L3pFQ9NLTXNxgalOAVVXDxBAPiPNjQ1YAk86r0HAYHg=; b=ZUf3riTbabd9Lifttnyb2Ado8j 5jUbZCdBR+/ICa6BGmWdfGfrLsiyFLzHa4aBs+APAk8ONw0vofiUBw05W3v6aeQ07Tz0n58nX4Y8n 3Mi75pAdtRLMlYmDbnSKcnyroP2XkIz1uHgoxEKbjFjf0BZy9Ni5gV9epsacPOW050FnMeIDlglht W/IKVoyHwMKSIR3FLL1v19WMNqu6+f2XaRx4apI0wdItmdLvBZ7/yq69MMzN1zulnlI69cgoXxKVE RFpuyK6/WquHujE+6aw78k6EQMS6kF9wUH5k/8wj6cv8EBftvl/Y4k+5FdmELmI/EcgdS9mq1q0PP xNoLvMlg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1j8hnC-0006ER-IT; Mon, 02 Mar 2020 09:55:18 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7B9093012C3; Mon, 2 Mar 2020 10:53:18 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E82B0202A4098; Mon, 2 Mar 2020 10:55:15 +0100 (CET) Date: Mon, 2 Mar 2020 10:55:15 +0100 From: Peter Zijlstra To: Ravi Bangoria Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, eranian@google.com, mpe@ellerman.id.au, paulus@samba.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, adrian.hunter@intel.com, ak@linux.intel.com, kan.liang@linux.intel.com, alexey.budankov@linux.intel.com, yao.jin@linux.intel.com, robert.richter@amd.com, kim.phillips@amd.com, maddy@linux.ibm.com, Madhavan Srinivasan Subject: Re: [RFC 02/11] perf/core: Data structure to present hazard data Message-ID: <20200302095515.GR18400@hirez.programming.kicks-ass.net> References: <20200302052355.36365-1-ravi.bangoria@linux.ibm.com> <20200302052355.36365-3-ravi.bangoria@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200302052355.36365-3-ravi.bangoria@linux.ibm.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 On Mon, Mar 02, 2020 at 10:53:46AM +0530, Ravi Bangoria wrote: > From: Madhavan Srinivasan > > Introduce new perf sample_type PERF_SAMPLE_PIPELINE_HAZ to request kernel > to provide cpu pipeline hazard data. Also, introduce arch independent > structure 'perf_pipeline_haz_data' to pass hazard data to userspace. This > is generic structure and arch specific data needs to be converted to this > format. > > Signed-off-by: Madhavan Srinivasan > Signed-off-by: Ravi Bangoria > --- > include/linux/perf_event.h | 7 ++++++ > include/uapi/linux/perf_event.h | 32 ++++++++++++++++++++++++++- > kernel/events/core.c | 6 +++++ > tools/include/uapi/linux/perf_event.h | 32 ++++++++++++++++++++++++++- > 4 files changed, 75 insertions(+), 2 deletions(-) > > diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h > index 547773f5894e..d5b606e3c57d 100644 > --- a/include/linux/perf_event.h > +++ b/include/linux/perf_event.h > @@ -1001,6 +1001,7 @@ struct perf_sample_data { > u64 stack_user_size; > > u64 phys_addr; > + struct perf_pipeline_haz_data pipeline_haz; > } ____cacheline_aligned; > > /* default value for data source */ > @@ -1021,6 +1022,12 @@ static inline void perf_sample_data_init(struct perf_sample_data *data, > data->weight = 0; > data->data_src.val = PERF_MEM_NA; > data->txn = 0; > + data->pipeline_haz.itype = PERF_HAZ__ITYPE_NA; > + data->pipeline_haz.icache = PERF_HAZ__ICACHE_NA; > + data->pipeline_haz.hazard_stage = PERF_HAZ__PIPE_STAGE_NA; > + data->pipeline_haz.hazard_reason = PERF_HAZ__HREASON_NA; > + data->pipeline_haz.stall_stage = PERF_HAZ__PIPE_STAGE_NA; > + data->pipeline_haz.stall_reason = PERF_HAZ__SREASON_NA; > } NAK, Don't touch anything outside of the first cacheline here.