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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45D42EEE26C for ; Fri, 13 Sep 2024 11:55:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=c36twBsDJ1meILw0dQenJA6KXCER3syz9RriWS8z4Ro=; b=mZfkg8UJJiazo1LRrNbmZLnytK 7F4ixuk3/QVxoah2DWPO1+BuFARXHLhjlfHVx1Jg6pwm0i/yzQ3Clp4Nvo2IB0DnVbXySAt8Pa3qX whXPiate4L5nbsQMH+ewTOoX2lez1dsVLfRzb3ERlkKyyrl23n5ROLObSC3beV3tw3u+WKClu/fmp bnebJ+5X57GCcNqnUYwR+UV7zs4gu+aJzLCURwavXrbhsQqXQle1yUS3lqBVsJxlp8W2SsfV0iqup 8YD4fG6ZXrsxZTMyV7LmVCqywTLmWamogINE3ChR6qySmOrEC6KKAiRWj4DD25M9afFWVPVKiSzvN Zdd6oQGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sp4tX-0000000Fnls-1uie; Fri, 13 Sep 2024 11:55:23 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sp4sS-0000000FnhG-3aTW for linux-arm-kernel@lists.infradead.org; Fri, 13 Sep 2024 11:54:18 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8352413D5; Fri, 13 Sep 2024 04:54:42 -0700 (PDT) Received: from [10.2.76.71] (e132581.arm.com [10.2.76.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 366E53F64C; Fri, 13 Sep 2024 04:54:10 -0700 (PDT) Message-ID: Date: Fri, 13 Sep 2024 12:54:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/7] perf cs-etm: Use new OpenCSD consistency checks To: James Clark , linux-perf-users@vger.kernel.org, gankulkarni@os.amperecomputing.com, coresight@lists.linaro.org, scclevenger@os.amperecomputing.com Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , "Liang, Kan" , Suzuki K Poulose , Mike Leach , John Garry , Will Deacon , Leo Yan , Ben Gainey , Ruidong Tian , Benjamin Gray , Mathieu Poirier , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20240912151143.1264483-1-james.clark@linaro.org> <20240912151143.1264483-3-james.clark@linaro.org> Content-Language: en-US From: Leo Yan In-Reply-To: <20240912151143.1264483-3-james.clark@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240913_045416_974224_7041ADB4 X-CRM114-Status: GOOD ( 17.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 9/12/24 16:11, James Clark wrote:> > > Previously when the incorrect binary was used for decode, Perf would > silently continue to generate incorrect samples. With OpenCSD 1.5.4 we > can enable consistency checks that do a best effort to detect a mismatch > in the image. When one is detected a warning is printed and sample > generation stops until the trace resynchronizes with a good part of the > image. > > Reported-by: Ganapatrao Kulkarni > Closes: https://lore.kernel.org/all/20240719092619.274730-1-gankulkarni@os.amperecomputing.com/ > Signed-off-by: James Clark > --- > tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c > index b78ef0262135..b85a8837bddc 100644 > --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c > +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c > @@ -685,9 +685,14 @@ cs_etm_decoder__create_etm_decoder(struct cs_etm_decoder_params *d_params, > } > > if (d_params->operation == CS_ETM_OPERATION_DECODE) { > + int decode_flags = OCSD_CREATE_FLG_FULL_DECODER; > +#ifdef OCSD_OPFLG_N_UNCOND_DIR_BR_CHK > + decode_flags |= OCSD_OPFLG_N_UNCOND_DIR_BR_CHK | OCSD_OPFLG_CHK_RANGE_CONTINUE | > + ETM4_OPFLG_PKTDEC_AA64_OPCODE_CHK; > +#endif Looks good to me. Just one question: should the flag ETM4_OPFLG_PKTDEC_AA64_OPCODE_CHK be set according to ETM version? E.g. it should be only set for ETMv4 or this is fine for ETE as well. Thanks, Leo > if (ocsd_dt_create_decoder(decoder->dcd_tree, > decoder->decoder_name, > - OCSD_CREATE_FLG_FULL_DECODER, > + decode_flags, > trace_config, &csid)) > return -1; > > -- > 2.34.1 >