Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1648195rdb; Thu, 25 Jan 2024 01:51:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9cmWmbLi5aDADUAmtoIvisKRr/ImbjazqxZ65VP0hpfZOc4roic7dtRXsHg93MZekY39Y X-Received: by 2002:a17:90a:6f45:b0:28e:3817:5844 with SMTP id d63-20020a17090a6f4500b0028e38175844mr425722pjk.42.1706176302102; Thu, 25 Jan 2024 01:51:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706176302; cv=pass; d=google.com; s=arc-20160816; b=vVZvRvc+xJYbF7DvY793JtW6cI2iABSeSEpLmBNbWjSa7acBIdWXeZhk9w88wDHNgZ 3JX9E6+kr9f/DvlVW/CmlCgz+shlDJz0wLRDNbYkvBzjZ8Fn+CI1l1mwYHOqg1n9qr8l iHxxSiKicZopf27/tXVyD2I11rzfuOeuSw12aj6CltJYhuxusNDQMqBqbqNmbyKkHGKh vyGWqKOwZrgex9jsQXqK5xgY4TSo0tEsljjWohFHXB+8XwcNcetdiYfl2h0RhV3MrisS m4jh7Y99lRnqF1YnMW69qdBpAHghvGMVShau4KxBoxViI95e7J13EAJ87JFWRvb8udU6 ZLyA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=x3FxG1YRi66KO3U+mZJTvmDTQBJ2/r37LRH8qqDm5aE=; fh=V2J5DHn0lHtldVpcv/exnbGcu06d5n6VQ+L/z9BBIRM=; b=h8YvLpDByD2EJfiY4J/HDAACqBsFn9aAD3Ra3P1LbfffOm0uAA6jBUqI2hBZb/bOOV 4nrfvyK7Dlx3Kzi6mOBRZVMxP6aBWSmJJ89tcxSRn5OH6/vESPpGBtyVUkuBe8MprogZ JC+XripquwepPbZQvC5IeAzaJzyeVBUSyAVgBdOk7l7KEQs3sisp+ehsoB6nyQFZGyyw h0ziI4RKDisfYS7fYFS5eLshczUfeLIRASa18ulBJM4X1oIf5pHqGp7hRNwSCYvNUw2u 8MHtWrOBwtAS5x3nwr/3Ikh+DetH0Im5W2zMb7v8AP8kx8/NMEaHLTcoKvLxMiTwEXmt ToKw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-38306-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38306-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bt21-20020a17090af01500b002906c5075f5si1037670pjb.156.2024.01.25.01.51.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 01:51:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38306-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-38306-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38306-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DAD7C295481 for ; Thu, 25 Jan 2024 09:43:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 620521C2BD; Thu, 25 Jan 2024 09:42:12 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD1FE1D52B; Thu, 25 Jan 2024 09:42:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706175731; cv=none; b=eFvSZns85m+/2s0G6lm7RQ9iH6SubiTjacRmXo3Lw0QMDWrTlghbj4ROckCsakUnH9y5tOkZFQQ7Sb5RHkegmOuYCVtdl677Ez1V8Zg56wwZ3RfF7Q1i9lSfYIJAvwDRn73U9jfbxz1gifPZbW4/fFqTEtdHoIw8mXZTg/wanho= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706175731; c=relaxed/simple; bh=U6BxwWWsO2hrcxqX3UheDtH44VcZe/y/iBmW6rm7qVY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=A1bYZI10W8EEZFSvkSkYqSCBW1s3gZaNQt2tWyLZ+ZvieHDu/QpEyObcI6fzSqxAoCBouMCynLezePg2Cugkw6gUdt0Oi/DAZ45H1rggLO3UIygOAlfgcaJLBTfiBKOU8XREtekW0+TbyjgmuIMkdzfk2pvsBzRZ2DMsgplA5t4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 ABF481516; Thu, 25 Jan 2024 01:42:53 -0800 (PST) Received: from a077893.arm.com (unknown [10.163.40.116]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8FE993F73F; Thu, 25 Jan 2024 01:42:04 -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 V16 6/8] perf: test: Speed up running brstack test on an Arm model Date: Thu, 25 Jan 2024 15:11:17 +0530 Message-Id: <20240125094119.2542332-7-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240125094119.2542332-1-anshuman.khandual@arm.com> References: <20240125094119.2542332-1-anshuman.khandual@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 5f14d0cb013f..5ea64d0c4a6f 100755 --- a/tools/perf/tests/shell/test_brstack.sh +++ b/tools/perf/tests/shell/test_brstack.sh @@ -18,7 +18,6 @@ fi skip_test_missing_symbol brstack_bench TMPDIR=$(mktemp -d /tmp/__perf_test.program.XXXXX) -TESTPROG="perf test -w brstack" cleanup() { rm -rf $TMPDIR @@ -26,11 +25,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 @@ -59,7 +68,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