Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp79717rdb; Mon, 4 Dec 2023 21:44:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBg42d4F6YN2AyIRVBdYkNzz3ShpbjbDeZP0Xkum8SSghYy4cMpU7GwXfAFPNyPxyV71Q3 X-Received: by 2002:a81:431d:0:b0:5d7:1941:a9e with SMTP id q29-20020a81431d000000b005d719410a9emr3978873ywa.57.1701755095528; Mon, 04 Dec 2023 21:44:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701755095; cv=none; d=google.com; s=arc-20160816; b=X8sJaqy8JVXtiBGf/izsk4I/gYvbsXobAvUv920QTzGc9Vkb/ZUz+99qxwVXZ7ZdMq XorePD6FWR+wuuRp/latPaumTO8zJnxVldb08C7+KLTh1IlED8bgCe62qd+ihkaAwUG9 JcwXhCJRL4pGUvg6/2s3RkTDKQ1PUupiR1AWL/gzRbAomPZKGfE+0gJzZRrKDxTu8gha ozGjPK59+s7gZSGuJTXkzNStbpvM98DTogQ6I6AwEDS2kVNcRgRPpZNPLslQHGICh/qe qBL1ubcTeowk7sW3lkK+vKfmwcPepHTmoaBy3fAlXwcGBfUHSVErkAQAuoMEJaNRCDsA OEFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=Trau6hjUkrsNAQKG678M78Po06IKiw8gtYCUTIcHWQI=; fh=F9C2xJDGKVqCEyu91I6RwmcjuwzsJSxXV/c8YCh8g68=; b=cG+VuRih7oeetq2xOvhN99uX8yXmHuxk3J19jXYmtEzw5OGBJDXC9jrJs8RJk0HVTL fE49sZ2Q+0hoeY1Q/b62xvroIFGROmedSzFenq/rBd3phNoTFhvMtym5xGqqUyLCu8h4 9YruS9qsP4vGWUjgAyBV1B2ilNyAnKaSi5hxfBOeiaNzx/KcMTpG6IhBFMDMt8db33Xb kXj2xEisFvgxFC9M20XUMIevPXWEnCgfrKOtqwL4bD8HjwegRe2UXXBdvMYBV+lwROV6 I9Xgk3ylnaAS7G9+B7HdqwoFbfRNkWHOPk6qeNkrvGIDXZQpDHSRVNCPxIpNchnzaeGB PK0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ju7YylLq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id b7-20020a6541c7000000b005bd39fc1ebesi8969102pgq.223.2023.12.04.21.44.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 21:44:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ju7YylLq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id EE3A380A135E; Mon, 4 Dec 2023 21:44:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbjLEFoV (ORCPT + 99 others); Tue, 5 Dec 2023 00:44:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230074AbjLEFoS (ORCPT ); Tue, 5 Dec 2023 00:44:18 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3481410F; Mon, 4 Dec 2023 21:44:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701755064; x=1733291064; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=Z6hy1gIp80vT4zLaK3KIOHDEPNxXXhNL4HF2amR4Ebo=; b=ju7YylLqerdvasVWFd3FV+EVmK+nL+UBAE+exh7+T+c/ilwz4HuwVc4f AT6t94NjLfMAm/S3n5RGYv4K2Its7kX+thKob9/SaJydWb94IaOFIZuOg vHJ3pJbjgEC/fnbum+8tQdgwxYsj1fcP/ABdPMX69bnUNJm6+wNyxTkPM xR8rFCYTGYzyrFnbcDAuaOH4BU24f4ohb9/vO32zpQswVeHUl1KAdr9AL LQSnzvDoy8h2aXGCo7zEhMdnVKE4KSXaRJyeECLzMRpdU7D7iZfnVBlZs do0uRP3SjIaF345wZ61GZVwb/QqnwezWLIUkd4YAB3SH9rWAadQU4bn5J Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="12562894" X-IronPort-AV: E=Sophos;i="6.04,251,1695711600"; d="scan'208";a="12562894" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 21:44:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="888803383" X-IronPort-AV: E=Sophos;i="6.04,251,1695711600"; d="scan'208";a="888803383" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.46.77]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 21:44:20 -0800 Message-ID: Date: Tue, 5 Dec 2023 07:44:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] perf test: Add basic perf diff test Content-Language: en-US To: Ian Rogers , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, atrajeev@linux.vnet.ibm.com References: <20231120190408.281826-1-irogers@google.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Mon, 04 Dec 2023 21:44:52 -0800 (PST) On 4/12/23 18:00, Ian Rogers wrote: > On Mon, Nov 20, 2023 at 11:04 AM Ian Rogers wrote: >> >> There are some old bug reports on perf diff crashing: >> https://rhaas.blogspot.com/2012/06/perf-good-bad-ugly.html >> >> Happening across them I was prompted to add two very basic tests that >> will give some perf diff coverage. >> >> Signed-off-by: Ian Rogers > > Ping. > > Thanks, > Ian > >> --- >> tools/perf/tests/shell/diff.sh | 101 +++++++++++++++++++++++++++++++++ >> 1 file changed, 101 insertions(+) >> create mode 100755 tools/perf/tests/shell/diff.sh >> >> diff --git a/tools/perf/tests/shell/diff.sh b/tools/perf/tests/shell/diff.sh >> new file mode 100755 >> index 000000000000..213185763688 >> --- /dev/null >> +++ b/tools/perf/tests/shell/diff.sh >> @@ -0,0 +1,101 @@ >> +#!/bin/sh >> +# perf diff tests >> +# SPDX-License-Identifier: GPL-2.0 >> + >> +set -e >> + >> +err=0 >> +perfdata1=$(mktemp /tmp/__perf_test.perf.data.XXXXX) >> +perfdata2=$(mktemp /tmp/__perf_test.perf.data.XXXXX) >> +perfdata3=$(mktemp /tmp/__perf_test.perf.data.XXXXX) >> +testprog="perf test -w thloop" >> +testsym="test_loop" Could it benefit from skip_test_missing_symbol >> + >> +cleanup() { >> + rm -rf "${perfdata1}" >> + rm -rf "${perfdata1}".old >> + rm -rf "${perfdata2}" >> + rm -rf "${perfdata2}".old >> + rm -rf "${perfdata3}" >> + rm -rf "${perfdata3}".old >> + >> + trap - EXIT TERM INT >> +} >> + >> +trap_cleanup() { >> + cleanup >> + exit 1 >> +} >> +trap trap_cleanup EXIT TERM INT >> + >> +make_data() { >> + file="$1" >> + if ! perf record -o "${file}" ${testprog} 2> /dev/null >> + then >> + echo "Workload record [Failed record]" >> + echo 1 >> + return >> + fi >> + if ! perf report -i "${file}" -q | grep -q "${testsym}" >> + then >> + echo "Workload record [Failed missing output]" >> + echo 1 >> + return >> + fi >> + echo 0 >> +} >> + >> +test_two_files() { >> + echo "Basic two file diff test" >> + err=$(make_data "${perfdata1}") >> + if [ $err != 0 ] >> + then >> + return >> + fi >> + err=$(make_data "${perfdata2}") >> + if [ $err != 0 ] >> + then >> + return >> + fi >> + >> + if ! perf diff "${perfdata1}" "${perfdata2}" | grep -q "${testsym}" >> + then >> + echo "Basic two file diff test [Failed diff]" >> + err=1 >> + return >> + fi >> + echo "Basic two file diff test [Success]" >> +} >> + >> +test_three_files() { >> + echo "Basic three file diff test" >> + err=$(make_data "${perfdata1}") >> + if [ $err != 0 ] >> + then >> + return >> + fi >> + err=$(make_data "${perfdata2}") >> + if [ $err != 0 ] >> + then >> + return >> + fi >> + err=$(make_data "${perfdata3}") >> + if [ $err != 0 ] >> + then >> + return >> + fi >> + >> + if ! perf diff "${perfdata1}" "${perfdata2}" "${perfdata3}" | grep -q "${testsym}" >> + then >> + echo "Basic three file diff test [Failed diff]" >> + err=1 >> + return >> + fi >> + echo "Basic three file diff test [Success]" >> +} >> + >> +test_two_files >> +test_three_files >> + >> +cleanup >> +exit $err >> -- >> 2.43.0.rc1.413.gea7ed67945-goog >>