From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7A71C433E1 for ; Thu, 27 Aug 2020 20:55:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 924BD20737 for ; Thu, 27 Aug 2020 20:55:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SodQhuWo"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LLS0EAFF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 924BD20737 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ruiQpXM8UPFq9MFalzsV0aiY3a71In+cP/Cs+pHHLUA=; b=SodQhuWooLRoQNFvHMp+T6swd /rm2aKP5rSG2KPmP3N3+ubiGKu7ltbJtSNXLlhJqwttXtoImv4TRSkER6Vsj14bS6m7/rV2wkL1U9 fxbkQDkgbchEBV7KmdxPNqiCh//AiPbdnnuFmUIVuY7syI5VjILzcNQ7EqbcFrYlKkYQTV4F6Oh+d yUg3OOUmuSM+k297OuHbJs0Q1ah1O7VKag+bTg25FPArkGCg8gL/0o6p+rmXpeOFJrOEBE/xuMH7M jdU8H/6gGQZRWlAQeB8xhm/5L6UrtR5BpHQN4X0y8mmQ/JQJwkXZTBvHJ4iXzQHt7y0VStubZ2Pmu Y1/M9pd0g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBOuJ-0002Eb-1r; Thu, 27 Aug 2020 20:54:03 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBOuF-0002Dg-Q8 for linux-arm-kernel@lists.infradead.org; Thu, 27 Aug 2020 20:54:01 +0000 Received: by mail-pf1-x443.google.com with SMTP id x143so4436984pfc.4 for ; Thu, 27 Aug 2020 13:53:59 -0700 (PDT) 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; bh=IcrAzu0/UMhNvU/QrMjkiMrk/PLtQgMkds9y37Yu4qg=; b=LLS0EAFFujy5fRuUgd1HMdou2VPRHvhJHVGPx88qbNkBmrp8bDnDuSu1oY20uM3NSJ bcWQ/aR7gtU9XCl4E3YUN9VnoGmQx4Nm6uZhRMJG+Q1QAglTe0Pq7+MyYf/Sc2Dou9+e KoTNfGLzgMtMu6Ccy560d9o+Duj8HUmhC+LgZd4h/HAREzMeHvjNEKVIkph0WVBmuQOj wHoIAsO97H22BlpOGpNNyHE+EGH6TqOV/CBByLEmJQBPj97d7IE2gxWV5cgn492608TW afz78x54mz01cNmCtK+8EzTn0zHijsHp9dMHFU2zIdGCoke3HU5fh4vkuXKXKNV5n/ab f+HA== 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; bh=IcrAzu0/UMhNvU/QrMjkiMrk/PLtQgMkds9y37Yu4qg=; b=scfDTyYptii5LGACMfC8mHo+sddiZv6uK7OTlt0v4fzBBOVHxjG2EMMxdzBTIz9/be iuh+UJnFWpz94W3+L6w5aFkFSekleNedVzuOTDzGALkbmD/GIjj2bPYaYQ3BTcBT09m9 sCYUQmZ5nTSgSME17xWEt9l0kU1BhnHx+mBrmyQMSvn2RRqLbR3amKLYmiykN0oY3HKp UGnriK3pO32QaZFQLodaSgjZFAQUYGlp5+tq7gixMLuzMjFz49t1Gd85XLHk5gPbw9aA l1o5YLBKUQtGfj7KslWpnSH2eJfFhAQIuVHftlo+Anyl3hz84ObGUeqWy10U8/pNR9MU Kbmw== X-Gm-Message-State: AOAM530Ejid/ZmtLhaTVbZ+sXyJ6ZeuKNlksh8dsGUVNvQXCGiVEbt1n 5OroIv8r5dvGWz4dcKX+v4e/6Q== X-Google-Smtp-Source: ABdhPJxNw+/656VRD6PGnpA+zHOJCy9wwMygdqm6UmvDTT77dmMyvoR0p4c//KsTPQ2uf+XtChHC8A== X-Received: by 2002:a17:902:b28a:: with SMTP id u10mr2912502plr.30.1598561637578; Thu, 27 Aug 2020 13:53:57 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id q11sm3266818pgj.92.2020.08.27.13.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 13:53:57 -0700 (PDT) Date: Thu, 27 Aug 2020 14:53:54 -0600 From: Mathieu Poirier To: Leo Yan Subject: Re: [PATCH 1/2] perf cs-etm: Fix corrupt data after perf inject from Message-ID: <20200827205354.GE22307@xps15> References: <20200819084751.17686-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200819084751.17686-1-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200827_165400_178293_CDB7E55B X-CRM114-Status: GOOD ( 24.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Andi Kleen , Al Grant , Suzuki K Poulose , Peter Zijlstra , Adrian Hunter , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, Alexander Shishkin , Ingo Molnar , Namhyung Kim , Kan Liang , Jiri Olsa , linux-arm-kernel@lists.infradead.org, Mike Leach Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Leo and Al, On Wed, Aug 19, 2020 at 04:47:50PM +0800, Leo Yan wrote: > From: Al Grant > > Commit 42bbabed09ce ("perf tools: Add hw_idx in struct branch_stack") > changed the format of branch stacks in perf samples. When samples use > this new format, a flag must be set in the corresponding event. > Synthesized branch stacks generated from CoreSight ETM trace were using > the new format, but not setting the event attribute, leading to > consumers seeing corrupt data. This patch fixes the issue by setting the > event attribute to indicate use of the new format. > > Fixes: 42bbabed09ce ("perf tools: Add hw_idx in struct branch_stack") > Signed-off-by: Al Grant > Reviewed-by: Andrea Brunato > Signed-off-by: Leo Yan > --- > tools/perf/util/cs-etm.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c > index c283223fb31f..a2a369e2fbb6 100644 > --- a/tools/perf/util/cs-etm.c > +++ b/tools/perf/util/cs-etm.c > @@ -1344,8 +1344,15 @@ static int cs_etm__synth_events(struct cs_etm_auxtrace *etm, > attr.sample_type &= ~(u64)PERF_SAMPLE_ADDR; > } > > - if (etm->synth_opts.last_branch) > + if (etm->synth_opts.last_branch) { > attr.sample_type |= PERF_SAMPLE_BRANCH_STACK; > + /* > + * We don't use the hardware index, but the sample generation > + * code uses the new format branch_stack with this field, > + * so the event attributes must indicate that it's present. > + */ > + attr.branch_sample_type |= PERF_SAMPLE_BRANCH_HW_INDEX; > + } I've see this patch before... I thought it had been merged - what happened? Thanks, Mathieu > > if (etm->synth_opts.instructions) { > attr.config = PERF_COUNT_HW_INSTRUCTIONS; > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel