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