From patchwork Thu Nov 10 18:19:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 18280 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp305399wru; Thu, 10 Nov 2022 10:28:54 -0800 (PST) X-Google-Smtp-Source: AMsMyM7SwKJnw8NIJiuegiV1fvjl7cgJqDRu28k5zy2mNbVrsGGKPknNsLKWFEh0E6OSNINZlDbH X-Received: by 2002:a17:906:3054:b0:78d:585e:d183 with SMTP id d20-20020a170906305400b0078d585ed183mr3394251ejd.768.1668104934239; Thu, 10 Nov 2022 10:28:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668104934; cv=none; d=google.com; s=arc-20160816; b=YLJKkfHPxHER7aif4bgVR30D39WBiuNFbO3/f5yE+t2K21NI5p9vo5ckyV+pmMgapl wxx0kT8s18zYL+E5gcsebM5JrG/ZrkmoALruesHIv7t7lDkuU7ZoAcG1a6awHPDkpmYl qtDGkMlAWS0W8SsKfZ83VgOo2k6TMoQoZG4OxL5qme0XBPSN5ACRHouvqQzuNL0JmkZl hKOmH2/NcdUw4U+DxQ3gJc1bKOqWYyy8OMU4mQhc24CeNl4abXVTQag22CVcganHjOkh YwSHcenlLK6SWkZeqYqrFnKSNnhamMtURODB5tyLY2kXUcGeFDE2qrK4xLM/eVTzhkr+ /6MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=Ktjc694U1hBp6r3wDR+QD4vHKh9CxqERsaJjaU1PQNI=; b=mejaSXR/uH3j0hlxzWxY+HHbO96q955q/wB/2Zw7P7X73fSKphPQE+nvRHnnvQ6+ks QdPhciYdrpiS4x1g/WhZobHzRRJT9aofIqhE++7Xf/7hHzUs2McBSTCddXE0FffESlpe d3gcZ6TllnyTl16fvDug3wrv2zwNRR+PW/l+zNMRCY4Htkj9Buunyl6SdFQXmkgqkD7K O3gJzo0hiTS7vZ3Vp5SXwzPALsszOy9EoYVK0vsW/obWsidGJ0gvwCENEYJHWV8PoFwf k+Aw7NeJjUxUmBwY1z6Vs+g5H7HmZQOgwGqgBkvVefFu4aMzlzn8FaopCpZEQl5TrZvh 6E9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YmcdUFeU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wy8-20020a170906fe0800b00791a7e441a3si18612132ejb.459.2022.11.10.10.28.29; Thu, 10 Nov 2022 10:28:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YmcdUFeU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232126AbiKJSU3 (ORCPT + 99 others); Thu, 10 Nov 2022 13:20:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231989AbiKJSUF (ORCPT ); Thu, 10 Nov 2022 13:20:05 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B5D051C0D; Thu, 10 Nov 2022 10:19:39 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id l2so2108942pld.13; Thu, 10 Nov 2022 10:19:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Ktjc694U1hBp6r3wDR+QD4vHKh9CxqERsaJjaU1PQNI=; b=YmcdUFeUMM8Ol0c17/XE4ouho/c+5RomMI22FzqXEkqEaWfryDP69ZpQMJ9Vmcwm8m fIQAAXoGRIYJmustO9mq1ls2lqESUdYeWXeS8aHA22WHzyeT14cjAJlKeMPVV2pCGiAf cMLPUh7CbNy0q38zpcdkQcj5sFl4KkmptSVWWRvT3jv5l9HaXfs0fHFtYKAqCtE3G8JN VPbs9ACAqQZd7AtBTAdZj8jiAsTrKVwlfpqmmspYDoObmQUmejHK6mAxzxuJzT2IzkE5 WuahiX7p7NIbVx+auIcpqbx+ErxKjxmssN4GdlUnymd1ZHxQ8u8a9DxXCS1IzbX2T91d Vp9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Ktjc694U1hBp6r3wDR+QD4vHKh9CxqERsaJjaU1PQNI=; b=xaL3xcJedUK4dwvn9P1p83Xq80vaBH/O+ljpAOtfy1egJtEVWtdSN91OUU4Y8rcYc4 sDtbWR2laLouheBQQCuOh2LGACHiqSb2TnSneJWknYaocXqStOfJ4IzbgV0M67pLZkl0 qVGC6V2xAMe7XzTixgfw1WOpVMt3HyhugjaZuONMD/CcKJGpruIw81hktlXVeC4Iygzl DRgs2Mu0iSb0oB7veucFHYRs2FL2oGAUroyqf6bvZxWpD2DBit8k1/Ltk73+++j0mFVP QxY15dvvyQm7QzFDYUalLHd6vpq7f1UfGbYjsB5NKbVkRCWNYIWIrn6m+ktz1jg07opS DBJg== X-Gm-Message-State: ACrzQf2uDQzL24thq5/ruXQv6EQy08/Ct2M1Vi3mYBINspTxV5aM59oO TR9YKSEV3ztJkCA25vyyGGs= X-Received: by 2002:a17:902:be03:b0:178:6f5d:e979 with SMTP id r3-20020a170902be0300b001786f5de979mr64611722pls.163.1668104378705; Thu, 10 Nov 2022 10:19:38 -0800 (PST) Received: from youngsil.svl.corp.google.com ([2620:15c:2d4:203:12cb:b694:b3d8:467c]) by smtp.gmail.com with ESMTPSA id e9-20020a170902784900b00183e2a96414sm11518744pln.121.2022.11.10.10.19.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 10:19:38 -0800 (PST) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, Leo Yan , German Gomez , Zhengjun Xing , James Clark , Athira Jajeev Subject: [PATCH 12/12] perf test: Replace data symbol test workload with datasym Date: Thu, 10 Nov 2022 10:19:20 -0800 Message-Id: <20221110181920.84900-13-namhyung@kernel.org> X-Mailer: git-send-email 2.38.1.493.g58b659f92b-goog In-Reply-To: <20221110181920.84900-1-namhyung@kernel.org> References: <20221110181920.84900-1-namhyung@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749134799616143635?= X-GMAIL-MSGID: =?utf-8?q?1749134799616143635?= So that it can get rid of requirement of a compiler. $ sudo ./perf test -v 109 109: Test data symbol : --- start --- test child forked, pid 844526 Recording workload... [ perf record: Woken up 2 times to write data ] [ perf record: Captured and wrote 0.354 MB /tmp/__perf_test.perf.data.GFeZO (4847 samples) ] Cleaning up files... test child finished with 0 ---- end ---- Test data symbol: Ok Cc: Leo Yan Signed-off-by: Namhyung Kim Tested-by: James Clark --- tools/perf/tests/shell/test_data_symbol.sh | 29 +--------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/tools/perf/tests/shell/test_data_symbol.sh b/tools/perf/tests/shell/test_data_symbol.sh index cd6eb54d235d..d871e6c743ef 100755 --- a/tools/perf/tests/shell/test_data_symbol.sh +++ b/tools/perf/tests/shell/test_data_symbol.sh @@ -11,13 +11,7 @@ skip_if_no_mem_event() { skip_if_no_mem_event || exit 2 -# skip if there's no compiler -if ! [ -x "$(command -v cc)" ]; then - echo "skip: no compiler, install gcc" - exit 2 -fi - -TEST_PROGRAM=$(mktemp /tmp/__perf_test.program.XXXXX) +TEST_PROGRAM="perf test -w datasym" PERF_DATA=$(mktemp /tmp/__perf_test.perf.data.XXXXX) check_result() { @@ -45,31 +39,10 @@ cleanup_files() { echo "Cleaning up files..." rm -f ${PERF_DATA} - rm -f ${TEST_PROGRAM} } trap cleanup_files exit term int -# compile test program -echo "Compiling test program..." -cat << EOF | cc -o ${TEST_PROGRAM} -x c - -typedef struct _buf { - char data1; - char reserved[55]; - char data2; -} buf __attribute__((aligned(64))); - -static buf buf1; - -int main(void) { - for (;;) { - buf1.data1++; - buf1.data2 += buf1.data1; - } - return 0; -} -EOF - echo "Recording workload..." # perf mem/c2c internally uses IBS PMU on AMD CPU which doesn't support