Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp320302ybh; Mon, 9 Mar 2020 22:44:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtIRN/OBkplMVVjWdEJWnle/y5AvcCYCqZE+nVQ4Uzis3ZulDZrCPcw6w6KqQXSyeo0ZSdL X-Received: by 2002:aca:1903:: with SMTP id l3mr4526oii.178.1583819064700; Mon, 09 Mar 2020 22:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583819064; cv=none; d=google.com; s=arc-20160816; b=lz8hnzGIU+wRQNqO8MoYAk3lSj43sL3mOcBhIaT5QYLS9E05dOxMOljjIQkWyGAmx+ 4DoU+b+dMrLZlk5X4Te9pxHIhpIPodJFVV7LBAtiYrRqkC+CKREW0BSU74Zc9tb5Hjnc phX7dOc1+4QiaOYJtUd8XPCc7e4WF8RmD808zQBtdDxmkn1BGFJo7KpmVCMIC9K/fIJK 5eNIBA6mlggTUyajqho12ECRJMqm6++i1SGGecCtMgejj9OpyNjIUVjTqgAzZNbbHGf8 HZOSxFTmNLkdhmUNtJB/sWQ22RbueL/7NzPjwzBgILaNhHyHYG0hxijGeQJmIAI6WVQx Ghaw== 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:to :from:date:dkim-signature; bh=F25Z6JOMg3VYYeS0Ph17/tK9FAZWHrNbdM4PzCWFQu8=; b=hvfR6SpBqsI1QntcCkTrKGlCZVk1yYC81ddsCP6Vl4mpDwipB0pF+CllflnheUkAjV Fbfnxy0UVFp1ibAI4Gc1pukH9IEWVXAe9mgqrG9LJ58nqHCQaa2UAI9MIUgw0gxYNruH DzzPMzMlYt7nivlGLpByUUZ1OfXBFBC0z7NBkqyDkfTwHizoB40CWvvmiX1Zvvt73YPA F5muBhw9r8Fr3RacfznFIxUPDSb0kbD0U/QL17SHw44i8Tv4St5GLV+420IE4gvUje1u eX7o40BUXb89H9l1KaxFp81lVHy/Lb6RTViTN7ac0AmqFCVFvd0erHRS+1kZ/ad1/9uZ KxEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gChH3PS1; 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 s199si532649oih.169.2020.03.09.22.44.11; Mon, 09 Mar 2020 22:44:24 -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; dkim=pass header.i=@linaro.org header.s=google header.b=gChH3PS1; 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 S1726415AbgCJFnU (ORCPT + 99 others); Tue, 10 Mar 2020 01:43:20 -0400 Received: from mail-pj1-f67.google.com ([209.85.216.67]:53638 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726156AbgCJFnU (ORCPT ); Tue, 10 Mar 2020 01:43:20 -0400 Received: by mail-pj1-f67.google.com with SMTP id l36so926642pjb.3 for ; Mon, 09 Mar 2020 22:43:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=F25Z6JOMg3VYYeS0Ph17/tK9FAZWHrNbdM4PzCWFQu8=; b=gChH3PS1Ahx4kjgjmib1NgIky08oV7TsTD369DupZ3qTEaWaIL8bL1V8Yqy85SlZSx XofjzRdyK/ZgT7pbeM6FhDwzyoJF6CscxXa6XE5ga8eAHHj4GJfQx6cwKFUsw0rkwLKY tU6+oauZM8ktgjO8lnrklWew6Uvm/VcrQZ8FPyGVSEOvFPaH4H0n2drzFthrm5ft+3RZ VxWP43OKxBolA4Utm1IMjeC5oaWOrU5xrQ9t1l08MrygvCGrIkmX3wmgP1cLRHmHmYz0 jJ8jR3Evj+msL9T0efnedWvBGv7WjgLOaHKfMJOcg/Gv0OHKdLamLVq3/Cl6WkS11r05 J1ig== 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:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=F25Z6JOMg3VYYeS0Ph17/tK9FAZWHrNbdM4PzCWFQu8=; b=Bsz1bFHt2qU9ulRog+dyudmVLcbhVTZbyPCSSyUjEBFqTBLfh6T3uSt7DwUHWU9GK1 8a1eLie9DEkCQYec8aeYj/mQ+NpiYThxlxNSddhLl8afNVkOmqEqgCsbyguigCnggIeo NBje/9rL6/HKJilcTJszWquaBsp67dSWp27biCppfpLNURf2q7LgBt5WRRYqYEAFx4wi qDAPTY+QG3q2jymZRIvZmWkJj4C5nntLH+EjUmTshstqA5Pf0MmoHaWZjCmO5qYKHn9K ikh/dJlC/TDORHk0+UAOK8ZET1pOMA33YVfucQe3vd57iRUOXmFv1PSVkTfI5BsI1PR1 wjLQ== X-Gm-Message-State: ANhLgQ2TySgDVkJS++gC9asCQz1iOfskuHDC+zXsfbpc9IoCtmMYblm0 yvgkf8NrD4LNhMsICERLLbfxxFMEaKjAMkLs X-Received: by 2002:a17:90b:19c3:: with SMTP id nm3mr1367661pjb.149.1583818998924; Mon, 09 Mar 2020 22:43:18 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([2400:8902::f03c:91ff:fe3f:32da]) by smtp.gmail.com with ESMTPSA id t142sm37183481pgb.31.2020.03.09.22.43.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Mar 2020 22:43:18 -0700 (PDT) Date: Tue, 10 Mar 2020 13:43:05 +0800 From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Robert Walker , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Coresight ML Subject: Re: [PATCH v5 0/5] perf cs-etm: Fix synthesizing instruction samples Message-ID: <20200310054305.GA21545@leoy-ThinkPad-X240s> References: <20200219021811.20067-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200219021811.20067-1-leo.yan@linaro.org> 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 Hi Arnaldo, On Wed, Feb 19, 2020 at 10:18:06AM +0800, Leo Yan wrote: > 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 Could you pick up this patch set? I confirmed this patch set can cleanly apply on top of the latest mainline kernel (5.6-rc5). Or if you want me to resend this patch set, please feel free let me know. Thanks! Leo > Changes from v4: > * Added Mike's review tag for patch 03; > * Added Mathieu's review tags for all patches. > > Changes from v3: > * Refactored patch 0001 with new function cs_etm__packet_swap() (Mike); > * Refined instruction sample generation flow with single while loop, > which completely uses Mike's suggestions (Mike); > * Added Mike's review tags for patch 01/02/04/05. > > 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"). > > > 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 | 157 +++++++++++++++++++++++++++------------ > 1 file changed, 111 insertions(+), 46 deletions(-) > > -- > 2.17.1 >