From patchwork Thu Nov 23 07:58:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 168760 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp284339vqx; Wed, 22 Nov 2023 23:59:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHESSGUu5SjBiX1Unnao+z+ZN/ZbSUyEtG1a/fZen/RFYO9J0fGPT3tUWbJMpx83T7bruFa X-Received: by 2002:a05:6358:91aa:b0:16d:e923:573 with SMTP id j42-20020a05635891aa00b0016de9230573mr5419424rwa.15.1700726376984; Wed, 22 Nov 2023 23:59:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700726376; cv=none; d=google.com; s=arc-20160816; b=qXMx/F9IH35gLH3su3B43rtMk4gpourBT9lKJ19pmLDZivuF0o0xlHV08JVY+uzyWl UB66rSzKUy04WzhqK1Ehj/htMYpX9JeqjcMtEGM0v95DeJrP4HVcGmTvFvopfhSQPgI4 caWhjaCdvfQheX7SCDnjV2+jmJxIrhDjTnGJh/LwlIVvT2cGTFuZyI+zGZVyVIo8qpgl i4BWaroA/a4xyXdFbkjDYOTp0a8MPOwXuo9RujgWuOh+UhA3yrtbj9BMuN/tOpCXSgWb g7iDT+ASWnw5tAdJUd72iHNY2XyTUuVczIsJzzcnwy0Qgy/MZACt/xUqEHbHNXMwLvQD G5Lg== 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=oJvEwBeE2TBwAQwR8AmZBTZn8wFoRGiSQ1lwRgxSLaw=; fh=TPQr4nff5QO7OKSg4AL08iZb9B1RwOBx3bV3jWC0cDE=; b=Aa4g6t1h2Cb8Q8V6OJAHxHVxJz96FpO6/xrHmDvAlS0v6YXXKbcrVbB/d1tz601uKX jNRa2QlE20KY/oAe/aD7r62eoxVBcNQBReviVM8ikxkIxBKyhkyJgb6NPf68xTPJ6rro 0b0sfWBAh8HZlKrbruMklMxqp5yxpwImN5E2ho16qulQ1YmKjantY54ZMA08gppAgA+/ lqYmoRxtq93VblR6PNcaz15E9JidWaygbxp39KlSvqnuhvEBVf2CsOnidDBMwUZLDj+1 EPWRwWARtgD1sBGuaZW2wiqXHaDcRDAakCq3hNw3CCgy+bsw3JY6ryIsBBw8Dy+rmm3y 30Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="DfG/7v0L"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id g9-20020a632009000000b005c203ad0d45si800101pgg.821.2023.11.22.23.59.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 23:59:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="DfG/7v0L"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 6C8B9826CB60; Wed, 22 Nov 2023 23:59:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234607AbjKWH7Y (ORCPT + 99 others); Thu, 23 Nov 2023 02:59:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbjKWH7X (ORCPT ); Thu, 23 Nov 2023 02:59:23 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AEB0E7; Wed, 22 Nov 2023 23:59:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700726369; x=1732262369; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QAnIkSe8vCJEmntCGcCtC+pX9E9tP0IPB7jfTlctgwE=; b=DfG/7v0LOOL2NTc0v7h4tgHZiVaIbUEICzprqVoDw04Ic9Ydaiy95lLv LUxunpxb1lz4sXo0zZyV5w5UpDUyzP+46+bumYDn5fUHwwrG9l+U55upP LvFu7KTN0WilgYUx0XyPfE5QIi//wbl5xDHb5DpC+55JM9Zst/G5y6o2E aNpAu5COWknkvOCrL1XiuWqZ5vJwDeSga+MbjpfhoB7FXZLfa9cQ3vJnO OdcLAMiqGYai1EL8IO+xEnkhjFyw9BiflHzpE3RpgyVHtZLwseBUFyJFf UM7jE+5ACh/DDpCvBvKq6kEjt1Nmz8FpynE0iJAMppDASnrs5HxjHw5zW w==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="396126398" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="396126398" 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:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="8764979" 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:06 -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 1/8] perf header: Fix segfault on build_mem_topology() error path Date: Thu, 23 Nov 2023 09:58:41 +0200 Message-Id: <20231123075848.9652-2-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 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 22 Nov 2023 23:59:33 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783340861051821966 X-GMAIL-MSGID: 1783340861051821966 Do not increase the node count unless a node has been successfully read, because it can lead to a segfault if an error occurs. For example, if perf exceeds the open file limit in memory_node__read(), which, on a test system, could be made to happen by setting the file limit to exactly 32: Before: $ ulimit -n 32 $ perf mem record --all-user -- sleep 1 [ perf record: Woken up 1 times to write data ] failed: can't open memory sysfs data perf: Segmentation fault Obtained 14 stack frames. perf(sighandler_dump_stack+0x48) [0x55f4b1f59558] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f4ba1c42520] /lib/x86_64-linux-gnu/libc.so.6(free+0x1e) [0x7f4ba1ca53fe] perf(+0x178ff4) [0x55f4b1f48ff4] perf(+0x179a70) [0x55f4b1f49a70] perf(+0x17ef5d) [0x55f4b1f4ef5d] perf(+0x85c0b) [0x55f4b1e55c0b] perf(cmd_record+0xe1d) [0x55f4b1e5920d] perf(cmd_mem+0xc96) [0x55f4b1e80e56] perf(+0x130460) [0x55f4b1f00460] perf(main+0x689) [0x55f4b1e427d9] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f4ba1c29d90] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f4ba1c29e40] perf(_start+0x25) [0x55f4b1e42a25] Segmentation fault (core dumped) $ After: $ ulimit -n 32 $ perf mem record --all-user -- sleep 1 [ perf record: Woken up 1 times to write data ] failed: can't open memory sysfs data [ perf record: Captured and wrote 0.005 MB perf.data (11 samples) ] $ Fixes: f8e502b9d1b3 ("perf header: Ensure bitmaps are freed") Signed-off-by: Adrian Hunter --- tools/perf/util/header.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 1c687b5789c0..08cc2febabde 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -1444,7 +1444,9 @@ static int build_mem_topology(struct memory_node **nodesp, u64 *cntp) nodes = new_nodes; size += 4; } - ret = memory_node__read(&nodes[cnt++], idx); + ret = memory_node__read(&nodes[cnt], idx); + if (!ret) + cnt += 1; } out: closedir(dir); From patchwork Thu Nov 23 07:58:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 168761 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp284418vqx; Wed, 22 Nov 2023 23:59:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IFvUFElA/AQfuEWLHe980hzXTONh9nG3RqqdzRFHQxIM7h2h4fIix3m7Ut4296Reyj+2v78 X-Received: by 2002:a9d:6d05:0:b0:6af:95f9:7adc with SMTP id o5-20020a9d6d05000000b006af95f97adcmr5354049otp.14.1700726393965; Wed, 22 Nov 2023 23:59:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700726393; cv=none; d=google.com; s=arc-20160816; b=n73zFRYGMLRJdRXR3lVQVqXLFY76Y7UnxY4PFAjOkjTVn/Je1SZbANEWa5Y1Ft0EUI gQlJiKa3/gkGOXVT667LDyQDNrvD4vkz3LoLE0oN+vbZQroUHQu1e5Jwg9w4kwf3GOSs 2YoSuNSBLdbFHAFU1N1u3c+4RkKzKjtXUVoIwHnk4iD5+MreNNVv9ZF91WM7CcCs/a+r qM4wvSzOBPm4Fj7oAmvjAjmkYLVwmicgpPg3FdAurSjZqtND3Tg79wS/CFL+Dy+rgUnt AzkGu2LjTQEd0MhyGru/KmntlJ9su6b358CwU2R8T3+BRyyFuIzpyF3MNAoKZJ3sBU91 2sxw== 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=YV1qYiFLYqTL4QTLInIyBkyIAmebYkYw8sO4GZKqhs8=; fh=TPQr4nff5QO7OKSg4AL08iZb9B1RwOBx3bV3jWC0cDE=; b=kdjw5jKkHMngciPBJNOwPQJJGQsGNSoLvPGWmr1jGCTe5XnuKB/tY2Yt75W5G/RT+F /1csoJQW/mP29l0tHkRhF/HMSG8tVYI1glHAM+MqiaaZCBc94RTxTbKKvOhz6RHfI03f ImrO+esCh6jbiwQN4p6jAaXzkqtnkR4NhIlOHR9AoLbYfA0Uo7K+8zZULrM4dRMkmLjV ztrczQK9ayQV8h/a5bNAiHCboaTiDmTTtXq8TGoAxiAhI0Qwy+9SlEg+5IEecxCJWznq XWNzKZARsxOXnAEALxs8IM/PnSt9Xb1nkzUpdrLar3rMDsa3JIjo8u2DacnffR8LMTMh M0xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K9oRkGKn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id 143-20020a630195000000b005b881cc9498si832498pgb.339.2023.11.22.23.59.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 23:59:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=K9oRkGKn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 40E7381EE2CB; Wed, 22 Nov 2023 23:59:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234981AbjKWH7a (ORCPT + 99 others); Thu, 23 Nov 2023 02:59:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233940AbjKWH7Y (ORCPT ); Thu, 23 Nov 2023 02:59:24 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9EB5DD; Wed, 22 Nov 2023 23:59:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700726370; x=1732262370; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kUUFMnMOTmqXLUn2vId7q0QVssfMrP3gOX/sAt3Ulg0=; b=K9oRkGKnWGnRD3VVQBccxpNVBHIBEFDV7gSazu/dRLskV58/MNu/Hvhx zYpnnwqhTl6zLIvu5dbrtbquLNTpKpEG2dTMn+Sxc27dmu29+t2l/QyBP vFoj6fM5iQcxvDwQbHB7Z+3VVYZY5sVnyvA/EhG5+jjdHZu4JFnyYEGnO NdiJyZBBd7Uo7Up0UmOQSWRPqrn/Y7Zd8pD8zjwvpYNZrVWRm4roZq40f ZRquMC7tarPubZvTHs96CFrl9wh5ZKJk56xIrSIQ3nEYbSxyMiDveS//8 L+EkSLr8DH3XT8VrN0IwqcUtJBkzKn3EBJL0ozG93a7gD8LWwFNoBISg1 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="396126413" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="396126413" 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="8764981" 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:09 -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 2/8] perf tests lib: Add perf_has_symbol.sh Date: Thu, 23 Nov 2023 09:58:42 +0200 Message-Id: <20231123075848.9652-3-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 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 22 Nov 2023 23:59:44 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783340879330504134 X-GMAIL-MSGID: 1783340879330504134 Some shell tests depend on finding symbols for perf itself, and fail if perf has been stripped and no debug object is available. Add helper functions to check if perf has a needed symbol. This is preparation for amending the tests themselves to be skipped if a needed symbol is not found. The functions make use of the "Symbols" test which reads and checks symbols from a dso, perf itself by default. Note the "Symbols" test will find symbols using the same method as other perf tests, including, for example, looking in the buildid cache. An alternative would be to prevent the needed symbols from being stripped, which seems to work with gcc's externally_visible attribute, but that attribute is not supported by clang. Another alternative would be to use option -Wl,-E (which is already used when perf is built with perl support) which causes the linker to add all (global) symbols to the dynamic symbol table. Then the required symbols need only be made global in scope to avoid being strippable. However that goes beyond what is needed. Signed-off-by: Adrian Hunter --- tools/perf/tests/shell/lib/perf_has_symbol.sh | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tools/perf/tests/shell/lib/perf_has_symbol.sh diff --git a/tools/perf/tests/shell/lib/perf_has_symbol.sh b/tools/perf/tests/shell/lib/perf_has_symbol.sh new file mode 100644 index 000000000000..5d59c32ae3e7 --- /dev/null +++ b/tools/perf/tests/shell/lib/perf_has_symbol.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 + +perf_has_symbol() +{ + if perf test -vv "Symbols" 2>&1 | grep "[[:space:]]$1$"; then + echo "perf does have symbol '$1'" + return 0 + fi + echo "perf does not have symbol '$1'" + return 1 +} + +skip_test_missing_symbol() +{ + if ! perf_has_symbol "$1" ; then + echo "perf is missing symbols - skipping test" + exit 2 + fi + return 0 +} From patchwork Thu Nov 23 07:58:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 168769 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp286342vqx; Thu, 23 Nov 2023 00:02:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFnISpwkG3LZUcLtazF1xwGU9J7RiP9ONLBTBt9YflY1KAlRCrTtNGChelzPT4SsZSYFTwP X-Received: by 2002:a05:6a20:42a4:b0:18a:d5a6:ef01 with SMTP id o36-20020a056a2042a400b0018ad5a6ef01mr2689703pzj.20.1700726566293; Thu, 23 Nov 2023 00:02:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700726566; cv=none; d=google.com; s=arc-20160816; b=vBbFhE0ZhJIi03vyPb2Son4edttlT/9oO5cUpyho/Df+XcPHYBinEC5E4GgQxK4TXt qKaBVfa4Huf0kLYdUnHWLufkmOG5kx/ktW7exB7ecKkqoYm4QylhPM3w4vMyHNWcLhH0 bg+eHjHBFZy1JvLkj54wM2g9+Vt3yEZAy8SnZ+nsmxBphoF3ZPJGG/bdQnff0Xw1mgpR dOx4fNG3zfUMq7/DI70LXIgabBVReV8INL/5jv6C6UHGfVQbD4/sMJgQUWXQXeml5BoB Qzn9AZghQCfkg+f/A4idSupZ26NZEtfUhkjz4O4Ef+MgozsmMAsctLzFgjvAfQYsUGEg FQxQ== 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=vBa2/HGdh85N9TZifW3P5OEtKiycFqOTEXumW1wXnYc=; fh=TPQr4nff5QO7OKSg4AL08iZb9B1RwOBx3bV3jWC0cDE=; b=fDDJS2We4O1ITCFMwqnTW4CL9Ivz39+oIYf55D/pMiWr82YuZQKWNfBJQki74OFotI lXju05/D0lvAdZNcmmSRbNeHDuRruqMhbZ08cMk21YMwYRilbvjmFIn95MS/HaDDp60t EACYaQ8F5kvtYvfuPAThRDcMEfJeV82PgigPjOXDRVa3EQhtd+W37kh9y6GazpUGxaXM eFzVEvzxBkQ0KiBnq4S5vBhTbgTLiQaV4vXlKf9Xb6SGx+fsCbZ0/ZEEYJ5gUA0XZ/Qa HgEWppLNYx6ZotvoNYGdhyW+wfSKC+erjkupo9AHl5jjJkN7h+Bvs6P7yRWF/9WSw1/4 Xzvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="YE3/DL8f"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id s17-20020a635251000000b005bd85b32495si844120pgl.685.2023.11.23.00.02.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 00:02:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="YE3/DL8f"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 30F5E8070713; Thu, 23 Nov 2023 00:00:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235027AbjKWH7i (ORCPT + 99 others); Thu, 23 Nov 2023 02:59:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234509AbjKWH7Y (ORCPT ); Thu, 23 Nov 2023 02:59:24 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12E9B1B3; 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=nk3gCy6p2GL7PvwIZ2K6eYMQde7iUIS5gU74LC1oz/E=; b=YE3/DL8f4MkfppPNYFWCg3tS1Vbf4/cYmAHuV/acTtsthUhh2uOn8cr7 3u6vWLQ3qS97VPkUpuc08I/9fZP0qsBQ94gM9qy3oGFnEBPe3lgIbSLBd si70Vmdo3/AhqimHPx4uOZq600cwKEJl3gtj0yMaq06fgACDO7SwEe35U P1WzkCWQUVdcjieGVmN8WL+uLj4/K1yGsj/Ffj6uSlajZw/7Tw9n57rmR pIHuLUMFtUdvL/NkwP0gDccIN3vmqPg1Tzc1VoC1q3H4aPeXkl2uKyME8 eLLVKJUYtrUGarTV+OXHqaylu0acOWKTr+DZt3jHfoORtRfD47LMR0lTB A==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="396126427" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="396126427" 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="8764987" 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:11 -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 3/8] perf tests: Skip pipe test if noploop symbol is missing Date: Thu, 23 Nov 2023 09:58:43 +0200 Message-Id: <20231123075848.9652-4-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 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 23 Nov 2023 00:00:27 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783341060073365452 X-GMAIL-MSGID: 1783341060073365452 perf pipe recording and injection test depends on finding symbol noploop 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 pipe 86: perf pipe recording and injection test : --- start --- test child forked, pid 47734 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] 47741 47741 -1 |perf [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.000 MB - ] cannot find noploop function in pipe #1 test child finished with -1 ---- end ---- perf pipe recording and injection test: FAILED! After: $ tools/perf/perf test -v pipe 86: perf pipe recording and injection test : --- start --- test child forked, pid 48996 perf does not have symbol 'noploop' perf is missing symbols - skipping test test child finished with -2 ---- end ---- perf pipe recording and injection test: Skip Signed-off-by: Adrian Hunter --- tools/perf/tests/shell/pipe_test.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/shell/pipe_test.sh b/tools/perf/tests/shell/pipe_test.sh index 8dd115dd35a7..a78d35d2cff0 100755 --- a/tools/perf/tests/shell/pipe_test.sh +++ b/tools/perf/tests/shell/pipe_test.sh @@ -2,10 +2,17 @@ # perf pipe recording and injection test # SPDX-License-Identifier: GPL-2.0 +shelldir=$(dirname "$0") +# shellcheck source=lib/perf_has_symbol.sh +. "${shelldir}"/lib/perf_has_symbol.sh + +sym="noploop" + +skip_test_missing_symbol ${sym} + data=$(mktemp /tmp/perf.data.XXXXXX) prog="perf test -w noploop" task="perf" -sym="noploop" if ! perf record -e task-clock:u -o - ${prog} | perf report -i - --task | grep ${task}; then echo "cannot find the test file in the perf report" From patchwork Thu Nov 23 07:58:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 168764 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp284488vqx; Thu, 23 Nov 2023 00:00:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IEv4RdIhIBTKegLIa9RiUJSLSuzv0ypBfmnPhLBGzTinAa8RXyz2A0qPMzO+8zWryjcAviC X-Received: by 2002:a05:6808:1408:b0:3b8:4aad:7385 with SMTP id w8-20020a056808140800b003b84aad7385mr1560950oiv.11.1700726404264; Thu, 23 Nov 2023 00:00:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700726404; cv=none; d=google.com; s=arc-20160816; b=fd+roJMesWFV5Vy+coxTrl4F7hD5sIN7rO3ml8jsDdGhIQ312ZDUlVR0fG2TWSLfi/ 2aC7D813fruqC9q6e8sZVAqTMK3ZM+kg3aqvKRSXi5RUoVal4IVQmQHlpqKAiIgulbtE jKNHJ9kCmVIEKtHg+oPJSuSwaYyKG3vYlD5iojG74FIjYvHRw57gaRxFcMhBYCZAOso3 8AkBH8NYE5y7ZgASBTU+YJ9ePLv0wo0Ry+vK47nqMA6YwE9kmtsgMJCHuDcZASOEqfxO A73xKRxkF0G7oOBVop8LJmWHh1wpm/OiHJqklJBvGsRozFcfulTo13QQExNFpti8xEdO zbWA== 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=jinkRwYWrFIsJoTcJhsheCXZn9BXIqtOd/AfWZSa3qo=; fh=TPQr4nff5QO7OKSg4AL08iZb9B1RwOBx3bV3jWC0cDE=; b=Q0iHFeDmsVhdlq91AI+BI1w7GqCCrUnqBPY78i9QnverxaB2RKNgKRvwMdVeb9biOU eVOY3LQOZRP/U7I3bc5J7eMtHEVIKDngy6MUHnyc1bHE2dgCyRCnjkJbxFidCeqIdPpH rlCR/KYlQvTDBg5XLB+v8fjKDkM96LLtGTHdyn1wCZlfdyKyJVQmESyJPy+3YKWLS0BD eYrzbhmyZDIx5B1KVL+Atar4Jo8A6PV1BaAltRUiUZxhEpfAHqmnbxeHrU/poIoVEwQz FyjbBL2cmgeKfjU1atXsu4JoHg0R2tdv/Qx0pE6A61hl+vwGAW07M1vXIjiZVJTefHul unlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="L/HBexlh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id v6-20020a626106000000b006cbe41f2c1fsi742178pfb.398.2023.11.23.00.00.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 00:00:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="L/HBexlh"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 45ADD8289527; Thu, 23 Nov 2023 00:00:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344917AbjKWH7d (ORCPT + 99 others); Thu, 23 Nov 2023 02:59:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234566AbjKWH7Y (ORCPT ); Thu, 23 Nov 2023 02:59:24 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 407771B2; 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=7da/0iEnQCMxy/lLCWXMFnGwlTG2TiSr880zeoxTvII=; b=L/HBexlhTOpnqTb9b5I3EvqTLF7hGl6h3DFzVNB703C+2Liq2imeKXRM lSqL72jwiYAi5huJAXM0L7SI8jWQt9JmVPA53fxB0rGt75d69ZlwGaTSs sfCmo47qEHy5TZxmhoX9S2h9lV7ZUApH0WuheRfOyMHUFgXpiy9GoM1cz Rx0gaZTFl7Qa7y17OI+igJJGhrDjHNPIbuWTtZfYwjetL+2U3NFQpOjxb UOzhTRFKCA3qaE8XzCmybnchcUMmY8Jmpns23gO5A7YYVbyvQMAZNHtaA U1x6pLMAk0G6771b5ElB8fJEahbI8yNaENU2FfQjXfODD6S36n61Avn65 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="396126425" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="396126425" 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="8764988" 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:14 -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 4/8] perf tests: Skip record test if test_loop symbol is missing Date: Thu, 23 Nov 2023 09:58:44 +0200 Message-Id: <20231123075848.9652-5-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 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 23 Nov 2023 00:00:00 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783340889918779649 X-GMAIL-MSGID: 1783340889918779649 perf record test depends on finding symbol test_loop in perf, and fails if perf has been stripped and no debug object is available. In that case, skip the test instead. Example: Note, building with perl support adds option -Wl,-E which causes the linker to add all (global) symbols to the dynamic symbol table. So the test_loop symbol, being global, does not get stripped unless NO_LIBPERL=1 Before: $ make NO_LIBPERL=1 -C tools/perf >/dev/null 2>&1 $ strip tools/perf/perf $ tools/perf/perf buildid-cache -p `realpath tools/perf/perf` $ tools/perf/perf test -v 'record tests' 91: perf record tests : --- start --- test child forked, pid 118750 Basic --per-thread mode test Per-thread record [Failed missing output] Register capture test Register capture test [Success] Basic --system-wide mode test System-wide record [Skipped not supported] Basic target workload test Workload record [Failed missing output] test child finished with -1 ---- end ---- perf record tests: FAILED! After: $ tools/perf/perf test -v 'record tests' 91: perf record tests : --- start --- test child forked, pid 120025 perf does not have symbol 'test_loop' perf is missing symbols - skipping test test child finished with -2 ---- end ---- perf record tests: Skip Signed-off-by: Adrian Hunter --- tools/perf/tests/shell/record.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh index 29443b8e8876..1838b76e2282 100755 --- a/tools/perf/tests/shell/record.sh +++ b/tools/perf/tests/shell/record.sh @@ -8,10 +8,16 @@ shelldir=$(dirname "$0") # shellcheck source=lib/waiting.sh . "${shelldir}"/lib/waiting.sh +# shellcheck source=lib/perf_has_symbol.sh +. "${shelldir}"/lib/perf_has_symbol.sh + +testsym="test_loop" + +skip_test_missing_symbol ${testsym} + err=0 perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX) testprog="perf test -w thloop" -testsym="test_loop" cleanup() { rm -rf "${perfdata}" From patchwork Thu Nov 23 07:58:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 168762 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp284449vqx; Thu, 23 Nov 2023 00:00:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEKxFfT/PWPGzKVahw1MOfbrKVaambuqkQAIs/itB1M22KK4WZJTZYSPNts3Dt3YkvdSAMf X-Received: by 2002:a17:902:d4d1:b0:1cc:3825:7ba2 with SMTP id o17-20020a170902d4d100b001cc38257ba2mr5290870plg.4.1700726400052; Thu, 23 Nov 2023 00:00:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700726400; cv=none; d=google.com; s=arc-20160816; b=JgYJeEN0qBLhpGPGCj+EVCfUK+/Cxvlgr/KZgBMpnq/04ToU/eJDRLL01yaNxsMB3Y /UmSlgl5qa4OrOXsi4vJDGu190Ry4SoLlURFnhSGEbOIC2qkjbhh4TFY2kj6Mjt91rT1 RRMdE2ESKZ7lOOwiDE1mV+9J0VySYqm9xAvaVWMupMsm4Z/R8BAjXzNDkoU5q1PR4kAk 5KU/ZqsGZgZP8T6E8M83To5oTGYMZ3dHUv593wbKulL1KeHXAleWnpO6yIpLaARoFLGn 68x6xLiFyseeRH5lB74GmmNRegvGwWlgs7iTPL5A010sXY7dy8K2ZzOKRssI7YnXLn4u ROpg== 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=9XX2WQ5pztwkybvoywwUowQBNXQbQdpydreGMTgHvr4=; fh=TPQr4nff5QO7OKSg4AL08iZb9B1RwOBx3bV3jWC0cDE=; b=H2PaciZpeEQv/MaFhOyB/+nKaM5M5+nHlos6EYKk9OCinyvu0AYX0vJjZih+Lnhbb9 6TENKhN5UgZ8mq8C+ydS8qS1i54SOgP3xP9NmZ2RnPHuodzotzE5FADEuMhXe3ojjXgp /IpRKQ93i2EB9Cm7+HWCf8yLGl9sV1lq9bPjI23bGqEm0Tl+3XmvvzaA/FFHyfRILQhn tjeCRnIlk1vuSzoL0l+tmnvyVG8hfBBP6IX5ggW6iPobgjUZFi1oVz8fXiwXB081aaVv PNKCfyffHqXdEuBPYxsl0QixdestrsWLeV+rmD74Hy2cP/wXJcknWel4iZZyar/yeNMn GyJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=T2pKSbPb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id d13-20020a170903230d00b001cf638977f5si702273plh.373.2023.11.22.23.59.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 00:00:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=T2pKSbPb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 2BB2C807596D; Wed, 22 Nov 2023 23:59:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344911AbjKWH7m (ORCPT + 99 others); Thu, 23 Nov 2023 02:59:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344899AbjKWH7Z (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 9724D1B9; 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=G9oYg+Iq1Wk/nZE1kDxs2u68i2GAXss0BmqbCygDxi0=; b=T2pKSbPbcYycOK870hKqSrbLRh8Wpj64v5D42DkUM8qt0XQozSl+xp3R JezXtjtV6syf4C9uO7iNtpdasfeNr7mVQrKrCuc+jmR+m/Vvh1NuLt35y BnZrLFSz9ZLx3O8SdsXax5gtr6r6nJK7lr457KpbAncU7c/gCVEOekS5e 1hWL4QQr0JDkEvimntztVAn7pT+zt10LtiHz6lzUOjyi4sQNhTZQ3m4t7 xBS2tKJAeWGvbTBLHPMkyjXiNGWf3gfqpwkkykYWCUlgg51bc3070ijsT kZTpy3dGZMt1FFZVkTH40CQtII7wuoHd6BENjOVmlnfqC5hQxZoUYYQyG w==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="396126433" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="396126433" 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="8764989" 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:17 -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 5/8] perf tests: Skip Arm64 callgraphs test if leafloop symbol is missing Date: Thu, 23 Nov 2023 09:58:45 +0200 Message-Id: <20231123075848.9652-6-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 X-Spam-Status: No, score=-1.3 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Wed, 22 Nov 2023 23:59:55 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783340886088229050 X-GMAIL-MSGID: 1783340886088229050 The test "Check Arm64 callgraphs are complete in fp mode" depends on finding symbol leafloop in perf, and fails if perf has been stripped and no debug object is available. In that case, skip the test instead. Signed-off-by: Adrian Hunter --- tools/perf/tests/shell/test_arm_callgraph_fp.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/perf/tests/shell/test_arm_callgraph_fp.sh b/tools/perf/tests/shell/test_arm_callgraph_fp.sh index 66dfdfdad553..e342e6c8aa50 100755 --- a/tools/perf/tests/shell/test_arm_callgraph_fp.sh +++ b/tools/perf/tests/shell/test_arm_callgraph_fp.sh @@ -2,8 +2,14 @@ # Check Arm64 callgraphs are complete in fp mode # SPDX-License-Identifier: GPL-2.0 +shelldir=$(dirname "$0") +# shellcheck source=lib/perf_has_symbol.sh +. "${shelldir}"/lib/perf_has_symbol.sh + lscpu | grep -q "aarch64" || exit 2 +skip_test_missing_symbol leafloop + PERF_DATA=$(mktemp /tmp/__perf_test.perf.data.XXXXX) TEST_PROGRAM="perf test -w leafloop" From patchwork Thu Nov 23 07:58:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 168763 Return-Path: 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 + 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 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]); Wed, 22 Nov 2023 23:59:58 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783340887981614033 X-GMAIL-MSGID: 1783340887981614033 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" From patchwork Thu Nov 23 07:58:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 168766 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp284624vqx; Thu, 23 Nov 2023 00:00:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGuy6tG3o9ShZJO/l2P8kP9UdU6vYkggY2Ba1zS8vWJsn+/Kq5D1kJ3riLc/KGapCOdfO8C X-Received: by 2002:a05:6a20:5507:b0:187:f7d3:fe4 with SMTP id ko7-20020a056a20550700b00187f7d30fe4mr4145520pzb.11.1700726413376; Thu, 23 Nov 2023 00:00:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700726413; cv=none; d=google.com; s=arc-20160816; b=BNCHzq5pcKpQAKQqfyqSzJ/FX4hOaOAFInOsJNnN9CzQmcCxvIgHqqYL8l3ifR9Edl UaWKtFxmg0DqCx+JWZreLmHFEtmXdichDsZLO0JfVK4VIwQnmX4jAuGXDHyy0JymKTm5 cKaEC7pSULOWji8hvUGoys3T9Y5KmZTegZ/a9czcR+rbYNLYYbv6pIGBjuxddw2eEbqf wQEFNWoBHXY5Q5Inoxae7CLGPV/75mhJjhPbKIFkHG2BZMlCD5BdGSJKV8kreWeryuYf MVDE5ZwzagwD/rP/mS58SAq0VYysjdXlZXWXiv2iANmsywzqCn+RliAqafSIrgfOtA1J 1GVQ== 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=ofoKR+3BimQLxOyeBpVvcq83RHpCHaEJ5OxYbgNAK4E=; fh=TPQr4nff5QO7OKSg4AL08iZb9B1RwOBx3bV3jWC0cDE=; b=Y92IVWe+xol3eMj0N8fkuZ9wT1ppb69gC1IubkeSYOZZe6F41eo++uIafkw/cnkeYW KAJ6Mp1K5y38wzI2mQqICznlr5mHh3ZVlk4g3nzntQZm5QxDrJM2UpKmsVu1Acm1AGKC OBCOOelk/yf/irxln99X1XJ/qJ9nFdvtYuzj3+IlCcuJtW0ylab0LByzcuot/nbcT7qY BQGUq4HGDYDkofif71Yuoxrpt3MuxZFfQHSAxnCTrtRZNC3qa3wtiMYtiW35/pUZ26u8 Pw6wsc1YQD4fA7VSRlDuB5ZzRhNYpyfZXdlsjs5/RIxTMbdkoeYdb+dsWXgCNuAKQsAy XLIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=T+gUYuP3; 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 a9-20020a63d209000000b005b969c62b27si799781pgg.747.2023.11.23.00.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 00:00:13 -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=T+gUYuP3; 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 8FCBA807E43D; Thu, 23 Nov 2023 00:00:10 -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 S235103AbjKWH7x (ORCPT + 99 others); Thu, 23 Nov 2023 02:59:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344903AbjKWH7Z (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 0E4201BF; Wed, 22 Nov 2023 23:59:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700726372; x=1732262372; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qwCi8/cRXyz2gskGyZ4nkWESSM864LSQWnYjItBPCos=; b=T+gUYuP3/+guSO5zChUKQfSEXJ62P5+md/lTbHdAsiTN44MJaQAQpnh2 R+2VH+OfGlxVfLceiIdDOpRGekegNqTlVIiH/GHh4siK1C4ZBfxe1HpoH ksexi9yFpz9VP0S451ZSldiuzHqhExuxwJdlw0XJSGj9C2kq20mArr4sS Fdm0mCdcxcj/9IPFnSyHS+STx9VlkFhAQVTDFbUtL8YmDjsqWkpd4ppKU CHuZf2H00N24nshRxahDB8ha0zWD0tUGvQ1dIHZbdkiLtE0om/mO6RZJc L59XzGI7PzWibppUGA/1Ca+bcGPC2si9/w2MpzjTlbysaM0IF/ve7nTKP Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="396126438" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="396126438" 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:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="8764991" 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:22 -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 7/8] perf tests: Make data symbol test wait for perf to start Date: Thu, 23 Nov 2023 09:58:47 +0200 Message-Id: <20231123075848.9652-8-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 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:10 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783340899989005270 X-GMAIL-MSGID: 1783340899989005270 The perf data symbol test waits 1 second for perf to run and collect data, which may be too little if perf takes a long time to start up, which has been noticed on systems with many CPUs. Use existing wait_for_perf_to_start helper to wait for perf to start. Signed-off-by: Adrian Hunter --- tools/perf/tests/shell/test_data_symbol.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/shell/test_data_symbol.sh b/tools/perf/tests/shell/test_data_symbol.sh index 69bb6fe86c50..e50e54e94f6f 100755 --- a/tools/perf/tests/shell/test_data_symbol.sh +++ b/tools/perf/tests/shell/test_data_symbol.sh @@ -4,6 +4,10 @@ # SPDX-License-Identifier: GPL-2.0 # Leo Yan , 2022 +shelldir=$(dirname "$0") +# shellcheck source=lib/waiting.sh +. "${shelldir}"/lib/waiting.sh + skip_if_no_mem_event() { perf mem record -e list 2>&1 | grep -E -q 'available' && return 0 return 2 @@ -13,6 +17,7 @@ skip_if_no_mem_event || exit 2 TEST_PROGRAM="perf test -w datasym" PERF_DATA=$(mktemp /tmp/__perf_test.perf.data.XXXXX) +ERR_FILE=$(mktemp /tmp/__perf_test.stderr.XXXXX) check_result() { # The memory report format is as below: @@ -50,13 +55,15 @@ echo "Recording workload..." # specific CPU and test in per-CPU mode. is_amd=$(grep -E -c 'vendor_id.*AuthenticAMD' /proc/cpuinfo) if (($is_amd >= 1)); then - perf mem record -o ${PERF_DATA} -C 0 -- taskset -c 0 $TEST_PROGRAM & + perf mem record -vvv -o ${PERF_DATA} -C 0 -- taskset -c 0 $TEST_PROGRAM 2>"${ERR_FILE}" & else - perf mem record --all-user -o ${PERF_DATA} -- $TEST_PROGRAM & + perf mem record -vvv --all-user -o ${PERF_DATA} -- $TEST_PROGRAM 2>"${ERR_FILE}" & fi PERFPID=$! +wait_for_perf_to_start ${PERFPID} "${ERR_FILE}" + sleep 1 kill $PERFPID From patchwork Thu Nov 23 07:58:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 168765 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp284611vqx; Thu, 23 Nov 2023 00:00:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMSlBFxQiFQqtcl3jCKlfFzllXvGZnCkAe6UldGHwVyAz6Dhvo6LhciwP6nP0/E25Ob2b/ X-Received: by 2002:a17:90b:2247:b0:27d:5cca:9b69 with SMTP id hk7-20020a17090b224700b0027d5cca9b69mr5039399pjb.45.1700726412824; Thu, 23 Nov 2023 00:00:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700726412; cv=none; d=google.com; s=arc-20160816; b=XLww7j2ixmm0x5s9LMZolulXrDg23YuxBrgzdIpl77ijlUYwPVujww1Cnhu5xqsXYo H1qMnWJKAmDD6l2iAoSOeL7+hd8xh73n9mBC7jT8/Qb0/2xrEnEy75dcHdQzIO4ASFqA TGrr7MLhO1m0pd8Yx69p5QjoyXtfzwqwchHSLK+iOFQdavrBNg9YMYqdSvy0TcckP+jv 9r2u8cVH9HJVJ918ZBztjQEAd/qH9MNhDQ5ClxDb9+M79zlzVBnQN8U1WW3EpKMyX6eL 0le/uuqL7DqZzJuPPEwSNbAqGY52vKHBY0jHqleiifkvsQdeFHDaV0D64Oq5AHKdfGeb KFsA== 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=kem3D6pXNBFasgNu3bYfGuXi+aOlg98cmmkZLIjLT9Q=; fh=TPQr4nff5QO7OKSg4AL08iZb9B1RwOBx3bV3jWC0cDE=; b=DoImbqKAPafeMiIRNBBNzg7QkvgbGj7/BP4fHqAmRCM3yqMl84yZNmmjW1VhR+SCG0 rpaeETTYKsushUHqaM1hGSnEDnnLgclEYqxWOB2mzEpxqnirOrzV4W3HFpFzg9g9Xbt5 7T/y94R89rNqEtC6dheWjy35QX2mrgTg6ZZfn1o8g1qJneN8WNZBPDYixkowbdXhEPij eyApwjKO/mSsyFYbscMWU5nKGnDB0iJpnGdMhK34jF4fNLKpf8+1l01FTjeaPBcyGLQz XVRKoHNK9PqNrDvsIB9TmL1X1Ecs+b6V8O1xekOMM7hwCCQHpnMzapjtfNFbFptyc9jU dqEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=e+0xxbMr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id y6-20020a17090a1f4600b002839679c23csi1283433pjy.122.2023.11.23.00.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 00:00:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=e+0xxbMr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id ED03A8236259; Thu, 23 Nov 2023 00:00:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344957AbjKWH7u (ORCPT + 99 others); Thu, 23 Nov 2023 02:59:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344901AbjKWH7Z (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 79C12D40; Wed, 22 Nov 2023 23:59:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700726372; x=1732262372; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6i1yfJdZ3uedWfOmXBTKC5wUpcQHqTQufb6AFjSj/ic=; b=e+0xxbMrv78teOAI1e5ReGpXPnq1x1NSlR0NLkjuzGWfCbYtHgDnPsgk Uu32rSxx/NFlHoIMBYcYEpM99GusyuCaOwaCC2woLH1+A4acZb4V8QJQg ybiI5h5qgIFe/7cQmo2dQmOUJl2YKHloOdxDkcnjki7QkGNAVy3IASNu/ s2106uh6TTqxLjyRIiBMe07w6xG2KgKQaPNBDKxF+EJdYHJ753JjGsf0o v/3LnROm3dPxTXl/3F3kvQ/XkMJO7PJ5Cj8PCPd5bJeBgxWa32g1szUeZ 59xTkCEe+Leo8kY7DFczvgHw7/qlizjHyXkNy3WlwafWcAdUSwCfCbfC1 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="396126439" X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="396126439" 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:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,221,1695711600"; d="scan'208";a="8764993" 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:25 -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 8/8] perf tests: Skip data symbol test if buf1 symbol is missing Date: Thu, 23 Nov 2023 09:58:48 +0200 Message-Id: <20231123075848.9652-9-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 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 23 Nov 2023 00:00:03 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783340898884791183 X-GMAIL-MSGID: 1783340898884791183 perf data symbol test depends on finding symbol buf1 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 'data symbol' 113: Test data symbol : --- start --- test child forked, pid 125646 Recording workload... [ perf record: Woken up 3 times to write data ] [ perf record: Captured and wrote 0.577 MB /tmp/__perf_test.perf.data.Jhbdp (7794 samples) ] Cleaning up files... test child finished with -1 ---- end ---- Test data symbol: FAILED! After: $ tools/perf/perf test -v 'data symbol' 113: Test data symbol : --- start --- test child forked, pid 125747 perf does not have symbol 'buf1' perf is missing symbols - skipping test test child finished with -2 ---- end ---- Test data symbol: Skip Signed-off-by: Adrian Hunter --- tools/perf/tests/shell/test_data_symbol.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/perf/tests/shell/test_data_symbol.sh b/tools/perf/tests/shell/test_data_symbol.sh index e50e54e94f6f..3dfa91832aa8 100755 --- a/tools/perf/tests/shell/test_data_symbol.sh +++ b/tools/perf/tests/shell/test_data_symbol.sh @@ -8,6 +8,9 @@ shelldir=$(dirname "$0") # shellcheck source=lib/waiting.sh . "${shelldir}"/lib/waiting.sh +# shellcheck source=lib/perf_has_symbol.sh +. "${shelldir}"/lib/perf_has_symbol.sh + skip_if_no_mem_event() { perf mem record -e list 2>&1 | grep -E -q 'available' && return 0 return 2 @@ -15,6 +18,8 @@ skip_if_no_mem_event() { skip_if_no_mem_event || exit 2 +skip_test_missing_symbol buf1 + TEST_PROGRAM="perf test -w datasym" PERF_DATA=$(mktemp /tmp/__perf_test.perf.data.XXXXX) ERR_FILE=$(mktemp /tmp/__perf_test.stderr.XXXXX)