From: Michael Petlan <mpetlan@redhat.com>
To: linux-perf-users@vger.kernel.org, acme@redhat.com
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
namhyung@kernel.org, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
irogers@google.com, adrian.hunter@intel.com,
atrajeev@linux.vnet.ibm.com, kjain@linux.ibm.com
Subject: [PATCH v2 0/7] Add perf testsuite into perf-test
Date: Thu, 15 Feb 2024 12:02:24 +0100 [thread overview]
Message-ID: <20240215110231.15385-1-mpetlan@redhat.com> (raw)
In-Reply-To: <20240131113951.17077-1-mpetlan@redhat.com>
Hello all,
as Arnaldo said, this is a first patchset of an effort to upstream
the external perftool-testsuite [1] and merge it into perf-test.
The perftool-testsuite originates back to 2015, when there were no
shell-based testcases for perf. At that point, perf-test contained
rather "unit-tests" and there was a need to test perf as a tool too.
Nowadays, as perf-test contains shell tests too, it might make sense
to merge it in...
Apart from ~ 70 test scripts covering quite a lot of perf functionality,
it also brings design patterns that I consider advanced and useful:
1) A possibility to keep logs and temp files for later fail
investigation. This is necessary when the tests are running
on machines that are immediately reinstalled and reused after
the testrun. With the logs, many fails are easily narrowed
down even when not having the machine online. Having variable
PERFTEST_KEEP_LOGS=y keeps the logs in /tmp/.
2) High level of configurability allows it to be run in deeper,
thorough mode, as well as an "smoke testing" CI mode. Also,
switching to different loads measured by perf is easy, just
by setting CMD_SIMPLE (defaults to command `true`) to a
user-defined application.
3) Multi-level structure of the tests and subtests -- the tests
are organized by perf-subcommands, test scripts and subtests
within the scripts. Everything is reported in the results,
when verbose output is enabled, so it is clear that e.g.
perf-report failed due to preceding perf-record hadn't get
samples, etc...
4) Shared/unified result checking helpers and regular expressions
The perftool-testsuite is widely used at Red Hat for testing perf,
as far as I know, there are some users also outside of Red Hat,
but merging it into perf-test will help it spread and increase
the test coverage where it's still not known.
My plan is to move the whole testsuite under perf-test, respecting
both structures, as one perf-test "entry" per the perftool-testsuite's
"base_*" directory. Later possibly to align other shell tests with
it.
[1] https://github.com/rfmvh/perftool-testsuite
========================
This is a v2 of the patchset, addressing the following issues:
- shellcheck warnings
- fixed regular expressions RE_LINE_TRACE_*, although they
are not used yet
- missing cover-letter
========================
Michael Petlan (1):
perf testsuite: Install kprobe tests and common files
Veronika Molnarova (6):
perf testsuite: Add common regex patters
perf testsuite: Add common setting for shell tests
perf testsuite: Add initialization script for shell tests
perf testsuite: Add test case for perf probe
perf testsuite: Add common output checking helpers
perf testsuite: Add test for kprobe handling
tools/perf/Makefile.perf | 5 +
tools/perf/tests/shell/base_probe/settings.sh | 48 +++
.../shell/base_probe/test_adding_kernel.sh | 278 ++++++++++++++++++
.../shell/common/check_all_lines_matched.pl | 39 +++
.../shell/common/check_all_patterns_found.pl | 34 +++
.../shell/common/check_no_patterns_found.pl | 34 +++
tools/perf/tests/shell/common/init.sh | 117 ++++++++
tools/perf/tests/shell/common/patterns.sh | 268 +++++++++++++++++
tools/perf/tests/shell/common/settings.sh | 79 +++++
.../tests/shell/perftool-testsuite_probe.sh | 23 ++
10 files changed, 925 insertions(+)
create mode 100644 tools/perf/tests/shell/base_probe/settings.sh
create mode 100755 tools/perf/tests/shell/base_probe/test_adding_kernel.sh
create mode 100755 tools/perf/tests/shell/common/check_all_lines_matched.pl
create mode 100755 tools/perf/tests/shell/common/check_all_patterns_found.pl
create mode 100755 tools/perf/tests/shell/common/check_no_patterns_found.pl
create mode 100644 tools/perf/tests/shell/common/init.sh
create mode 100644 tools/perf/tests/shell/common/patterns.sh
create mode 100644 tools/perf/tests/shell/common/settings.sh
create mode 100755 tools/perf/tests/shell/perftool-testsuite_probe.sh
--
2.43.0
next prev parent reply other threads:[~2024-02-15 11:02 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 11:39 [PATCH 1/7] perf testsuite: Add common regex patters Michael Petlan
2024-01-31 11:39 ` [PATCH 2/7] perf testsuite: Add common setting for shell tests Michael Petlan
2024-01-31 11:39 ` [PATCH 3/7] perf testsuite: Add initialization script " Michael Petlan
2024-01-31 11:39 ` [PATCH 4/7] perf testsuite: Add test case for perf probe Michael Petlan
2024-01-31 11:39 ` [PATCH 5/7] perf testsuite: Add common output checking helpers Michael Petlan
2024-01-31 11:39 ` [PATCH 6/7] perf testsuite: Add test for kprobe handling Michael Petlan
2024-01-31 11:39 ` [PATCH 7/7] perf testsuite: Install kprobe tests and common files Michael Petlan
2024-01-31 13:47 ` [PATCH 1/7] perf testsuite: Add common regex patters Arnaldo Carvalho de Melo
2024-01-31 13:53 ` Arnaldo Carvalho de Melo
2024-02-01 23:59 ` Namhyung Kim
2024-02-02 0:05 ` Namhyung Kim
2024-02-08 16:49 ` Michael Petlan
2024-02-09 7:13 ` Namhyung Kim
2024-02-09 22:56 ` Namhyung Kim
2024-02-15 11:02 ` Michael Petlan [this message]
2024-02-15 11:02 ` [PATCH v2 " Michael Petlan
2024-02-15 11:02 ` [PATCH v2 2/7] perf testsuite: Add common setting for shell tests Michael Petlan
2024-02-15 11:02 ` [PATCH v2 3/7] perf testsuite: Add initialization script " Michael Petlan
2024-02-15 11:02 ` [PATCH v2 4/7] perf testsuite: Add test case for perf probe Michael Petlan
2024-02-15 11:02 ` [PATCH v2 5/7] perf testsuite: Add common output checking helpers Michael Petlan
2024-02-15 11:02 ` [PATCH v2 6/7] perf testsuite: Add test for kprobe handling Michael Petlan
2024-02-15 11:02 ` [PATCH v2 7/7] perf testsuite: Install kprobe tests and common files Michael Petlan
2024-02-21 1:58 ` [PATCH v2 0/7] Add perf testsuite into perf-test Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240215110231.15385-1-mpetlan@redhat.com \
--to=mpetlan@redhat.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=atrajeev@linux.vnet.ibm.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kjain@linux.ibm.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).