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,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 925E3C433E7 for ; Mon, 31 Aug 2020 20:40:16 +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 583FA2078B for ; Mon, 31 Aug 2020 20:40:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="B6Wm3dxB"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="iD3qjy7K" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 583FA2078B 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=8eckYdMwNDZ1Cg2FFcR2EyGHYMrhXfWELLn6fW+75+s=; b=B6Wm3dxBiWreK7/HBma0RiuiV 1T6FXJInKIqJIv+yv0aYXWWyEb/aTNusexlnpuu96oRqJgJbHYq9FAR7RtMOTJ4pVwRirnyYPeNRV grESktbo/oX4iaUR41sT/RnkFAtWMDK2sZwMKd9A/ES/fUDw5+kIIt6olGLRXZIVkCqu10BWdxEWj FxwYcqeXhnapcyevc+sskf8MYaB/wPjzMff9otR6O8xEfhpZa/ClcGaXvrhaZCYi30c9hXNFgZj5W 9xblrpVdVyoEd05uIIjzyU+ynqUQk8pTottDvP6QuDi3rNlSmzx0DhuP9Y1if7zfhpcXHx6X6BmRy A7WhpbwRA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCqZc-0005Mz-T9; Mon, 31 Aug 2020 20:38:41 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCqZa-0005M3-Nf for linux-arm-kernel@lists.infradead.org; Mon, 31 Aug 2020 20:38:39 +0000 Received: by mail-pf1-x441.google.com with SMTP id m8so1317216pfh.3 for ; Mon, 31 Aug 2020 13:38:37 -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=K/7PK6S5Q6HPaHq1eTEnKf0uxbke5x5RCxK0h2wg5MI=; b=iD3qjy7K7rLQsbdLS08nvec3+rM9z7c+f4CUp0k4t39HnIujZ8vk0S8wvig/Z+Afhd sjXJYjB/unW5U/y62CSJod/KXZxJRFkEnUC1VWxC+KIPPzPmNBKoP93r0k/7HLVSzk4g QKUrimlJnMdc4cyZHkskrXezSxkUzb80x5/b5FzkLGNpGunkUWqOnV5/JZ6zTQl42Bjd cHSUscDipKnvrcPDtsBKFWkOVYxr9tQgD0aJrCKfUXFQT85BZvQe2rB9b1jLLcykGKl7 GGbhN8LiBhSjcNbNmg5ZqLkaTJG3/W0PjQo6SJoBYmx44NG/8LgG6DOv+dtbAacwo4dj bUIg== 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=K/7PK6S5Q6HPaHq1eTEnKf0uxbke5x5RCxK0h2wg5MI=; b=V6FGFS14h2rw3nM54/a10xhK2peR05AvbtTVxtwqTY9c/dPGXil2crT//fomTiigCB X/I46E3EMASyVcFwNxq5xu7ctO5ryzIC0BVYuYT1mAHPklRQkNCJH6DG/8lvBHt6NSMT 6HwdPX3As6MPJTuthAaVx1U207StEqOgTsZYCzUf12QV0+at6R9fVgWw8AsnCYq1hTFs yl5GEfRLt4lGDyR+sZiUymg8hqQ0G2LK99pW4FSYoXwibgYtHcaY6gqAS+cTJytgRrsK bNfp8AnRL58Oou+qo8AlwXk2vDcdVJUuh23zlyZh+d9PNFzIb+djPEwJXhA72dWnQtDv /67g== X-Gm-Message-State: AOAM530UM9WmmI4JZWUM3ER43RrDd4TUQSAjjAiEl3Hz7jrvUYFc9iAE a2gya8o6W9XZDefbIVlIHL9NyQ== X-Google-Smtp-Source: ABdhPJwprAyCBcJ1XpRTFAQaEvCQLHh7Ax18vWRPUmgyeqkVYZHQhwVmBvUkgTn9jN1woKzPD/at+g== X-Received: by 2002:a65:4847:: with SMTP id i7mr2554665pgs.385.1598906315528; Mon, 31 Aug 2020 13:38:35 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id l23sm8267869pgt.16.2020.08.31.13.38.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 13:38:34 -0700 (PDT) Date: Mon, 31 Aug 2020 14:38:32 -0600 From: Mathieu Poirier To: Leo Yan Subject: Re: [PATCH 2/2] perf intel-pt: Fix corrupt data after perf inject from Message-ID: <20200831203832.GA120995@xps15> References: <20200819084751.17686-1-leo.yan@linaro.org> <20200819084751.17686-2-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200819084751.17686-2-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200831_163838_905933_939EAF17 X-CRM114-Status: GOOD ( 24.65 ) 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 , 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 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 > --- > 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel