Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp193247lqq; Wed, 12 Jun 2024 23:19:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWZYlkMA4XwGtTxZ+r1/2iQNp19/H9ubh7zwqlp3hDJhg+tmQkM0YWm8aY6nW4rVaqEs75zG7gTyGgNRN17t4ICjke7PCxxfUtg97MnKQ== X-Google-Smtp-Source: AGHT+IGaGZukomFj+E1amDh5xl9sSb6JQmpQT2SdxzZSnteeqkorP0T9Ex9FP7gUmDSeereJoC15 X-Received: by 2002:a0d:eec2:0:b0:627:dde3:fa79 with SMTP id 00721157ae682-62fbaa3cdc7mr37952427b3.22.1718259597890; Wed, 12 Jun 2024 23:19:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718259597; cv=pass; d=google.com; s=arc-20160816; b=NCEjzdjZmPrhIQ5m67QAE9+TABL2Lhsby4uCof5+7Hbu9Xrx6AB9/lPf7pbNZBFbfY Tn3gx1mTa+cAxrmmMCD4fGzV2k7UZKyDGjYaiuBke4XzSfNHo5M/bfZKIP15PWuGNQFM Q5FNhmnGbGZsTkMtz2A3AL+WwyjixWaLkh4/x925Q6LVp1evu3FUAHXVtPH0jlCo2GJ/ n6R4Bq5IkcY5EDrOF/n5OFw+VHlth4aX5j0cteDZaj/3D21ER7l54dyrnB31iRbCSXHD 6WTxInDMnWUtzrnDpnYciv+ZXGQeMUcETbDhco3OpIev+FB5IRpbRTmCxXbyEZtIIiXT ZTYg== 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=OexT5GUdk9/k63+TFjSDFqZd5G4ri4v1/+6Yn3zbi7LXduik4ETCG5OotRmXQtn0Pw QG7T7ICaP6uWiIJ5bUlMJF1j1LDEVhCqn1QPZuIVYtXAXgMFhlsfpAUy4qFWviODQY7B 00E3e6ODbFSmmj6zesZsspfWi5W4k0aYd5+cBNGuFBhDX1iEb7SgmftWo/relQoNRdYs aqkDjrB5Qv1yt2guMNBhsZ2AxUGxzLxDsRnaW7ILlKlrgPx+Ff1QZ13kggOIcbN+HtiF lQQamRd8ebpVhiN55UeqX/d4nNWCXJIEhHVkXsZxMgXmRuru2hMBnVn9pSZfFC6gK2iC mkhw==; dara=google.com 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-212616-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212616-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6b2a5a177c4si8112356d6.13.2024.06.12.23.19.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 23:19:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212616-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::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-212616-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212616-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 14FB61C21DD8 for ; Thu, 13 Jun 2024 06:19:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A2B2139D0E; Thu, 13 Jun 2024 06:18:34 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E06E139CEE; Thu, 13 Jun 2024 06:18:32 +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=1718259514; cv=none; b=rUPqlaS8G+9dcF7d+E7fCVAcuuc0xlhjf6NgZTbVj0iLZnZ22eYzIsn0OYR8H7kU87bIboFpvfpfCTG+jsu2gt7tt5mfukXruFLnMVVXbp7DfwTgmXbUb0nmVJ5UXaV3P/uXJohGhz7u6DGqm9OTHxQ+oszmjYYkaM21+uq8Ybw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718259514; c=relaxed/simple; bh=U6BxwWWsO2hrcxqX3UheDtH44VcZe/y/iBmW6rm7qVY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mEPrX+JOWW1M8t4gLt5bv8v0sBwusivrxvGRqqVjoDP50W5ve9QbWgF970fA4I1rGDkd3/NVaXW8eBz24izE4My4CXktqjYQn6Ed43XmZhzHHz992+y+jVjHxEfrp6nmn25rrV1cfTD078cFyNQLr+nveAFTYpzBlzHnh58i598= 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 936E11063; Wed, 12 Jun 2024 23:18:56 -0700 (PDT) Received: from a077893.arm.com (unknown [10.163.44.128]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 1CB1F3F5A1; Wed, 12 Jun 2024 23:18:25 -0700 (PDT) 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 V18 7/9] perf: test: Speed up running brstack test on an Arm model Date: Thu, 13 Jun 2024 11:47:29 +0530 Message-Id: <20240613061731.3109448-8-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240613061731.3109448-1-anshuman.khandual@arm.com> References: <20240613061731.3109448-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