Message ID | 20231120190408.281826-1-irogers@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp152777vqb; Mon, 20 Nov 2023 11:04:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGy+syHlrfWKi1mnZc4i2YOIaxW3QwE2/oURvpTuG+aHCtQJMhH4fqEXvBjHMgSQR4jdYid X-Received: by 2002:a17:902:c213:b0:1cc:7ec0:bc8a with SMTP id 19-20020a170902c21300b001cc7ec0bc8amr6281108pll.66.1700507074946; Mon, 20 Nov 2023 11:04:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700507074; cv=none; d=google.com; s=arc-20160816; b=cfy0qvxSGrC9xcNA3HuA42fNVeOnLze5XLJSZulIE37wr3a0jyOmflLBfV4fkpllzK YxLNyFdyq6ZQrg0eN447845oXmGP9zKvAH4SCUfvxS0tc3wYEhwONYAPGrcY10bCesxD QOyOkWL+lHi/z0hs6EEmnCL4YnjxHSuho7/lMmlOkwbrKEDapqXKebbZEH3GUT6h1p47 +ISCDW7a7tfMQC/a/an1qKFNpsXP1qcwoEhOKDNuTYAhRxB0k0JnGHQHqU8bR6EnIXVQ 4kZVKFRdVE6mXtJ8fhI2m2TMIhRgwed0TXkk7EleW++FcdUPTThAjpFEvOsrnRw5J6R3 tVKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=NwegP4grp+NKVnXxnLCbPPhC1AoQpO7Vl3AwS2tf1V0=; fh=tiLqfmzNRYSlCV2j/3i37cFvDEKyi7VYmURap7T6tj8=; b=XJ3+m0ZVQ4uluAdhc5LtBXrqHhuvZEYHaGJ6iZ1bqiZSVTviLMorXXv9WP1+6v+aDY o4cJxITu7gZ77CQkucMNkmSs2H4OSOHk/MqTAYF3tbNdS0RxYLEn1MaB+OvaLeBzMbrw mPkEGcv7WKJvIIKP7lVbHATYBMTOSfzBgrAjXW7LpxOM9xTem5CvAxVTwHPHUrlVqeF/ Tmt+V6ugWN3mS+FOAUFU7gaTECr/PEx2fSBMpXUHMM0A+k8FNec46oBmGgqMkIDsDpXl sDRvT35nL4xiP8UgnypGEJxiumiQDO7CiuOrIUFG8C9PZ0YstbHaX+fYGRWqshkBqScc m79g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=TywSXqEv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id y8-20020a17090322c800b001cc4078b033si8905840plg.145.2023.11.20.11.04.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 11:04:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=TywSXqEv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5BEA2803EC95; Mon, 20 Nov 2023 11:04:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229685AbjKTTET (ORCPT <rfc822;heyuhang3455@gmail.com> + 27 others); Mon, 20 Nov 2023 14:04:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229504AbjKTTER (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 20 Nov 2023 14:04:17 -0500 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 101429C for <linux-kernel@vger.kernel.org>; Mon, 20 Nov 2023 11:04:14 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5c934524a61so32428517b3.2 for <linux-kernel@vger.kernel.org>; Mon, 20 Nov 2023 11:04:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1700507053; x=1701111853; darn=vger.kernel.org; h=cc:to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=NwegP4grp+NKVnXxnLCbPPhC1AoQpO7Vl3AwS2tf1V0=; b=TywSXqEvMpo5ZbZuXWqr18X4YXCVS6DIXbLqZQq38nST77LY4YihWyoVsW4V9hLNEN IU0m2q02LZeVounQQk5uMDWd+ky1U+qJAIAwI90ovxUpbxzLk2pkLyU9RRCuhp622qKA OKD+FU/kbYrL79cXE7g29//7sGIZb2bW0U6TStW2S0IKUiSGMYSjpWYrSyX3soKVTXcM D8kIbOwYzzPRBtaYxWW9XaAVmKevuE0rVKkpErAuVfWmapXB5Hl4chT4fHCTFcIlyheH /nNdmiKg7QnPpSomfOqfIcihXwxcTKmeZZvi0uxZW3we596GY3ps6SZt3W623SOciLxn AKqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700507053; x=1701111853; h=cc:to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=NwegP4grp+NKVnXxnLCbPPhC1AoQpO7Vl3AwS2tf1V0=; b=E8Bvx2CUT/wZEHLtr8+lf1eldadwnHSeQr+wIKRSOrXNVCZpIiB32CY/tTWW6l4FJO UMWhaBH/h+SUvfLM/IcIbi7Ge2wbglJNZAbayecQwvkzeoil5OA6PxrxrqZC3enx8FkK So0mKozpFDQkFDeOlj0k/ZmojfELHC+f+WcLQgFnIlnWz3ux6UfIuxZRKWtFsKIFZLm/ 0zZj9humG9ccQQFErKNbudoUA1DljIkjtUf5AEQzF3uQPGW2G6awJsvdZvKPYxnbssTc /6euZg6UqQKN867PeEqq3O1wKlaG3lTTBCpNRiBmhT4ZbpcC0cPNkFv5vmzkL+oFHrMJ HyvQ== X-Gm-Message-State: AOJu0YwsFAhLfjtFZCXxzv6AeAK9fqmJOQ9WPjGHYxhHBRZ0u2pIBrg0 PQYc+H8e26Co6YRAHiTX6Kf0+gVqvNN2 X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:274d:270:40a9:df3f]) (user=irogers job=sendgmr) by 2002:a81:6dc9:0:b0:59b:c6bb:bab9 with SMTP id i192-20020a816dc9000000b0059bc6bbbab9mr227590ywc.3.1700507053127; Mon, 20 Nov 2023 11:04:13 -0800 (PST) Date: Mon, 20 Nov 2023 11:04:08 -0800 Message-Id: <20231120190408.281826-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog Subject: [PATCH v1] perf test: Add basic perf diff test From: Ian Rogers <irogers@google.com> To: Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Adrian Hunter <adrian.hunter@intel.com>, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, atrajeev@linux.vnet.ibm.com Cc: Ian Rogers <irogers@google.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 20 Nov 2023 11:04:32 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783110906452923090 X-GMAIL-MSGID: 1783110906452923090 |
Series |
[v1] perf test: Add basic perf diff test
|
|
Commit Message
Ian Rogers
Nov. 20, 2023, 7:04 p.m. UTC
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 <irogers@google.com>
---
tools/perf/tests/shell/diff.sh | 101 +++++++++++++++++++++++++++++++++
1 file changed, 101 insertions(+)
create mode 100755 tools/perf/tests/shell/diff.sh
Comments
On Mon, Nov 20, 2023 at 11:04 AM Ian Rogers <irogers@google.com> 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 <irogers@google.com> 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" > + > +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 >
Em Mon, Dec 04, 2023 at 08:00:35AM -0800, Ian Rogers escreveu: > On Mon, Nov 20, 2023 at 11:04 AM Ian Rogers <irogers@google.com> 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 <irogers@google.com> > > Ping. Thanks, applied to perf-tools-next. - Arnaldo
On 4/12/23 18:00, Ian Rogers wrote: > On Mon, Nov 20, 2023 at 11:04 AM Ian Rogers <irogers@google.com> 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 <irogers@google.com> > > 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 >>
On Mon, Dec 4, 2023 at 9:44 PM Adrian Hunter <adrian.hunter@intel.com> wrote: > > On 4/12/23 18:00, Ian Rogers wrote: > > On Mon, Nov 20, 2023 at 11:04 AM Ian Rogers <irogers@google.com> 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 <irogers@google.com> > > > > 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 Good idea, sent: https://lore.kernel.org/lkml/20231205164924.835682-1-irogers@google.com/ Thanks, Ian
Em Tue, Dec 05, 2023 at 08:52:04AM -0800, Ian Rogers escreveu: > On Mon, Dec 4, 2023 at 9:44 PM Adrian Hunter <adrian.hunter@intel.com> wrote: > > > > On 4/12/23 18:00, Ian Rogers wrote: > > > On Mon, Nov 20, 2023 at 11:04 AM Ian Rogers <irogers@google.com> 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 <irogers@google.com> > > > > > > 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 > > Good idea, sent: > https://lore.kernel.org/lkml/20231205164924.835682-1-irogers@google.com/ Applied, and added this: Suggested-by: Adrian Hunter <adrian.hunter@intel.com> Thanks, - Arnaldo
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" + +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