Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp172030rdh; Thu, 23 Nov 2023 00:00:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfq5rkrbuK+SX2jD2I0Y6zAdMXpvWde4TDWyquXu4TsmJJWR52E5WCVKxXy+D3Y2JLwtXx X-Received: by 2002:a17:90b:1c81:b0:283:2c19:c9bb with SMTP id oo1-20020a17090b1c8100b002832c19c9bbmr5264643pjb.13.1700726422754; Thu, 23 Nov 2023 00:00:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700726422; cv=none; d=google.com; s=arc-20160816; b=r42aqKxVsEM9DA/30WODO3YMBVtS4mKm6vMsjbCJXqwBLIwXUuPUVYzka01GJnjM2D iEz+zld44tohoFDZdSR3+RYs5EKHCFgReFroi4NNVc3uuysd5PgfG2n7m3/yYwlAv3ub LnhPKqp0VfEa3wxjUMsrjIdVlaPRmpFNy8E+v1BoINM0qldCg3qowFacHgDi7Q+R5ThH qz3T6eAEy+V3tZH9FkTWSC5O0NB77O9UK2Xvh0VgTnvDJHnHu2H6VlbUhXjTApi3bJXa OJjt/G+mwB1rG0mhS9KWfd6fiT9PYa2CLA6rtfAf2r5BVfklgGne6if3ZJrKmAAfI+3c ua/Q== 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 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id bb5-20020a17090b008500b0028571ddddfasi127527pjb.146.2023.11.23.00.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 00:00:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; 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 23.128.96.31 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 318A5807E464; Thu, 23 Nov 2023 00:00:06 -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 + 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 ); 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 To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Namhyung Kim , Ian Rogers , James Clark , German Gomez , Leo Yan , 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: 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, 23 Nov 2023 00:00:08 -0800 (PST) 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 --- 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 , 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" -- 2.34.1