Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp813157rdb; Thu, 30 Nov 2023 21:40:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IENjP2xlnTRysGnwk2E5r0rkrrSpo6xSl/xORvzzmcieTfo8vCYCVdhUF3dF1Rep4RniKEj X-Received: by 2002:a05:6a21:a58a:b0:186:9314:6238 with SMTP id gd10-20020a056a21a58a00b0018693146238mr26111970pzc.47.1701409243327; Thu, 30 Nov 2023 21:40:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701409243; cv=none; d=google.com; s=arc-20160816; b=r38nTzTen7SHOIsbaXQEBdMdBeCzLPlfhHu0n5/H27QEibcd0Omc0V0IzLOBnF9wk+ +VWmQNDSUTWJYHn30zj+bP76LoNNx+h14gc+dl/JlLwiiOyZdR824tqvWCDAY+jLpIgh uX9HHL0eXA2C476H3agbqTAEmOmKZpl6/Ag47wEqtZlf6uTdWM+hjIPiHQGI/po6SxQo HMSNJP+vONeUZY4KJCAVK4ev3u4mz9Uy6N5+wpvnk8DVhcQllwfOv8ovNGLEW4C90hP/ cqoPOUd0/OxVGMeVr8FhIAjqveHCrtgmgwOK/CuNviV+VtLQ5lJ/SxDOWKBJ2HvygOw9 wOSg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=7E+gF4/Cum46HG24vwCOO9GJ/FH12eqW/ACPin/Ft0k=; fh=V2J5DHn0lHtldVpcv/exnbGcu06d5n6VQ+L/z9BBIRM=; b=CU6YqncB3AboOQje2n9naL2cXKkC0bSVDRJ+e3zJrloOJ1goo3/tD/q8A6oKAeeiy1 2qaiZZd3xgPBzrSl2ex8JlPG9GWlthDadrlOF+fU4UYvIczEKsrr26neSEAA5q0H19/l O2dm1ID22SUoQyMaveygMN7muZhAoNUL8kh9irCJ3GXTSilunpSJTpcxGz1e0Gg9pggN 3bFu1NyG8K1wljBsVOiewS9UR5wr+pwzRXhC8jv46aCl6KlJBrnUsP4vH+Myl0sAIVp3 VHG8/y1I5JSn5hmP17GrBkuxCt5Wqmg0ItT8IO7Cm78eNK+0s5guQ8aMZE9JLI9YcpjV Eq/A== 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:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id l6-20020a170902ec0600b001d0551e938bsi452669pld.322.2023.11.30.21.40.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 21:40:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 0EACB8329943; Thu, 30 Nov 2023 21:40:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377593AbjLAFkU (ORCPT + 99 others); Fri, 1 Dec 2023 00:40:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377545AbjLAFkD (ORCPT ); Fri, 1 Dec 2023 00:40:03 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1BF671BC8; Thu, 30 Nov 2023 21:39:57 -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 05C531758; Thu, 30 Nov 2023 21:40:43 -0800 (PST) Received: from a077893.blr.arm.com (a077893.blr.arm.com [10.162.41.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8A1B93F73F; Thu, 30 Nov 2023 21:39:51 -0800 (PST) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com Cc: Anshuman Khandual , Mark Brown , James Clark , Rob Herring , Marc Zyngier , Suzuki Poulose , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-perf-users@vger.kernel.org Subject: [PATCH V15 6/8] perf: test: Speed up running brstack test on an Arm model Date: Fri, 1 Dec 2023 11:09:04 +0530 Message-Id: <20231201053906.1261704-7-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231201053906.1261704-1-anshuman.khandual@arm.com> References: <20231201053906.1261704-1-anshuman.khandual@arm.com> MIME-Version: 1.0 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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 30 Nov 2023 21:40:40 -0800 (PST) From: James Clark The test runs quite slowly in the model, so replace "xargs -n1" with "tr ' ' '\n'" which does the same thing but in single digit minutes instead of double digit minutes. Also reduce the number of loops in the test application. Unfortunately this causes intermittent failures on x86, presumably because the sampling interval is too big to pickup any loops, so keep it the same there. Cc: Mark Rutland Cc: Arnaldo Carvalho de Melo Cc: linux-perf-users@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: James Clark Signed-off-by: Anshuman Khandual --- tools/perf/tests/shell/test_brstack.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/shell/test_brstack.sh b/tools/perf/tests/shell/test_brstack.sh index 09908d71c994..283c9a902bbf 100755 --- a/tools/perf/tests/shell/test_brstack.sh +++ b/tools/perf/tests/shell/test_brstack.sh @@ -12,7 +12,6 @@ if ! perf record -o- --no-buildid --branch-filter any,save_type,u -- true > /dev fi TMPDIR=$(mktemp -d /tmp/__perf_test.program.XXXXX) -TESTPROG="perf test -w brstack" cleanup() { rm -rf $TMPDIR @@ -20,11 +19,21 @@ cleanup() { trap cleanup EXIT TERM INT +is_arm64() { + uname -m | grep -q aarch64 +} + +if is_arm64; then + TESTPROG="perf test -w brstack 5000" +else + TESTPROG="perf test -w brstack" +fi + test_user_branches() { echo "Testing user branch stack sampling" perf record -o $TMPDIR/perf.data --branch-filter any,save_type,u -- ${TESTPROG} > /dev/null 2>&1 - perf script -i $TMPDIR/perf.data --fields brstacksym | xargs -n1 > $TMPDIR/perf.script + perf script -i $TMPDIR/perf.data --fields brstacksym | tr ' ' '\n' > $TMPDIR/perf.script # example of branch entries: # brstack_foo+0x14/brstack_bar+0x40/P/-/-/0/CALL @@ -53,7 +62,7 @@ test_filter() { echo "Testing branch stack filtering permutation ($test_filter_filter,$test_filter_expect)" perf record -o $TMPDIR/perf.data --branch-filter $test_filter_filter,save_type,u -- ${TESTPROG} > /dev/null 2>&1 - perf script -i $TMPDIR/perf.data --fields brstack | xargs -n1 > $TMPDIR/perf.script + perf script -i $TMPDIR/perf.data --fields brstack | tr ' ' '\n' > $TMPDIR/perf.script # fail if we find any branch type that doesn't match any of the expected ones # also consider UNKNOWN branch types (-) -- 2.25.1