Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2042718rdh; Sat, 25 Nov 2023 11:10:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IEY7fKqY2TquCeIVHVKWv4/URN7UtO/1DmLfrFsazZhyJxsE5Vi+rZKKXDKGLcJRtjjqkM1 X-Received: by 2002:a05:6a00:3a0b:b0:6cb:8dba:ce6c with SMTP id fj11-20020a056a003a0b00b006cb8dbace6cmr7204177pfb.18.1700939442934; Sat, 25 Nov 2023 11:10:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700939442; cv=none; d=google.com; s=arc-20160816; b=YmFXNw36CcJjygi49mrmXgEt+HOUkC4JFKnZjRO1BEQmZCVpq2V2XezsGAJPz/pqci bPApjtKq04PxEBTUW1d3671/GXbGM26kI8T2PJf4/f6DzcSmNIZ4i5wvRl3iYZBP2KFo 8HFZrpJjv3ym5sIvXTbCAKSIh5nRxyvawgzybuW7sGxx/IyLFaGR9iNWuTT9dYnUJRZI 48kuYj6OI4OQISCYimMKQuBNlYmj+tDb7k8Wimb1DhujBCwOPz0WPth/ggT++IGMxjTh dzqOMhgGuparpykQEnzY4WqSA9BQ+qc/2nXWTS++TNLKTMm0NO6uuOm3LMUZK5HZYoIB jKHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=51wgJAsLgCLTj/geZdGHifOxcpHfdRgyP1//939uSYk=; fh=Hc/ZQuqR5OwhkjbRX/fPUOPbPNrQ80vWDdaGwBDMN+s=; b=JQ2zXsdT9yJV8FhY2U/vC4+H3pvvQCJ2bIsMsUUq/xjGxX2/W4VWn52qnmHrY1S6BV DxyRpCEli688ZLjgjoaWobA4KCGFkA2T4BaxczMoX74EJVK8FnvltWN1gBxWx1cJZYvc zU1kDV/sLEwGCnYQXOUo7h49mTidu0hT6HJeDZrEnvi7aXPOKqDizGsV3qZ0DfVXQXFq pGNGsUW8PBWLjNIHsmKrvlBgwukSUS/DuSv6Q1If6yFrF7LZo19Q73W91UqOWm4SAMjc URwGgTfZ4G+ljqYqxYtfYWxO8gD5YsSe+edQkJTOibIfqboB45RNc05m6Ode0J+ujLS6 SFHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id p21-20020a63f455000000b005898e5f41f8si6375577pgk.53.2023.11.25.11.10.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 11:10:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 679E8805AA3C; Sat, 25 Nov 2023 11:10:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232148AbjKYTKY (ORCPT + 99 others); Sat, 25 Nov 2023 14:10:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231901AbjKYTKX (ORCPT ); Sat, 25 Nov 2023 14:10:23 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 43DA7129; Sat, 25 Nov 2023 11:10:29 -0800 (PST) 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 A032CDA7; Sat, 25 Nov 2023 11:11:15 -0800 (PST) Received: from [10.57.5.64] (unknown [10.57.5.64]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 446CA3F6C4; Sat, 25 Nov 2023 11:10:27 -0800 (PST) Message-ID: Date: Sat, 25 Nov 2023 19:10:25 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] perf test: Remove atomics from test_loop to avoid test failures To: Leo Yan , Michael Petlan Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Arnaldo Carvalho de Melo , vmolnaro@redhat.com References: <20231102162225.50028-1-nick.forrington@arm.com> <20231125030529.GB178091@leoy-huanghe> Content-Language: en-GB From: Nick Forrington In-Reply-To: <20231125030529.GB178091@leoy-huanghe> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 agentk.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 (agentk.vger.email [0.0.0.0]); Sat, 25 Nov 2023 11:10:40 -0800 (PST) On 25/11/2023 03:05, Leo Yan wrote: > Hi all, > > On Fri, Nov 24, 2023 at 08:57:52PM +0100, Michael Petlan wrote: >> On Thu, 2 Nov 2023, Nick Forrington wrote: >>> 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). > I am confused by above description. As I went through the script > record.sh, which is the only test invoking the program 'test_loop', > but I don't find any test is related with stack frame. > > Do I miss anything? I went through record.sh but no clue why the > failure is caused by stack frame. All the testings use command: > > if ! perf report -i "${perfdata}" -q | grep -q "${testsym}" > ... > fi > > @Nick, could you narrow down which specific test case causing the > failure. > > [...] All checks for ${testsym} in record.sh (including the example you provide) can fail, as the expected symbol (test_loop) is not the top-most function on the stack (and therefore not the symbol associated with the sample). Example perf report output: # Overhead  Command  Shared Object          Symbol # ........  .......  ..................... ............................. #     99.53%  perf     perf                   [.] __aarch64_ldadd4_relax ... You can see the issue when recording/reporting with call stacks: # Children      Self  Command  Shared Object          Symbol # ........  ........  .......  ..................... .......................................................... #     99.52%    99.52%  perf     perf                   [.] __aarch64_ldadd4_relax             |             |--49.77%--0xffffb905a5dc             |          0xffffb8ff0aec             |          thfunc             |          test_loop             |          __aarch64_ldadd4_relax ... > >> I believe that it was there to prevent the compiler to optimize the loop >> out or some reason like that. Hopefully, it will work even without that >> on all architectures with all compilers that are used for building perf... > Agreed. > > As said above, I'd like to step back a bit for making clear what's the > exactly failure caused by the program. I don't think this loop could be sensibly optimised away, as it depends on "done", which is defined at file scope (and assigned by a signal handler). Cheers, Nick > > Thanks, > Leo >