From patchwork Thu Nov 10 18:19:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 18273 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp302222wru; Thu, 10 Nov 2022 10:22:19 -0800 (PST) X-Google-Smtp-Source: AMsMyM4X4XHCatVBNfm2qtXUEGkWAIkLlTfD1kKDmFa65+71eUTc5ysXmOgOrYflrRRM95TaXRma X-Received: by 2002:a63:e94d:0:b0:45f:a78b:f910 with SMTP id q13-20020a63e94d000000b0045fa78bf910mr2942158pgj.67.1668104538684; Thu, 10 Nov 2022 10:22:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668104538; cv=none; d=google.com; s=arc-20160816; b=MEQ9gmr/Wgs2Vopaz9VEQZ5UkDRaz4cCCIYKfCxZ0dZwIt4NkShjeXJeZbqofj//b9 4obKunw4+xMcbiD4xZkCLhiAMwDSJbi7RYnCd9W29jFx4J4eFKpdxQWZsLT6YeS5ZjHW nM1hf3928OshBRpLqKXVqYR5OdKMydl+5WEm4oKJOSrAGbIEJ2EOhgQE0nUXVpTU67DS LJNiJAR9VctEDKOccIzmhg0+neefxXFqaoFFeB0zAQV7oHRsTJ7VXcpDpmEMi/kGscCo zR/WNYPy7QNn9wrxyBq9y6p0Iczyz1HY8n2u6hWj3Osyy+JPjd42RE6Wg8TcTB6j2lWE H1+A== 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=8W1IE2xF3dtxcNrj5t79DBInf6fMe+hYp9ym1CIb+t0=; b=ynOTALRzNi/WAlwqfZYS4nHGfEzDcPrU5aWxsEUy60xfgWlJCPyw8cuHZMuz7PkPnm 7l2hJePNz/teDjCYAZoA4o69xHZZvgSR/AFlKLi49DYVo5lWZvvG+2GyX6OWC8/ws03o 0wLgYBrtDX0lZ/XKtI411fzNCB9qyZintw9tBsIkfevyyE0AcDLacbJ2t6M3YItRpBZA HGSX1IX4+04F5HV0OWCwfTI27oj4BPlple7NKDPVQlHBwxqXjYSpnzVbWKst2b7CewlS thZYM1Z6tpgfgj2jB7IXs1GVBP/OzsmJbj84ZdGFarrqC9GrAI4FIBF0H8Ohw1Poc4YF qfkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YhqlzF1L; 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 h3-20020a056a00230300b0056e48944843si23587602pfh.355.2022.11.10.10.22.03; Thu, 10 Nov 2022 10:22:18 -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=YhqlzF1L; 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 S231912AbiKJSTu (ORCPT + 99 others); Thu, 10 Nov 2022 13:19:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231860AbiKJSTl (ORCPT ); Thu, 10 Nov 2022 13:19:41 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 933F14C25F; Thu, 10 Nov 2022 10:19:31 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id 4so2180477pli.0; Thu, 10 Nov 2022 10:19:31 -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=8W1IE2xF3dtxcNrj5t79DBInf6fMe+hYp9ym1CIb+t0=; b=YhqlzF1L0IAbbvz6hY9m89EYo+kFy9yEK0/JcmBQzgk1D3UCS7dwZom64Ufaikv4MZ 0ZZ361jjEKVhtwdtTrTQWQ8KTc6UWGJrfoJ4aZnt0SxD5yHPondQPsfd2y5XLW9jvXW1 v2RRg3YAkEIOHks4wLk8rqJjFfwoZWYXHxiYf5J5DaHpoI7f/PkfcpoL8sAkbg1jhIPI wihJMKrx2ZLsy9fqqfclcsPVU9fEeQAUK5rIbCvYM4isymCMkgwOgJyuMhIyDH7xCJ1j 7kHUxFRIiEXCRQJWHWrJDuBbzlP+xp3XJYDfCyvE9N6CNegEaYOtZLrfpOum252nv8Od N8zw== 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=8W1IE2xF3dtxcNrj5t79DBInf6fMe+hYp9ym1CIb+t0=; b=eqF6FaaLrM6VaRHawIFcZyJ320cFdNuQQ1Q268K/XcIvi4gsYLMKW3CTheSV6coN1p OmiYOv27BNHMzEa5czNIZuzwtMsf+dFaq8L90cHtsz3OUxFX0oeGOS2rbpU/7icW1MqF C7Sm+mLZSlgUCrVpaS9JotFUCXO1v4IPTWxCEYZfJLDkBfVKaLrKyllvPbayI56XiKnM seApYCm2IfWlaBLZ1oPmOrVKb1Dmx4y45kZA3jXvpzwX+m23C+2473IRkvwj2BwFqt0b +exPyFPJ9OhSqYcZvDaY70ez0LAGVjj5UkGBUlvo2fAOTT/WIH+ytEQtFu8OyKrztO34 UIgw== X-Gm-Message-State: ACrzQf0mi3qPRu4EMz+KO2eaJwOpQhH/NJQxVE4ZR8JOoNzgifWHfME8 Rg51fFyQjkC6rWPr3gyH6Ok= X-Received: by 2002:a17:902:744b:b0:187:12cc:d6f1 with SMTP id e11-20020a170902744b00b0018712ccd6f1mr1630691plt.63.1668104370928; Thu, 10 Nov 2022 10:19:30 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 10:19:30 -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 06/12] perf test: Replace arm callgraph fp test workload with leafloop Date: Thu, 10 Nov 2022 10:19:14 -0800 Message-Id: <20221110181920.84900-7-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?1749134385055301388?= X-GMAIL-MSGID: =?utf-8?q?1749134385055301388?= So that it can get rid of requirement of a compiler. Reviewed-by: Leo Yan Signed-off-by: Namhyung Kim Tested-by: James Clark --- .../perf/tests/shell/test_arm_callgraph_fp.sh | 34 ++----------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/tools/perf/tests/shell/test_arm_callgraph_fp.sh b/tools/perf/tests/shell/test_arm_callgraph_fp.sh index ec108d45d3c6..e61d8deaa0c4 100755 --- a/tools/perf/tests/shell/test_arm_callgraph_fp.sh +++ b/tools/perf/tests/shell/test_arm_callgraph_fp.sh @@ -4,44 +4,16 @@ lscpu | grep -q "aarch64" || exit 2 -if ! [ -x "$(command -v cc)" ]; then - echo "failed: no compiler, install gcc" - exit 2 -fi - PERF_DATA=$(mktemp /tmp/__perf_test.perf.data.XXXXX) -TEST_PROGRAM_SOURCE=$(mktemp /tmp/test_program.XXXXX.c) -TEST_PROGRAM=$(mktemp /tmp/test_program.XXXXX) +TEST_PROGRAM="perf test -w leafloop" cleanup_files() { rm -f $PERF_DATA - rm -f $TEST_PROGRAM_SOURCE - rm -f $TEST_PROGRAM } trap cleanup_files exit term int -cat << EOF > $TEST_PROGRAM_SOURCE -int a = 0; -void leaf(void) { - for (;;) - a += a; -} -void parent(void) { - leaf(); -} -int main(void) { - parent(); - return 0; -} -EOF - -echo " + Compiling test program ($TEST_PROGRAM)..." - -CFLAGS="-g -O0 -fno-inline -fno-omit-frame-pointer" -cc $CFLAGS $TEST_PROGRAM_SOURCE -o $TEST_PROGRAM || exit 1 - # Add a 1 second delay to skip samples that are not in the leaf() function perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 --user-callchains -- $TEST_PROGRAM 2> /dev/null & PID=$! @@ -58,11 +30,11 @@ wait $PID # program # 728 leaf # 753 parent -# 76c main +# 76c leafloop # ... perf script -i $PERF_DATA -F comm,ip,sym | head -n4 perf script -i $PERF_DATA -F comm,ip,sym | head -n4 | \ awk '{ if ($2 != "") sym[i++] = $2 } END { if (sym[0] != "leaf" || sym[1] != "parent" || - sym[2] != "main") exit 1 }' + sym[2] != "leafloop") exit 1 }'