From patchwork Thu Sep 5 10:50: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: 13792152 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 AA789CD5BA8 for ; Thu, 5 Sep 2024 10:55:19 +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=uO37RxN7wuDzGQMuC0MUSAvzjU lPJ4qCJvPudhoALcIftQY8fQklA9QQDHYjOnJeKYBXpmKobtPDQrD8aKJhw+YLpJFZ9BntyuTZgEe +iu/oeruzZ6oOHRYaCiBKhIwHdqPlRemRywp+dTp/LAmpyt7khXTP/exKD+nTpq3X/ed/PMBR7Zzz 0dVJ3xGcVoSGxQKnIFrNyOrK5WwvnZSgRQEcpizufcBRMbuf5MseHtgLvf+xVQbZ9xWpIBtccyVvg 61VPaa+c23EqpmOX+kKMWoVDy9Jnjw5bMzW8f6efoGOdiyjqxkrXFyKrzDm/iekU+g2MLxicWVQAU opXY6PSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smA8s-000000082Gn-060s; Thu, 05 Sep 2024 10:55:10 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smA52-000000081Mw-1Vxd for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 10:51:15 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-428e0d18666so4674955e9.3 for ; Thu, 05 Sep 2024 03:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725533471; x=1726138271; 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=h1YnEIUZCSojEP/pUY3MJDE10xqoNUAXf6AL1pCQUwcNk+7RQtwn9EeoyC6fB8mJ/V oaaRFr7F5kebRWzf9rmQ5kOMCLyk2W968N0LRmUBhiT2QaKXS9HjqFLrhAnqdaDxkM6/ /PJ9tNn2tYBJ59lYNo+Ppbb+QBCx4hTzyunpH8EDEIlzPTPboblJi/BPlypfMyNH5x65 UPbnF3i0aNOR7K7fD+RDQdY199veS/RsV8NSFvGnbPOOA+TKGoSiflgizAi0ziYcBE4a J//wlB9j1PU1ItbDCGWHXOhoof02+z50stbVXKBXtsFZXvMHEZDdLp8PJLAXMyCe8vYn veJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725533471; x=1726138271; 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=eoU1M64qm7BZMCSMA92OoXJ4zqLen123weEsZL3dLQI7EsHOWvsddQhbAXtxR29pJY OK3U3Q6FZTqbMxFRTlqQUC0T1/LW78c2w2OpUb9JgDMxMWuHiogroXmXzQdRdw/JXY4G lEOOBSOKsmhi/CljJIkFLT+siLATzlb/ZrrlWO0s6pH0v6T+812IGzNugyf5ppb51opM wjNz7rGYk/V9NHPe0/k32LVCxMAh7jLu8EhaR2N8DhKUgHScNu7X8cfHLkIkOTbG1f9Z s5dd/itMVKmQTZR31QdKz1QMUdJq0KjGVl5OC0FA2HF2xoCZqzXKp+JXUHfX3Af3KmZZ sMSA== X-Forwarded-Encrypted: i=1; AJvYcCU3PNgFvzc2Xusqsgx3gmgmDL/wNx0p7uslAqnEEFa5+T7XVsuvf8LUHTbmCuPV8EKMfalY5a3jDTQbwjDILePb@lists.infradead.org X-Gm-Message-State: AOJu0Yx85/3+YZII+zdJI+xUAPyGDGT33KuL7NcDigFQz1aj5fYsqd4j vW3w4GqW+2PQh0xuuXyP8k3GYXynSthEGQZAsO08sqnGG7/I035xnxM8yDswcFA= X-Google-Smtp-Source: AGHT+IGNR6IhhEwS/jgcksvn9DO/af4hIbBkDS8ADbe7BTQ8BnykRnU/aKDonHdKsUgmQWK1V7Lc5w== X-Received: by 2002:a05:600c:34c3:b0:426:5fe1:ec7a with SMTP id 5b1f17b1804b1-42bbb440201mr138466235e9.31.1725533470807; Thu, 05 Sep 2024 03:51:10 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6df0dbcsm231089965e9.17.2024.09.05.03.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 03:51:10 -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 2/8] perf cs-etm: Use new OpenCSD consistency checks Date: Thu, 5 Sep 2024 11:50:33 +0100 Message-Id: <20240905105043.160225-3-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240905105043.160225-1-james.clark@linaro.org> References: <20240905105043.160225-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-20240905_035112_428422_1C1F585E X-CRM114-Status: GOOD ( 13.53 ) 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 --- 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;