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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 8BB1FC433E2 for ; Tue, 1 Sep 2020 14:55:06 +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 4210A206EB for ; Tue, 1 Sep 2020 14:55:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TJJPX5E5"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="e9Xu99Ye" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4210A206EB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.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=zx9QRYAtvYPFxoZHmDe+7WnhsgkvjT0uE2hLFOqNXKw=; b=TJJPX5E5P94RKYJxNUGM6AmcY 8Qq212gOdx/vVzjjZlTUAzM25T0CL27uKSWX8K+nLczccCCZ4XB0xoHjPhPnGecNIiVp4h5oxov7/ cXxNfXV4DldFuTMS5vSxCBzVQOFhHx1al/C/uGsBGQNcMPYhffEItr9UE9c+ADovrmBUWgq3jx8Vb Wd8ctN4//MR1M9n48eU/2xxx1zoFVRJjb89VZlcwyIX3mMffQ5Escp/1oS/rebNexdXZL4xGpI0ZH K6r2S2K1EDcvdG6a0pT5it12CaA3NEPxsT7Y5LLqKs0+049c1yWoU4tnPR6ANv/5oywETPlA4TmZO zyeVNA/PQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kD7fM-0002K5-2t; Tue, 01 Sep 2020 14:53:44 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kD7fE-0002HX-NK for linux-arm-kernel@merlin.infradead.org; Tue, 01 Sep 2020 14:53:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=DnM3CPP6gaaCXAhsrBCrOBhEOkbxQp49XhwQECesUMM=; b=e9Xu99YeeWY2uukQe7w6ILChzw oX8js5+kriYM2rTFRPBnpsEkPFejLyubHAjqS30WBYmYtDwTK9Nk7jhSo2A9KYAEti0EjyYxA00u5 /nLS5TMtG6dwQ0vWWf+0nWVe41fkbTl3yeh2mDENWWXP1YceB+rzYxtOJUR8yJlsWIWOtzQUPXXw9 GG96Gvm9iOjmOmIgWe7Essrzc/1GRF/pJW/6wh4rKdXMZ5C3AceQvS8zlXZj+HkPR+Lc1envF4kSV 5Fz9Sh9DLR2mHHv3JvrRZTMTEH1GMSrF5vI/ygR2UDWZkJ4cQ11VhunqlTM0zMyDrkt9pMM2EqoeO JX4tUUoA==; Received: from [179.97.37.151] (helo=quaco.ghostprotocols.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kD7fC-0007BE-9n; Tue, 01 Sep 2020 14:53:35 +0000 Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 4446840D3D; Tue, 1 Sep 2020 11:53:31 -0300 (-03) Date: Tue, 1 Sep 2020 11:53:31 -0300 From: Arnaldo Carvalho de Melo To: Mathieu Poirier Subject: Re: [PATCH 2/2] perf intel-pt: Fix corrupt data after perf inject from Message-ID: <20200901145331.GA1422817@kernel.org> References: <20200819084751.17686-1-leo.yan@linaro.org> <20200819084751.17686-2-leo.yan@linaro.org> <20200831203832.GA120995@xps15> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200831203832.GA120995@xps15> X-Url: http://acmel.wordpress.com 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 , AAl Grant , Suzuki K Poulose , Peter Zijlstra , Adrian Hunter , linux-kernel@vger.kernel.org, Alexander Shishkin , Ingo Molnar , Leo Yan , 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 Em Mon, Aug 31, 2020 at 02:38:32PM -0600, Mathieu Poirier escreveu: > On Wed, Aug 19, 2020 at 04:47:51PM +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 Intel PT 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 > > Signed-off-by: Leo Yan > > Arnaldo, please consider. > > Reviewed-by: Mathieu Poirier Thanks, applied, and 1/2 too. - Arnaldo > > --- > > tools/perf/util/intel-pt.c | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c > > index 2a8d245351e7..0af4e81c46e2 100644 > > --- a/tools/perf/util/intel-pt.c > > +++ b/tools/perf/util/intel-pt.c > > @@ -3017,8 +3017,15 @@ static int intel_pt_synth_events(struct intel_pt *pt, > > > > if (pt->synth_opts.callchain) > > attr.sample_type |= PERF_SAMPLE_CALLCHAIN; > > - if (pt->synth_opts.last_branch) > > + if (pt->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; > > + } > > > > if (pt->synth_opts.instructions) { > > attr.config = PERF_COUNT_HW_INSTRUCTIONS; > > -- > > 2.17.1 > > -- - Arnaldo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel