[6/8] perf tests: Skip branch stack sampling test if brstack_bench symbol is missing
Message ID | 20231123075848.9652-7-adrian.hunter@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp284469vqx; Thu, 23 Nov 2023 00:00:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHw8NSNBl8FJ+K+BZCctK4jM+UdwcCAKrGpMUcQxZ3t0hxt28B/qlID6afE8Z+TmIdsPXaO X-Received: by 2002:a17:902:d2cd:b0:1cf:5362:7e79 with SMTP id n13-20020a170902d2cd00b001cf53627e79mr5292337plc.20.1700726402426; Thu, 23 Nov 2023 00:00:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700726402; cv=none; d=google.com; s=arc-20160816; b=ulume2B8DPdXPzLkFTL0+V9pBe5D05XZ8HV8I88Ylaj2V0qeFc/NfusYN1208GdifU g1sByPn8UpaazarjKlaKu7lIXNJwbmDu85yUApfHy9X7MnnAx0Web9KvW73SmBbmO6v+ NYbqCqBoxWl6gXCMXkJmi7ZZM4NRfNIRDP5pKOyZg+I+9mJUW+FWC8m7YyoGGPQlS76A 7BkXJoElc7lZS0Z0dHKGaUfA8gl3pfPyjWWx5V+5qcXX5usplWUx19vsm95J+idpB38O qkJTPYK/ieTrizRyWXeif74i1Mk2Qp05z3bRTiuWUuLhkza0PKVP0zc3mpM/iVgCQrQG hB6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:organization :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eXKp1krEPP5WTyeDHABFK4oUvujIqn7bzlicTCPej3M=; fh=TPQr4nff5QO7OKSg4AL08iZb9B1RwOBx3bV3jWC0cDE=; b=nYw6aqBktLbW5JfsL2Nd/uERasUPc3k21TXVCiA0Vk+Sp+eB3fesay/yU24BWw7/+5 JqNmFyDwa/+BTY/9rgr9TC/X59SCycTzEuivC0tr2z1UjlYB+eJiBXguiCUYsDT7cZc7 tE8qbH3hy/D2lp5F3Ld4H5zsqbTNqBPl2hnjfublJFZr6WgZKm8mkNzRo64Rb9Zav1tj RtKxBLUktsBUDmugYHiGXhJTctrHH7LDvFX3jTDXOK2ltZsWbzkDrHL2HJkvh0Y5C5jE CNeCGc28sWs2gF7aIDvcJQ0WuJ3RRdYJJn/+PHURSMHSOQZX2Q9llJwDQIQt/82DLBmR AGIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CSZb5yyL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id jj14-20020a170903048e00b001bf1d1d99b0si653879plb.568.2023.11.23.00.00.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 00:00:02 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=CSZb5yyL; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id BEE528079B69; Wed, 22 Nov 2023 23:59:58 -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 S235039AbjKWH7p (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Thu, 23 Nov 2023 02:59:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344904AbjKWH7Z (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 23 Nov 2023 02:59:25 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E42B41BE; Wed, 22 Nov 2023 23:59:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700726371; x=1732262371; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2OpMiIHy1rwUwpgqeA63R+mAPX/eG5N2QSzht7697gg=; b=CSZb5yyLbbFNKuYDXGmk/iKBNU7mvcebIbwWwmRP14C0pJ4sfJHwDu4y WcCzpO9GTuWtYO1AHFXnrS7KqDiiQ1cuXRExnn4KG4S36WwHDT5eoaLRC fmL8pzGImZn9J+efl8TN2lW78f5lJA52F+LW7E+ZoIPr0srKrP5jBrv2C Z06+TJBlAyxyydZ9LmzOTyHDiEIgwDPXRbpqPoOuC67ulVSbHWn1yxsrT 3xbCUgkIsQT/ZEVyBl61kA3GXsLtNHnlKVAxgUYSTNi1RuqILsGzSMMw8 QdHb3LTrBqh9EfWprlDuwn3vLJVWxxsSVTw12enzCxdAOxEUmI0sdRTIZ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="396126434" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="396126434" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 23:59:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="8764990" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.252.41.107]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 23:59:20 -0800 From: Adrian Hunter <adrian.hunter@intel.com> To: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Ian Rogers <irogers@google.com>, James Clark <james.clark@arm.com>, German Gomez <german.gomez@arm.com>, Leo Yan <leo.yan@linaro.org>, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH 6/8] perf tests: Skip branch stack sampling test if brstack_bench symbol is missing Date: Thu, 23 Nov 2023 09:58:46 +0200 Message-Id: <20231123075848.9652-7-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231123075848.9652-1-adrian.hunter@intel.com> References: <20231123075848.9652-1-adrian.hunter@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> 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]); Wed, 22 Nov 2023 23:59:58 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783340887981614033 X-GMAIL-MSGID: 1783340887981614033 |
Series |
perf tests: Reduce inexplicable test failures
|
|
Commit Message
Adrian Hunter
Nov. 23, 2023, 7:58 a.m. UTC
The test "Check branch stack sampling" depends on finding symbol
brstack_bench (and several others) in perf, and fails if perf has been
stripped and no debug object is available. In that case, skip the test
instead.
Example:
Before:
$ strip tools/perf/perf
$ tools/perf/perf buildid-cache -p `realpath tools/perf/perf`
$ tools/perf/perf test -v 'branch stack sampling'
112: Check branch stack sampling :
--- start ---
test child forked, pid 123741
Testing user branch stack sampling
+ grep -E -m1 ^brstack_bench\+[^ ]*/brstack_foo\+[^ ]*/IND_CALL/.*$ /tmp/__perf_test.program.5Dz1U/perf.script
+ cleanup
+ rm -rf /tmp/__perf_test.program.5Dz1U
test child finished with -1
---- end ----
Check branch stack sampling: FAILED!
After:
$ tools/perf/perf test -v 'branch stack sampling'
112: Check branch stack sampling :
--- start ---
test child forked, pid 125157
perf does not have symbol 'brstack_bench'
perf is missing symbols - skipping test
test child finished with -2
---- end ----
Check branch stack sampling: Skip
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
tools/perf/tests/shell/test_brstack.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/perf/tests/shell/test_brstack.sh b/tools/perf/tests/shell/test_brstack.sh index 09908d71c994..5f14d0cb013f 100755 --- a/tools/perf/tests/shell/test_brstack.sh +++ b/tools/perf/tests/shell/test_brstack.sh @@ -4,6 +4,10 @@ # SPDX-License-Identifier: GPL-2.0 # German Gomez <german.gomez@arm.com>, 2022 +shelldir=$(dirname "$0") +# shellcheck source=lib/perf_has_symbol.sh +. "${shelldir}"/lib/perf_has_symbol.sh + # skip the test if the hardware doesn't support branch stack sampling # and if the architecture doesn't support filter types: any,save_type,u if ! perf record -o- --no-buildid --branch-filter any,save_type,u -- true > /dev/null 2>&1 ; then @@ -11,6 +15,8 @@ if ! perf record -o- --no-buildid --branch-filter any,save_type,u -- true > /dev exit 2 fi +skip_test_missing_symbol brstack_bench + TMPDIR=$(mktemp -d /tmp/__perf_test.program.XXXXX) TESTPROG="perf test -w brstack"