Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4044135ybl; Mon, 13 Jan 2020 06:59:26 -0800 (PST) X-Google-Smtp-Source: APXvYqyjYeqUAIDAaCb5TS4KrKdSsh6yQX12bRZzNbya9V4l60tYSxLAFekyFDmS7iTHi2KPppUn X-Received: by 2002:a9d:7852:: with SMTP id c18mr12722539otm.247.1578927566406; Mon, 13 Jan 2020 06:59:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578927566; cv=none; d=google.com; s=arc-20160816; b=iHroeRYxrJFPzDW4LHrF9jVPqdSR5ip0UNoP86n3sVglWHQnu4DrIxAbhpWpR2V29r eNnksbjRwccrLSTqTx0KOmOrFknPuJYq/4nXJi1vhwTIOnm5XsZ9Ff5vJSzlEvoyTLuM TYeEMhjwjRer8S8VJjUIbpbykGkAyz5z9OJ9qeC9jdnRRm084+cAPwXLJeB2qEpnu3fH caqmEkRw0p4vqsNycNqCpHg5FLvczBq7qh6OZsj7y5yTXWR9pl5FCeQh0LX9Ax481Cos khdMvZGUce3PfeGwtFFy8BwBAa/b/cEKjpkbPULh/G3qoDMvIhoTUGTT//2C3x6WFwJE XqRg== 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=ABwgmPKfDy+N+TGKbofrmdsL1lafnTHl6Ci0Ho1XYT8=; b=pbUUcbzInNoNWiv4S3rkx5lkjNDmilAKFowbDsXfaNYJdfzt+Iyrvy9bQD8qOLorer nSrYCLIC22i2tD+7h7GnP/YiPmrt0Qbx/2t0Ql9VW3K9Duw/xjvZwuWGbllt3XHDSh0R fuQMpPZMnKd/33/zt4r+tNLbjcFHHlZ3dIewaDCl0J+cTqTYE2dMMx5kVx1DLaP8qwv5 a/p2Gb5bmeGek668ydqLYcLIF8LMYPsRpOtgHhqTqjfxkkVwgSN0Z2FPNj2/ZK1ahNxm xYvpN/CO75Ushz2nQO1QxxY6ly2kesWwMw+P7t38FM+IZx9ovnbQpV7wsta4q+dKRM9f g49g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bOsdsARn; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g138si6218684oib.190.2020.01.13.06.59.14; Mon, 13 Jan 2020 06:59:26 -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=@linaro.org header.s=google header.b=bOsdsARn; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728900AbgAMO6N (ORCPT + 99 others); Mon, 13 Jan 2020 09:58:13 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34182 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728843AbgAMO6N (ORCPT ); Mon, 13 Jan 2020 09:58:13 -0500 Received: by mail-pg1-f193.google.com with SMTP id r11so4833548pgf.1 for ; Mon, 13 Jan 2020 06:58:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ABwgmPKfDy+N+TGKbofrmdsL1lafnTHl6Ci0Ho1XYT8=; b=bOsdsARnyhmEOKyiyqxc6hjzJPnadrq4BiEyPdBgmJkzhUQxndVn+RuaCK6zspxAjj XA2VmeP7hQZyiIsbEotZCC70+fJp6p7gcsWI8jXeM+UsU3BhkqLV8zP5C9A6dse3f1cG WvSW0D1I8dMSS5vmwNqpoNSGkH6TrLBhQwxpDAT8Xtn0wEKhrP3P1KkD76vCyq482ypm ratxTPWzQsmX+LuvXctaw0zLo4nZA7NfaUOQ+lMmNYcVcvtgnMrnRODI9/5DtL38jTni Q6vwdGCAmjRyyhf3IKKnTFcqZReTUxykBqI2mgoYDmvfKF0q/GHj/xGegJvjOLGl/L7O 7i3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ABwgmPKfDy+N+TGKbofrmdsL1lafnTHl6Ci0Ho1XYT8=; b=l7uEMQu/6BAN1R60Tq+oednM4wMy6Bpybv+XllV8FiFtQ1Guf2iEFa/Qh1WVCC5YU3 BWn8KN8tyAOlRBHnFy7HwHCfx4hvWxOM7yt+fs2XVMCNfzsxhRvDpH4PPJSVj35Pvuyj 3xnPcnc7a3j476+OqKeANYTdeo2hNz4E0c12eNQXDpEK7Kl25Jl/ArHHPvm2xbD11wRS S0kr84Q+pqusfin9k+YYGcMCiEvzYIm5elI2BQKy7pfVMzffYAkqh0fVGaKtzAUMRjxI sqZ69WC+xl6YGp90iKn/fqtzrUTPbZDD6eR1jRCzX2u6DsbLMKu5uMrveAFaTGaLvhPH Waew== X-Gm-Message-State: APjAAAUlYPVgb2+ZEJH7sozJGArW02rzr4Q6JQJKB3aTnqU2M5mGisO/ Ff9fVbL7+T6bFiPV20w4YgQj5A== X-Received: by 2002:a62:e30d:: with SMTP id g13mr20089294pfh.92.1578927492811; Mon, 13 Jan 2020 06:58:12 -0800 (PST) Received: from leoy-ThinkPad-X240s (li519-153.members.linode.com. [66.175.222.153]) by smtp.gmail.com with ESMTPSA id i127sm15559616pfe.54.2020.01.13.06.58.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jan 2020 06:58:12 -0800 (PST) Date: Mon, 13 Jan 2020 22:58:03 +0800 From: Leo Yan To: Suzuki Kuruppassery Poulose Cc: James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, nd@arm.com, Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Igor Lubashev Subject: Re: [PATCH] perf tools: Fix bug when recording SPE and non SPE events Message-ID: <20200113145803.GB10620@leoy-ThinkPad-X240s> References: <20191220110525.30131-1-james.clark@arm.com> <20191223034852.GB3981@leoy-ThinkPad-X240s> <20200113141751.GA10620@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200113141751.GA10620@leoy-ThinkPad-X240s> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 13, 2020 at 10:17:51PM +0800, Leo Yan wrote: [...] > > > On Fri, Dec 20, 2019 at 11:05:25AM +0000, James Clark wrote: > > > > This patch fixes an issue when non Arm SPE events are specified after an > > > > Arm SPE event. In that case, perf will exit with an error code and not > > > > produce a record file. This is because a loop index is used to store the > > > > location of the relevant Arm SPE PMU, but if non SPE PMUs follow, that > > > > index will be overwritten. Fix this issue by saving the PMU into a > > > > variable instead of using the index, and also add an error message. > > > > > > > > Before the fix: > > > > ./perf record -e arm_spe/ts_enable=1/ -e branch-misses ls; echo $? > > > > 237 > > > > > > > > After the fix: > > > > ./perf record -e arm_spe/ts_enable=1/ -e branch-misses ls; echo $? > > > > ... > > > > 0 > > > > > > Just bring up a question related with PMU event registration. Let's > > > see the DT binding in arch/arm64/boot/dts/arm/fvp-base-revc.dts: > > > > > > spe-pmu { > > > compatible = "arm,statistical-profiling-extension-v1"; > > > interrupts = ; > > > }; > > > > > > > > > Now SPE registers PMU event for every CPU; seem to me, though SPE is an > > > > Do you mean "SPE PMU" here ? SPE is different from ETM, where the trace > > data is micro-architecture dependent. And thus you cannot mix the trace > > on different CPUs with different micro-archs. > > Understood that SPE is micro-architecture dependent. Maybe SPE is more general than we think :) Since SPE is defined in ARMv8 architecture reference manual (ARM DDI 0487D.a); should SPE trace data format is unified and defined in Chapter D9 "Statistical Profiling Extension Sample Record Specification"? Thanks, Leo