Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1314180rwb; Wed, 16 Nov 2022 15:44:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf4GfNMACgty6uZQ/qCU/fHg/v0GG0Pv8/CG9CyraQSDNwaHX4+570NrjDHDNnFBjtZmPB/i X-Received: by 2002:a17:906:dffa:b0:7ad:84cc:fb33 with SMTP id lc26-20020a170906dffa00b007ad84ccfb33mr105898ejc.380.1668642261500; Wed, 16 Nov 2022 15:44:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668642261; cv=none; d=google.com; s=arc-20160816; b=rDpMlrImhZE3F/kh4UldLtTfg6Rzi2G4kG3EXnDNunF56pHyEeTQp/pQZ2yF0rmaVX y6Yvcdz+iqWEGsQ3B/0mXOto4ip4qrtsHltbkGgI4gNZnGBMbX9aSpOLDC0VQKH6h3FU 5pXXORZH3pT6nKKwf5EY8nmoC+gJ0AywEk7Ws21+NDkwGCUnnZcMHIjqO695d2y7lp8B E/TvVovDHjxoHPBZpJxMc2EfeQ95rU7/KnirtiN5MNoz7ftKKF/SR6JKLOD+cCdUyqAj RHZEzGF592wQ0muK4QjjYAmJhBf/PyNLhl6VYJA539FIberHNyGDgaSRtGYozheyFgp2 pT1g== 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=P97FeOGLA96wHsbLefL56s9RPadISI4phF1+HGdaCPc=; b=eK+zHreYmvGMmouGrm0kIt2Wu1207DJrqVrfveml4irCmVpFcGj7AcZrYNGj6MxCLq zN/KZZVVt7RSoqTvVTY6kzYpp68qvK3kBtYnLgyWqyV9AET9ta6J0TLq9jXKk98KRLB4 Xl71HlA0HYl00uC+7OqtS1ttVgHxaIVYtXNq6oqq5ffcUXExfbVWc2+In0NHWPoWn7P4 x1WgyTRDO54GNl7T+XbO3gxmtL97E783QKDNqiNUsKdTNKxtkDEoiwfHmSFnCuqtCHNG HKEm7f9FjK/oVjsuh1Ih/ppf1Y06grKF9XJrzN45e8Gf+yelCH9P777pzKWm74DpFiSk SCmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RwHw2BwE; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o13-20020a170906974d00b0073d8e4e8c77si15892119ejy.1005.2022.11.16.15.44.00; Wed, 16 Nov 2022 15:44:21 -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=RwHw2BwE; 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 S234554AbiKPXjW (ORCPT + 90 others); Wed, 16 Nov 2022 18:39:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233862AbiKPXjH (ORCPT ); Wed, 16 Nov 2022 18:39:07 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60CFC68299; Wed, 16 Nov 2022 15:39:05 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id o7so124904pjj.1; Wed, 16 Nov 2022 15:39:05 -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=P97FeOGLA96wHsbLefL56s9RPadISI4phF1+HGdaCPc=; b=RwHw2BwEHSGoTMuF7srFdB0iTSrzA5Co9VTFtPfLOesT5GtJEK+x1MBkPa+CtMTuvJ OwP4Js8lrEhxWpT3SZD8xoGEHrwrDyTB8ST+vgtBEqKzHk9qGGsOQm7LedjCysHf46dn BXhHddbyamCHzJoLz4TV28pufnBQGWda7k+jKuIP5Uk4VfHg9iHzONJSHg6N7bCOWAAZ h8euoDw7pWXt7hL2j8HlGCjS/u6zFlU2ipGfe37X7Cn6wcvYthXASQ3LFOaUJQfbJxTU CSZIRER9R8jqrCIWrSPPSialTSA64JgvczLcBYfh+C5AGr0ACEh1wYsgSSwNh9XKPr1O 4aRw== 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=P97FeOGLA96wHsbLefL56s9RPadISI4phF1+HGdaCPc=; b=dA9EXCOF/ypPqEMt1Baj3bVwx0HTHWB44uorK+0d8bvXvq3rDc49czIffWwmEqDoWP 6VxFeAnwiFyaETG4SyOqU3m4s1BysySluE6Vd8zHXPBdnFdExEM4JsLA4sSZ1VvHTPpb GW6WQWlVnd1VETgjZla0ktIHXblyAr6vxYRvKJFVISERfb+4moNzybEYYIxiWKQTLUQg JFn5GRsYDHmrPsRtNqFXRX2zmCVDA/MXfgAiMx90AxaVfS9BMCO5UERlrm/r2LDdO/hm km58UutlAJXj/tq68mvfxFwiK17H8EZdtNBeAkkJEDoZ2gcCxAOcFd2rdWKf0VTXquCK 7TTw== X-Gm-Message-State: ANoB5pkhqwWaNiMULtCwRmg4LKwqcLBUdc5skjvHu77W141Jh/+jXynI nJDrTFk3wtR8VDqDSOmrtPpp9rsn3GU= X-Received: by 2002:a17:903:25d1:b0:176:71be:cc64 with SMTP id jc17-20020a17090325d100b0017671becc64mr53625plb.141.1668641944771; Wed, 16 Nov 2022 15:39:04 -0800 (PST) Received: from youngsil.svl.corp.google.com ([2620:15c:2d4:203:5b40:ce8c:1f7c:9acc]) by smtp.gmail.com with ESMTPSA id bc10-20020a170902930a00b00188ef3ea2b6sm95929plb.262.2022.11.16.15.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 15:39:04 -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 05/12] perf test: Add 'leafloop' test workload Date: Wed, 16 Nov 2022 15:38:47 -0800 Message-Id: <20221116233854.1596378-6-namhyung@kernel.org> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog In-Reply-To: <20221116233854.1596378-1-namhyung@kernel.org> References: <20221116233854.1596378-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 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 The leafloop workload is to run an infinite loop in the test_leaf function. This is needed for the ARM fp callgraph test to verify if it gets the correct callchains. $ perf test -w leafloop Signed-off-by: Namhyung Kim --- tools/perf/tests/builtin-test.c | 1 + tools/perf/tests/tests.h | 1 + tools/perf/tests/workloads/Build | 3 +++ tools/perf/tests/workloads/leafloop.c | 34 +++++++++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 tools/perf/tests/workloads/leafloop.c diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c index 161f38476e77..0ed5ac452f6e 100644 --- a/tools/perf/tests/builtin-test.c +++ b/tools/perf/tests/builtin-test.c @@ -121,6 +121,7 @@ static struct test_suite **tests[] = { static struct test_workload *workloads[] = { &workload__noploop, &workload__thloop, + &workload__leafloop, }; static int num_subtests(const struct test_suite *t) diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h index e6edfeeadaeb..86804dd6452b 100644 --- a/tools/perf/tests/tests.h +++ b/tools/perf/tests/tests.h @@ -202,5 +202,6 @@ struct test_workload workload__##work = { \ /* The list of test workloads */ DECLARE_WORKLOAD(noploop); DECLARE_WORKLOAD(thloop); +DECLARE_WORKLOAD(leafloop); #endif /* TESTS_H */ diff --git a/tools/perf/tests/workloads/Build b/tools/perf/tests/workloads/Build index b8964b1099c0..631596bdb2b3 100644 --- a/tools/perf/tests/workloads/Build +++ b/tools/perf/tests/workloads/Build @@ -2,3 +2,6 @@ perf-y += noploop.o perf-y += thloop.o +perf-y += leafloop.o + +CFLAGS_leafloop.o = -g -O0 -fno-inline -fno-omit-frame-pointer diff --git a/tools/perf/tests/workloads/leafloop.c b/tools/perf/tests/workloads/leafloop.c new file mode 100644 index 000000000000..1bf5cc97649b --- /dev/null +++ b/tools/perf/tests/workloads/leafloop.c @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#include +#include +#include "../tests.h" + +/* We want to check these symbols in perf script */ +noinline void leaf(volatile int b); +noinline void parent(volatile int b); + +static volatile int a; + +noinline void leaf(volatile int b) +{ + for (;;) + a += b; +} + +noinline void parent(volatile int b) +{ + leaf(b); +} + +static int leafloop(int argc, const char **argv) +{ + int c = 1; + + if (argc > 0) + c = atoi(argv[0]); + + parent(c); + return 0; +} + +DEFINE_WORKLOAD(leafloop); -- 2.38.1.584.g0f3c55d4c2-goog