Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3227764ybl; Sun, 2 Feb 2020 18:15:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzxZFrCgIkmTAIIYT9+Rw2WdctPg8WKLTg+k4q5kSLoGbyXo9rDWuRggYBJ9O/mVHOkmpNn X-Received: by 2002:a9d:6443:: with SMTP id m3mr15603934otl.20.1580696100198; Sun, 02 Feb 2020 18:15:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580696100; cv=none; d=google.com; s=arc-20160816; b=Old6qzUXqZQEUe8elX/Da/RG8BHEC/xwMbn/J8k0U2CRZx1PkW5GKA9y7bintZhfuP mq2OrQ/OcQKuN2Q4/WT7Q1dW3VNVyyXN1+vyyGl0Z97c+alGz36eaAT16NYQCZpenYu8 vDxnbnCj6FJsYcIOO2KZ98RSIQuBzviaY3MQelHJI7fFUbnUA1LJ7YzXlzeP6bTXNayP TQ2CMBkV2Vx1/0OnLNOddWhPinITPRdISL1MdCB1m6iKHG35EKxJ9HNmQWPDO0SXIMbj vJEX/BEPLTj+9aAtWNb/BvruAtnW8uoa/vwBrMLpY/+OzEtIlW/EBc+I5HRn8wPhhXns S/Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=ZiZzXgFFYfVLqsOFrcF9kT69hQ1R19EZVXuDA6GrIHs=; b=uwWDuQl0NW4IC78wkRQwBdhdim9MpYwzoDUVxJ5XZXUmFp465WvLYPV33cxWWCGm8P YrSd7FSiaZGdmSRtAWjsl3Uoh/a6rbcwrNQh9zSfpE+jdyzZ9XNgtF0rSzJZKN4A9Fdp A/U4IAiXIEQIq3IYmOYa6F/ITJhRdT33MBzTE89OLmJ+2KybnG4k8Y9tqLFAVxT+7/TU slUdwJf4pu1nGugJjlropwFW0fuX1t7FmBd9XHypStzMyz2qLf5YHTLU3XudAFPdtRHC JhXn9OMTyHZnKelHnLzlO89XBl85czJOJL3cqvNj5nHcUW8MsnOF8sj7Jgq7ibjpQehp Si5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nvtjv9wf; 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 p1si8971578otk.42.2020.02.02.18.14.47; Sun, 02 Feb 2020 18:15:00 -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=Nvtjv9wf; 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 S1727154AbgBCBw2 (ORCPT + 99 others); Sun, 2 Feb 2020 20:52:28 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:41352 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbgBCBw2 (ORCPT ); Sun, 2 Feb 2020 20:52:28 -0500 Received: by mail-pg1-f196.google.com with SMTP id l3so2829656pgi.8 for ; Sun, 02 Feb 2020 17:52:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=ZiZzXgFFYfVLqsOFrcF9kT69hQ1R19EZVXuDA6GrIHs=; b=Nvtjv9wfYlFsYgkgZwOXN/3fh58yXTRzeeGI/vrHA2OtF3MgRKOus3uWZDfSIHD4/j saz44zAXa5kXX+9rto2vkpklXNpMSQ5s0kYQ7xmyWfStSPPXn2gUNpG4Rlp+uYJdPdsr L4flCZI4VVV8Lx2i8QHaxYPPC/SaQeatGTSlySyH1y7RRlNY642e36rzLoyPpStPZQDO cdccR2nY7E9MWuyba7YN4VctTQsZGVf9WuHTcM/g+fP1LpqBZmtojfepX0FyoiVKTCSE yizo6R7A8N6VRuNNRpsg2Q0yrVgy5IKY4TYutrUh7ukld2ISABEJobbKZO9VLuks1T3h ZCZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZiZzXgFFYfVLqsOFrcF9kT69hQ1R19EZVXuDA6GrIHs=; b=AQwMUvVArrIttjoSIyAcGAUnKuznx9r9m4OYvYf2KN386INiRynC2vi24iXBnlSqrU lqGZH82U30sx1rWLlLKakOBaiddCFVhuBqZL80caLkWBB0F9tnb/z004dpUGHF3QG+uY c1DRANVGQQKTEgta+FRDAIScQn/RAhKfMhlADexR+J+Szas8CCrLk5k99Xoy4/hWn4FE ZQROEqFNganIzpsTYye9CGw3+2MG1YdXc9BuHkzY1YB38+UlnRDPbvTW5kYyPr4tIPNZ 7HshrJ4pALnyyhwwKwdZJqwbIv3lMQoSHyie5qA2Y2ngHpXXtlt+Parc1o/8rRmaO7Kj UnLw== X-Gm-Message-State: APjAAAUvCYQdq7wQG5gLRR0LPrnMF9nnHg7T3hQNvNIu6WXtMcJEfgjV DHO3eCXpIje5667QokyBaJNv7cMKR2l77w== X-Received: by 2002:aa7:848c:: with SMTP id u12mr21352468pfn.12.1580694747534; Sun, 02 Feb 2020 17:52:27 -0800 (PST) Received: from localhost.localdomain (li1441-214.members.linode.com. [45.118.134.214]) by smtp.gmail.com with ESMTPSA id y38sm17348308pgk.33.2020.02.02.17.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Feb 2020 17:52:26 -0800 (PST) From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Suzuki K Poulose , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mike Leach , Robert Walker , Coresight ML Cc: Leo Yan Subject: [PATCH v3 0/5] perf cs-etm: Fix synthesizing instruction samples Date: Mon, 3 Feb 2020 09:51:58 +0800 Message-Id: <20200203015203.27882-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Let's restart this work [1], this patch set is the dependency for support callchain for Arm CoreSight, which will be sent out in another patch set. This patch series is to address issues for synthesizing instruction samples, especially when the instruction sample period is small enough, the current logic cannot synthesize multiple instruction samples within one instruction range packet. Patch 0001 is to swap packets for instruction samples, so this allow option '--itrace=iNNN' can work well. Patch 0002 avoids to reset the last branches for every instruction sample; if reset the last branches for every time generating sample, the later samples in the same range packet cannot use the last branches anymore. Patch 0003 is the fixing for handling different instruction periods, especially for small sample period. Patch 0004 is an optimization for copying last branches; it only copies last branches once if the instruction samples share the same last branches. Patch 0005 is a minor fix for unsigned variable comparison to zero. This patch set has been rebased on the latest perf/core branch; and verified on Juno board with below commands: # perf script --itrace=i2 # perf script --itrace=i2il16 # perf inject --itrace=i2il16 -i perf.data -o perf.data.new # perf inject --itrace=i100il16 -i perf.data -o perf.data.new Changes from v2: * Added patch 0001 which is to fix swapping packets for instruction samples; * Refined minor commit logs and comments; * Rebased on the latest perf/core branch. Changes from v1: * Rebased patch set on perf/core branch with latest commit 9fec3cd5fa4a ("perf map: Check if the map still has some refcounts on exit"). [1] https://patchwork.kernel.org/cover/11222259/ Leo Yan (5): perf cs-etm: Swap packets for instruction samples perf cs-etm: Continuously record last branch perf cs-etm: Correct synthesizing instruction samples perf cs-etm: Optimize copying last branches perf cs-etm: Fix unsigned variable comparison to zero tools/perf/util/cs-etm.c | 142 ++++++++++++++++++++++++++++++++------- 1 file changed, 118 insertions(+), 24 deletions(-) -- 2.17.1