From patchwork Thu Nov 2 16:22:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Forrington X-Patchwork-Id: 160977 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp474613vqu; Thu, 2 Nov 2023 09:23:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQlHuasxEh+6Z0ID2VNxHeU+xae0QaaR97lkWAcw0v1+aMOVrmiJRwwejZ//5iJw2RwFov X-Received: by 2002:a17:903:26c3:b0:1c9:fdbf:296a with SMTP id jg3-20020a17090326c300b001c9fdbf296amr16010500plb.8.1698942185493; Thu, 02 Nov 2023 09:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698942185; cv=none; d=google.com; s=arc-20160816; b=mfqsDJpHRQlORabmRWBIs1oy9kg+zj+bnoVo05YoroFNa/ZjQFpx8Gb2KIzQQEcqjU u7FKvWb88/0qF2xy4xvH/5bdpEOtM0mfURG/01EqKIUMAvlfqgXdljpDPuie2/MHUrcu hm5xKBWfVPvcHhQfSGHYTV1fT9zNWuI/WbimnAgcveI386FudVZ3awxp5kMwiHYASLMu tPQaJoIgnqBfHvXgEodF0LN1Ij4CWebmsj0Xm7gYKTcN2OGz97T2ZO/6TxDSMaeTqD9h 6isRB6sVNMvQ0UAzQ55EyplvrR6+WkflATt5ryYFnhZ7isTzxWcm+8KB2hYiVX1FjB3J aYFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=6jO3i5ZHHx4eTXnBm2SQv30Sqe08v70jQSZj8afHIgE=; fh=KZwJI2IhX2NkYw3UI/ow2q4exUfD2a8wOZqtpxoZpb8=; b=kiWPCOYWAVnDTCXOUa2HUeKBiYs5sRUBnV+7QN4Uie67wQEtd5+hJUAj1iG7dGPZnd wGbfskGodj9LW5rz2OqqF4i+xjh5n6qIctuB5fRq8KLkTL/NB0NSWgsvOda/fbhft1cg 6hqyfpv9yaZgHtyH+ZU2uBv9VzekrzCyL3z25RzBHgY4ashv1UVfAhMAxcWQ4eS+9UXi 1YuV54wZOufv68lH96lZ9nP4u4E01163U0UMKaklNG31LyIFeSHiRkkGXXwLTZZ9Doto 9r9iqbk4GiyI9nVNa2EcMTX65Ci6EZf/weL4b5IUVMUtPpUO1jVAxzsKj/tE/W7LyZGu wTAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id j3-20020a170903028300b001c9c3212c88si105176plr.253.2023.11.02.09.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 09:23:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E9E33817C8BD; Thu, 2 Nov 2023 09:23:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234161AbjKBQWx (ORCPT + 35 others); Thu, 2 Nov 2023 12:22:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234506AbjKBQWv (ORCPT ); Thu, 2 Nov 2023 12:22:51 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8484312E; Thu, 2 Nov 2023 09:22:48 -0700 (PDT) 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 9205E2F4; Thu, 2 Nov 2023 09:23:30 -0700 (PDT) Received: from dsg-hive-n1sdp-01.. (dsg-hive-n1sdp-01.cambridge.arm.com [10.2.2.18]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D379A3F738; Thu, 2 Nov 2023 09:22:46 -0700 (PDT) From: Nick Forrington To: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Cc: Nick Forrington , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Arnaldo Carvalho de Melo Subject: [PATCH] perf test: Remove atomics from test_loop to avoid test failures Date: Thu, 2 Nov 2023 16:22:24 +0000 Message-ID: <20231102162225.50028-1-nick.forrington@arm.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 02 Nov 2023 09:23:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781470001575927924 X-GMAIL-MSGID: 1781470001575927924 The current use of atomics can lead to test failures, as tests (such as tests/shell/record.sh) search for samples with "test_loop" as the top-most stack frame, but find frames related to the atomic operation (e.g. __aarch64_ldadd4_relax). This change simply removes the "count" variable, as it is not necessary. Fixes: 1962ab6f6e0b ("perf test workload thloop: Make count increments atomic") Signed-off-by: Nick Forrington Reviewed-by: James Clark Tested-by: Leo Yan --- tools/perf/tests/workloads/thloop.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/perf/tests/workloads/thloop.c b/tools/perf/tests/workloads/thloop.c index af05269c2eb8..457b29f91c3e 100644 --- a/tools/perf/tests/workloads/thloop.c +++ b/tools/perf/tests/workloads/thloop.c @@ -7,7 +7,6 @@ #include "../tests.h" static volatile sig_atomic_t done; -static volatile unsigned count; /* We want to check this symbol in perf report */ noinline void test_loop(void); @@ -19,8 +18,7 @@ static void sighandler(int sig __maybe_unused) noinline void test_loop(void) { - while (!done) - __atomic_fetch_add(&count, 1, __ATOMIC_RELAXED); + while (!done); } static void *thfunc(void *arg)