Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp439997lqp; Thu, 4 Apr 2024 19:49:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1LOOAEtPONjK1TKI+WXftSYZmOulpqJWGIaWTvEDG/zbD9mrxc0L929mzhAeoWnfCE+J5G4FUKP8ooOm6TRYHxZ6BMz5sVEO56UZDcA== X-Google-Smtp-Source: AGHT+IHJrad2llB3PeE+BuO/7//mKxhlodPoBFL538AKiv2LB85LA1lvvSzKQMjjuuVEkKQwaf3w X-Received: by 2002:a17:902:f395:b0:1de:fe74:af6b with SMTP id f21-20020a170902f39500b001defe74af6bmr147108ple.46.1712285368770; Thu, 04 Apr 2024 19:49:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712285368; cv=pass; d=google.com; s=arc-20160816; b=fnWYO4ILJR++0ipsnjuy4sWkOrzc2garHbmcSxQ3ocNTw229EjOE+YZu2hyZccXf4u f6rGrhfJHKQNd6W4b51odgd54hIfUvFNq1IYNaTSaINZulmFFhi5t3isMCYIbmwndfDs BY4rr6+hJKiPPu3Y0ZMl/X9JIQW266CEVe7v7nKn6J2WeW9MkaZhSDri5boKUFdFfD/K CmN8Ft+APKAdu1vQF3uGYG3n3O6cVxp/5rL8RmlpMDFwRfaxba6DSIFTglkji7Qm27k8 bvKIOh6n44PWbnNJ1ODTPsBtKauI0qrgQ9UeUkhFKw50kYBnegAK28Wr+LOyi74G1WGZ +UqQ== 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=V/gN3bJsz3UIkhTr4QF0YB2FCj9CNs7+sn26faZgNDdTjXjlLvDAFFwRpstpr7suTi 6EC7/llWuelt99x7FLxp5JrsErC/Po+sehdJdycTEjrQpRJGut6FQE3ro+llBxSTrra5 ieRHOcQpc5lTMYIID/A8XTsbo6pMTllllVII/OWTZozGFppOUQwukOu9zFZpz6QYwYbh rekgSL10QasVOMKuAGIY6KSMM8XTsoJQ+uHkugkKPsa43ydqqW7AKWOZptlO44+lfT14 LayXIF0oc6RP8ySaiy3NiFceyrywTitpR/dqDuNo/yYERzkyVFobgRwZC8nKv+pE0JPb 94FQ==; 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-132345-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132345-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. [139.178.88.99]) by mx.google.com with ESMTPS id p15-20020a170902780f00b001dda34be362si503908pll.11.2024.04.04.19.49.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 19:49:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132345-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-132345-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132345-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 D141A2819D3 for ; Fri, 5 Apr 2024 02:49:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B07DC1CFBC; Fri, 5 Apr 2024 02:47:40 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C142728DAB; Fri, 5 Apr 2024 02:47:38 +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=1712285260; cv=none; b=lT1NUehdrAie58RPbA2XNB2q68z413BrkgYRYL66w10i5SxJnkc4XFKGhOcXk7Vxk9BkAl36RYHD0sztbwevBXToYPFZGJ0pJUTrNtncrbBZSWspKyDTEi1OOp2wvamvOBtmEDKVOlzTiIi2ZSsdW7DrR1sm2l+ymBGWagzhTuk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712285260; c=relaxed/simple; bh=U6BxwWWsO2hrcxqX3UheDtH44VcZe/y/iBmW6rm7qVY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=twji0tWqxM82KXW+Qqdj+c2c8JyKPFaBjv6TCqWR11FfghcA2ig2TvjJI5ywxzWAUqGI8NJCxe2/RRtM6mPcRRAXMQ3F8Jux0XtiYSRhsX2Z1UT8H1bXVLr4yczR8OMtrPj8/uKzdPitXLi5+cWV65dN4SEsTODyoqcw7dJV9fI= 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 A9C241515; Thu, 4 Apr 2024 19:48:08 -0700 (PDT) Received: from a077893.blr.arm.com (a077893.blr.arm.com [10.162.41.6]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 342203F766; Thu, 4 Apr 2024 19:47:32 -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 V17 7/9] perf: test: Speed up running brstack test on an Arm model Date: Fri, 5 Apr 2024 08:16:37 +0530 Message-Id: <20240405024639.1179064-8-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240405024639.1179064-1-anshuman.khandual@arm.com> References: <20240405024639.1179064-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