From patchwork Mon Sep 16 13:57: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: 13805524 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 3FCFCC3ABA2 for ; Mon, 16 Sep 2024 14:02:03 +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=r6I1ojreNPMnAqnnyAmn/bcHu89TPQPwVi7gpVoP/po=; b=Gep9CwLwrT+tAjMlVVozPTtIRh uzaKGHin/VnkjmLzCPIdjBPm9URsiq7owhZrHUSS92LAeWNnAGDQi253xTtq3G9UmrMMRudlLUmQq flx8CdBhtagNYKP8uexDztj9tlpjMeW2NQXykQxXi+ZXnAdhfrZ3ZA+cpW1ak3tYvrskFbEXq2zay My6ZjGNi1Ep/KkSg9m827uZ9Ae4nGJiq4oRvbAD//dK4ht29YRaKXeLc3p8LijrCjvVKkiznEto47 KZhdVEmra8TJhkLSxObxXDUpkgC+z4FsrJEr14rRtgKuGbWpuBZpLGsNqtRH2QodJsGSVp7xDijfP l5aPPuSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sqCIR-000000048RF-1dOo; Mon, 16 Sep 2024 14:01:43 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sqCFK-000000047Yf-48O7 for linux-arm-kernel@lists.infradead.org; Mon, 16 Sep 2024 13:58:32 +0000 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-374c1e5fe79so3370326f8f.1 for ; Mon, 16 Sep 2024 06:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726495109; x=1727099909; 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=r6I1ojreNPMnAqnnyAmn/bcHu89TPQPwVi7gpVoP/po=; b=yysB4NsllejBPrsrycxnQrDcsqVO/NKXUFmRPvop4Y4B/ev+IDXnUpThHOlzWvpSC/ tRgxMqQikWDJi9wVhdDtXHey6MicgfGP9z+4anwvQ4kkiW+qXi+MYjmnLigLXfL26eL1 KZwEdC0fkpvquQHUYRb1kOIiOZsNm2UNuUEVNXh3JCT64sI1fihr8kK+wPi2RM5ozmso MSBj0xF+kV3+gA2kZeh82GIkyTEa4gSQVvNXFBsQvyrFxK7xrEe7ikRE1qzeeEQ9ozQM PzcNlomWw4OC+M68cWHpOQyUtUS54eZg55Zrlrcc4s1Ec9cUMlw/ATJsCmenScSEZpG8 Pl7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726495109; x=1727099909; 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=r6I1ojreNPMnAqnnyAmn/bcHu89TPQPwVi7gpVoP/po=; b=a/kqVJS6UqMRY8CDEuLYzAim15QTpRadTohkAvD3iLjzOD1tRZmBC3w35T+1J1SOWG Cnhvs3kqo8s5ZGrOAc/D5SQV2vECEKAwfTqc3ck0EqgauG52inPkOjGIbUOotOSEiLZo MWd0XOby54UoEfew8ehmDOKgKqPJ46/ibDV3u/CTW1yOgQsO1g9nkFnComQOQ0oUQQUe Riw0Eb9+lX2IvTHnUuqoIZh65ya5jbnHZddxbLHJlJrX0wrM2UdVQB83LXpP4spK9do3 S4D9VvHT6s9neR/0WxXwCPSoHMINNwAbVpR0dBESwQdb1ZGw4OjZRf1y7s4RtTZ07xra 4lSw== X-Forwarded-Encrypted: i=1; AJvYcCVwwXMcgDYAM2Fmn9wiocyILZ9HJLOQzJraPK3CU6UYtbHwPh+eHkwbMJDgfIPoUFhXFX5rPzsq98inpDvgf4nm@lists.infradead.org X-Gm-Message-State: AOJu0Yx8cl1tYMhrV/aqdH9tkursTF5tZyNT3Clo6davGASrYecraYup FAcZt5scjRXh0wmL6FYPSgzhGYZFuasMEW23N49YV+5z1BV7LqVQj41ybp/jCe0= X-Google-Smtp-Source: AGHT+IFsrj9c9D2EcipbKadvrs/i4J9td9eJ+dOatQVeHhmva8RKXjoSO6yE9qOqsI6nilv8hZ9Unw== X-Received: by 2002:adf:ae51:0:b0:374:d157:c019 with SMTP id ffacd0b85a97d-378c2cfeb36mr8698434f8f.12.1726495109000; Mon, 16 Sep 2024 06:58:29 -0700 (PDT) Received: from localhost.localdomain ([89.47.253.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e73f62dasm7285098f8f.49.2024.09.16.06.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2024 06:58:28 -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 v3 2/7] perf cs-etm: Use new OpenCSD consistency checks Date: Mon, 16 Sep 2024 14:57:33 +0100 Message-Id: <20240916135743.1490403-3-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240916135743.1490403-1-james.clark@linaro.org> References: <20240916135743.1490403-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-20240916_065831_051580_63C2870C X-CRM114-Status: GOOD ( 13.64 ) 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/ Reviewed-by: Leo Yan 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;