From patchwork Thu Sep 12 15:11:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 13802301 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 CD5FCEED613 for ; Thu, 12 Sep 2024 15:24:33 +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: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Pve9lnNvOpeZGUhzPh1pcaBloPgbua89KV6dx7HbhcI=; b=zcClkrQA6flIGdP+nLkotiIGtn Apz0b1rgO0Ks1X71zWUOZP7B0EgTORxVHh2ZM3KunCjYu6w+DlG3/or7casB3Fw2V8roXPNzpau1Q 0agZ7Od3utf+z5g4E4FgrI3a4Y6ZLhborRp23KjlMqg1+HTEKbh/EaNJx6DxmrxbMkNC7bkKYNdAz ls4mzMhzKs8zO3GSN4ZwxBkxzNXOfZCfNlx5WA7j/IJOEizouFHbxO/WmqFRatew1mhiOP1x/EfSZ dp4WDwkSj5yRjGt4VwcRbl4F7cMOMnE7KnRXjYnvKsEZu1P5MYAlAIXHmEE4bgjDMWBjt2ZYSumE2 u5puB4Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1solg1-0000000DXpB-2oaV; Thu, 12 Sep 2024 15:24:09 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1solUr-0000000DV7B-1TnQ for linux-arm-kernel@lists.infradead.org; Thu, 12 Sep 2024 15:12:40 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42bb7298bdeso12282885e9.1 for ; Thu, 12 Sep 2024 08:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726153955; x=1726758755; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Pve9lnNvOpeZGUhzPh1pcaBloPgbua89KV6dx7HbhcI=; b=oeNt+266JoNGXdEZh/m0C4jx3jQ1fBvgooI5ZckWJe53ciS5mxeLv+ioz3UgOpY0X0 jT2YrXni9SMfEounYzr8vHv4tA8I8yAKWjRv6wZ5w01OebyJEtNBvjrmbAJNJ39fyq7O /H8gECjd0UlWmnUWYKdHqagfg3h09CptiE/oByzmid2Kbmtx8SZtVxHntNAOUmGxTMrs 1UIJMYlLPDccnIb3K0cojY97bJogrvU+Qo+QaSeQ0SEl1lvAhiAb5a4IOGpqVrL8DFUb /Hqq01X6nUNk/AnPkqvj02bvRjx8Wbi7OMflDpuZqmUGn4hWpLq2Qm/pbzmHKRKITZxc Otyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726153956; x=1726758756; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pve9lnNvOpeZGUhzPh1pcaBloPgbua89KV6dx7HbhcI=; b=ReYtRTWMYBtCbbuLcf5Bja5cRgO9o19huI2gLgDPmzWEFpr1uzCc0y39OUoRY7w+tT zDPyzZvMjviAOAupg3GD5aXa/fZT7FSWqGY1PS/wy7gttP4DmHH0rGlunzfEZSgGQpv0 +4U67jlxVvtbZMYB4wxk7x1kNqt8gzjjg4wxmqbSy+LMss9fdrBzBZHnTdZSVTY9kHyj kUGQR4Rw57hCg3574acu1QcLApIqzGdb2Jb2Rdf0Eon2f+IaE1mpu/U3pmpwgoEiP7Nt xPFTUOnNYYBrw+990GpC4+zH9U5ZxGSVD3uWy4eG/7YffXcM5t/JdtmO/4niTsRnKN2J HaLg== X-Forwarded-Encrypted: i=1; AJvYcCXt8+Hrifxzgx5r7EuMKZ6NskMBz8Ys5h5mi8Jdhu1/n61E9VNemAbBc+A1V8aJVeWhYl5ELEI48/gotjZ+7Mxu@lists.infradead.org X-Gm-Message-State: AOJu0YyqwQJaQgeLKu/ZUUgO9lgV2N51axgJS1Lbnq4FzPrh5R8feT78 gHUjIoXPADTmqffy7WxujkUy9mC/uVlR7PbMdBC9fq0eQzXXrJC2H7J/4Kx+CKg= X-Google-Smtp-Source: AGHT+IGzxYKeWu7EffFMWELHmwkIdN54nPpsTv5NT6AtbeSZT+Q/+XaT8AVKFhJoMlm8Z9w+5+yKlg== X-Received: by 2002:a05:600c:1992:b0:42c:c401:6d6f with SMTP id 5b1f17b1804b1-42cdb548b0emr34832575e9.16.1726153955430; Thu, 12 Sep 2024 08:12:35 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42cb0dbcb6bsm171928845e9.30.2024.09.12.08.12.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 08:12:34 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org, gankulkarni@os.amperecomputing.com, coresight@lists.linaro.org, leo.yan@arm.com, scclevenger@os.amperecomputing.com Cc: James Clark , 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 Subject: [PATCH v2 2/7] perf cs-etm: Use new OpenCSD consistency checks Date: Thu, 12 Sep 2024 16:11:33 +0100 Message-Id: <20240912151143.1264483-3-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240912151143.1264483-1-james.clark@linaro.org> References: <20240912151143.1264483-1-james.clark@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240912_081237_740509_BA6ADECA X-CRM114-Status: GOOD ( 14.09 ) 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 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 Reviewed-by: Leo Yan --- 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 if (ocsd_dt_create_decoder(decoder->dcd_tree, decoder->decoder_name, - OCSD_CREATE_FLG_FULL_DECODER, + decode_flags, trace_config, &csid)) return -1;