Message ID | 20221109174635.859406-7-namhyung@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp474905wru; Wed, 9 Nov 2022 09:50:33 -0800 (PST) X-Google-Smtp-Source: AMsMyM4y7dA37R59FhuWR/uKU9O3YEp3qONnq0+u1FzeG9+E/QovLhQ6iJ6VGo6SC2uuK00w9BCo X-Received: by 2002:a17:906:b303:b0:78d:9f46:5b6 with SMTP id n3-20020a170906b30300b0078d9f4605b6mr1453651ejz.158.1668016233023; Wed, 09 Nov 2022 09:50:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668016233; cv=none; d=google.com; s=arc-20160816; b=hBJenKglZoPW+iU45rDMvk1uDE+JRSt0cGJ3CvpQhro58/85itwuxIvniEFx4Y5ggG Igt7AK3c7EcLuHa9XOQ/meS9H47nWfmJZyv/cYLxcOVl0dcdgm4ecVqt3ENYuCdaQCxe Xh0+ltfl+NZ8U8sW2fiQ6DNfEIUuwCs6V5wSru/IuZ0IVXdytZEdvDpUGIZnQLD10L5z mP2bXxwiKQ9Q1GoTXBjqSCX1aWVHI/rlWxwJe2ZHQD1W/YDAhIoibw7X47FAFASaL29h VcCxjRKnEBv+dmYbAC3MmJtwPMEepXcW20ndL+P+tJopcTJ3dg9K59ZSWjsK9QFaDed1 GdGw== 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=6wE8Me379mSupxG/Q4MDBJ3KdIEi26s+14+TmqgM5rk=; b=gzGVBeEXfHzJ3/HnIkygIoLmBNeJ9OAkF0opQ5nBHgsgMk54/dEtQ2zODSFW6lunNF RLRq3WcgtiZbiriKeUrKRi94bWj+e9JWL/Jg4E6pQCpPSipa5RQfb0wIjABd/jo9CmJT Yf3YYyJIa0T0VKnENG7oDthh4JquQu1LePgPETGl/DmOrI001rgMu7ZK6dpK3OWMKsXw WHf65iHWHiqt94oA/6jdtI5aqElj5jZafizPc4q7MZFP8pq/3inwZlEC+qYgYQiI+G03 UC4iMQLN7MFmQEspN6sUE0OVuK/ED+06NxH+mu209FKGa42uRfwaUOjsjfUwW9S+0wXf wkLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=C+ttYSOx; 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 m17-20020a056402511100b00461b8e2c7f4si18327600edd.548.2022.11.09.09.50.07; Wed, 09 Nov 2022 09:50:33 -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=C+ttYSOx; 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 S231896AbiKIRrD (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Wed, 9 Nov 2022 12:47:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231795AbiKIRqq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 9 Nov 2022 12:46:46 -0500 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB7D5659F; Wed, 9 Nov 2022 09:46:45 -0800 (PST) Received: by mail-pf1-x42f.google.com with SMTP id i3so17363174pfc.11; Wed, 09 Nov 2022 09:46:45 -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=6wE8Me379mSupxG/Q4MDBJ3KdIEi26s+14+TmqgM5rk=; b=C+ttYSOxJxIEIEFyyJ5ogzydLA0DxS6DU3gqCqezxULR/kleYyHQlDuIrosSrqMJ4s dLvZOA+QPOdNUaNXXXWgiCVhb2WVxrGOPgss2tN6gdmcFD9GmjZ31r2Axkh0+icg5ryS A921XnKjvSB2uNdkAq3qy0Lp4ZeLFF5aX7UUHfn6L03UiBF6cGTqMCr8/4JgR1GNfjKj fsXOUZs/LzgMyr4irSpjayQvgsHLCd82kHjSE2ubCxOL4cTfFfeLgz301EuP0IJCQ1uD TYgbAIQVdDnF+jDjXobh1Ks9XiYABK0zWM1LBfw0O4wz9TxZh1+DaWd5nwHOanTVvq93 Kl6w== 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=6wE8Me379mSupxG/Q4MDBJ3KdIEi26s+14+TmqgM5rk=; b=jydHdMxCkHfl5DMbYT9ObWK22m0vj1vh2Q4DwwvBNUCrTVbwWXKUy49oH29G+gIa0A 0nPVgYxjfaxI8Q7o08XiSK5rlcY0AkBGKPL5Hl5UnM3C+/Z04XbGcZ0nqzKsBf8Ot4hC BcRo7AvKXZwdeCa0ZMj52NVSS9cG90qJZrn+wsLkkUzSK5ImKvdQAPp8eMNExU2NJc+f Kz3XgkuLWnzEYK1fADATZvsP0MbAUofwrN/67zPcFwwMG1zL9jssrHCCTNZUtfrHM5pl KT6FyCJyKR5meRsvNJku5924RAidpMbJR9GuM8KBX/W7PPOC//t4jBLR1w+RrNn7lAbF IC1A== X-Gm-Message-State: ACrzQf1LWDk8kktepI99WmEziUy0cwYtnfpiqvNnfHBeeO1MkyhziS7r P5DJnLInutEej2LhDhfDE4U= X-Received: by 2002:a63:90c9:0:b0:46e:dd5a:d921 with SMTP id a192-20020a6390c9000000b0046edd5ad921mr52329416pge.282.1668016005320; Wed, 09 Nov 2022 09:46:45 -0800 (PST) Received: from balhae.corp.google.com ([2620:15c:2c1:200:fa05:f3cd:da75:3103]) by smtp.gmail.com with ESMTPSA id a10-20020a63cd4a000000b0043941566481sm7877909pgj.39.2022.11.09.09.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 09:46:44 -0800 (PST) Sender: Namhyung Kim <namhyung@gmail.com> From: Namhyung Kim <namhyung@kernel.org> To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@kernel.org> Cc: Ingo Molnar <mingo@kernel.org>, Peter Zijlstra <peterz@infradead.org>, LKML <linux-kernel@vger.kernel.org>, Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, linux-perf-users@vger.kernel.org, Leo Yan <leo.yan@linaro.org>, German Gomez <german.gomez@arm.com>, Zhengjun Xing <zhengjun.xing@linux.intel.com>, James Clark <james.clark@arm.com> Subject: [PATCH 06/12] perf test: Replace arm callgraph fp test workload with leafloop Date: Wed, 9 Nov 2022 09:46:29 -0800 Message-Id: <20221109174635.859406-7-namhyung@kernel.org> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog In-Reply-To: <20221109174635.859406-1-namhyung@kernel.org> References: <20221109174635.859406-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749041789901072773?= X-GMAIL-MSGID: =?utf-8?q?1749041789901072773?= |
Series |
perf test: Add test workloads (v1)
|
|
Commit Message
Namhyung Kim
Nov. 9, 2022, 5:46 p.m. UTC
So that it can get rid of requirement of a compiler.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
.../perf/tests/shell/test_arm_callgraph_fp.sh | 30 +------------------
1 file changed, 1 insertion(+), 29 deletions(-)
Comments
Hi Namyung, On Wed, Nov 09, 2022 at 09:46:29AM -0800, Namhyung Kim wrote: > So that it can get rid of requirement of a compiler. > > Signed-off-by: Namhyung Kim <namhyung@kernel.org> > --- > .../perf/tests/shell/test_arm_callgraph_fp.sh | 30 +------------------ > 1 file changed, 1 insertion(+), 29 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..9d6d1b2d99c5 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=$! I need to append below changes, otherwise the test will fail on Arm64: --- a/tools/perf/tests/shell/test_arm_callgraph_fp.sh +++ b/tools/perf/tests/shell/test_arm_callgraph_fp.sh @@ -30,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 }' With appending above change, this patch looks good to me: Reviewed-by: Leo Yan <leo.yan@linaro.org> German, James, would you have chance to review this change? Thanks, Leo
Hi Leo, On Thu, Nov 10, 2022 at 3:20 AM Leo Yan <leo.yan@linaro.org> wrote: > > Hi Namyung, > > On Wed, Nov 09, 2022 at 09:46:29AM -0800, Namhyung Kim wrote: > > So that it can get rid of requirement of a compiler. > > > > Signed-off-by: Namhyung Kim <namhyung@kernel.org> > > --- > > .../perf/tests/shell/test_arm_callgraph_fp.sh | 30 +------------------ > > 1 file changed, 1 insertion(+), 29 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..9d6d1b2d99c5 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=$! > > I need to append below changes, otherwise the test will fail on Arm64: Thanks for the fix, will add it to v2. > > --- a/tools/perf/tests/shell/test_arm_callgraph_fp.sh > +++ b/tools/perf/tests/shell/test_arm_callgraph_fp.sh > @@ -30,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 }' > > With appending above change, this patch looks good to me: > > Reviewed-by: Leo Yan <leo.yan@linaro.org> Great, thanks a lot! Namhyung > > German, James, would you have chance to review this change? > > Thanks, > Leo
diff --git a/tools/perf/tests/shell/test_arm_callgraph_fp.sh b/tools/perf/tests/shell/test_arm_callgraph_fp.sh index ec108d45d3c6..9d6d1b2d99c5 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=$!