mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] perf tests kwork: Add basic kwork coverage tests
@ 2025-12-09 17:08 Ian Rogers
  2026-04-01  5:16 ` Ian Rogers
  2026-04-04  0:15 ` Namhyung Kim
  0 siblings, 2 replies; 3+ messages in thread
From: Ian Rogers @ 2025-12-09 17:08 UTC (permalink / raw)
  To: Feng Yang, Yang Jihong, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Alexander Shishkin,
	Jiri Olsa, Ian Rogers, Adrian Hunter, linux-kernel,
	linux-perf-users

Add basic kwork coverage tests for record, report, latency, timehist
and top.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/tests/shell/kwork.sh | 79 +++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
 create mode 100755 tools/perf/tests/shell/kwork.sh

diff --git a/tools/perf/tests/shell/kwork.sh b/tools/perf/tests/shell/kwork.sh
new file mode 100755
index 000000000000..42bfd9382816
--- /dev/null
+++ b/tools/perf/tests/shell/kwork.sh
@@ -0,0 +1,79 @@
+#!/bin/bash
+# perf kwork tests
+# SPDX-License-Identifier: GPL-2.0
+
+set -e
+
+# Root permissions required for tracing events.
+if [ "$(id -u)" != 0 ]; then
+	echo "[Skip] No root permission"
+	exit 2
+fi
+
+err=0
+perfdata=$(mktemp /tmp/__perf_test_kwork.perf.data.XXXXX)
+
+cleanup() {
+	rm -f "${perfdata}"
+	rm -f "${perfdata}".old
+
+	trap - EXIT TERM INT
+}
+
+trap_cleanup() {
+	echo "Unexpected signal in ${FUNCNAME[1]}"
+	cleanup
+	exit 1
+}
+trap trap_cleanup EXIT TERM INT
+
+test_kwork_record() {
+	echo "Kwork record"
+	perf kwork record -o "${perfdata}" -- sleep 1
+	echo "Kwork record [Success]"
+}
+
+test_kwork_report() {
+	echo "Kwork report"
+	if ! perf kwork report -i "${perfdata}" | grep -q "Kwork Name"; then
+		echo "Kwork report [Failed missing output]"
+		err=1
+	fi
+	echo "Kwork report [Success]"
+}
+
+test_kwork_latency() {
+	echo "Kwork latency"
+	if ! perf kwork latency -i "${perfdata}" | grep -q "Avg delay"; then
+		echo "Kwork latency [Failed missing output]"
+		err=1
+	fi
+	echo "Kwork latency [Success]"
+}
+
+test_kwork_timehist() {
+	echo "Kwork timehist"
+	if ! perf kwork timehist -i "${perfdata}" | grep -q "Kwork name"; then
+		echo "Kwork timehist [Failed missing output]"
+		err=1
+	fi
+	echo "Kwork timehist [Success]"
+}
+
+test_kwork_top() {
+	echo "Kwork top"
+	if ! perf kwork top -i "${perfdata}" | grep -q "COMMAND"; then
+		echo "Kwork top [Failed missing output]"
+		err=1
+	fi
+	echo "Kwork top [Success]"
+}
+
+test_kwork_record
+test_kwork_report
+test_kwork_latency
+test_kwork_timehist
+test_kwork_top
+
+cleanup
+exit $err
-- 
2.52.0.223.gf5cc29aaa4-goog


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] perf tests kwork: Add basic kwork coverage tests
  2025-12-09 17:08 [PATCH v1] perf tests kwork: Add basic kwork coverage tests Ian Rogers
@ 2026-04-01  5:16 ` Ian Rogers
  2026-04-04  0:15 ` Namhyung Kim
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Rogers @ 2026-04-01  5:16 UTC (permalink / raw)
  To: Feng Yang, Yang Jihong, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Alexander Shishkin,
	Jiri Olsa, Ian Rogers, Adrian Hunter, linux-kernel,
	linux-perf-users

On Tue, Dec 9, 2025 at 9:08 AM Ian Rogers <irogers@google.com> wrote:
>
> Add basic kwork coverage tests for record, report, latency, timehist
> and top.
>
> Signed-off-by: Ian Rogers <irogers@google.com>

Ping.

Thanks,
Ian

> ---
>  tools/perf/tests/shell/kwork.sh | 79 +++++++++++++++++++++++++++++++++
>  1 file changed, 79 insertions(+)
>  create mode 100755 tools/perf/tests/shell/kwork.sh
>
> diff --git a/tools/perf/tests/shell/kwork.sh b/tools/perf/tests/shell/kwork.sh
> new file mode 100755
> index 000000000000..42bfd9382816
> --- /dev/null
> +++ b/tools/perf/tests/shell/kwork.sh
> @@ -0,0 +1,79 @@
> +#!/bin/bash
> +# perf kwork tests
> +# SPDX-License-Identifier: GPL-2.0
> +
> +set -e
> +
> +# Root permissions required for tracing events.
> +if [ "$(id -u)" != 0 ]; then
> +       echo "[Skip] No root permission"
> +       exit 2
> +fi
> +
> +err=0
> +perfdata=$(mktemp /tmp/__perf_test_kwork.perf.data.XXXXX)
> +
> +cleanup() {
> +       rm -f "${perfdata}"
> +       rm -f "${perfdata}".old
> +
> +       trap - EXIT TERM INT
> +}
> +
> +trap_cleanup() {
> +       echo "Unexpected signal in ${FUNCNAME[1]}"
> +       cleanup
> +       exit 1
> +}
> +trap trap_cleanup EXIT TERM INT
> +
> +test_kwork_record() {
> +       echo "Kwork record"
> +       perf kwork record -o "${perfdata}" -- sleep 1
> +       echo "Kwork record [Success]"
> +}
> +
> +test_kwork_report() {
> +       echo "Kwork report"
> +       if ! perf kwork report -i "${perfdata}" | grep -q "Kwork Name"; then
> +               echo "Kwork report [Failed missing output]"
> +               err=1
> +       fi
> +       echo "Kwork report [Success]"
> +}
> +
> +test_kwork_latency() {
> +       echo "Kwork latency"
> +       if ! perf kwork latency -i "${perfdata}" | grep -q "Avg delay"; then
> +               echo "Kwork latency [Failed missing output]"
> +               err=1
> +       fi
> +       echo "Kwork latency [Success]"
> +}
> +
> +test_kwork_timehist() {
> +       echo "Kwork timehist"
> +       if ! perf kwork timehist -i "${perfdata}" | grep -q "Kwork name"; then
> +               echo "Kwork timehist [Failed missing output]"
> +               err=1
> +       fi
> +       echo "Kwork timehist [Success]"
> +}
> +
> +test_kwork_top() {
> +       echo "Kwork top"
> +       if ! perf kwork top -i "${perfdata}" | grep -q "COMMAND"; then
> +               echo "Kwork top [Failed missing output]"
> +               err=1
> +       fi
> +       echo "Kwork top [Success]"
> +}
> +
> +test_kwork_record
> +test_kwork_report
> +test_kwork_latency
> +test_kwork_timehist
> +test_kwork_top
> +
> +cleanup
> +exit $err
> --
> 2.52.0.223.gf5cc29aaa4-goog
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] perf tests kwork: Add basic kwork coverage tests
  2025-12-09 17:08 [PATCH v1] perf tests kwork: Add basic kwork coverage tests Ian Rogers
  2026-04-01  5:16 ` Ian Rogers
@ 2026-04-04  0:15 ` Namhyung Kim
  1 sibling, 0 replies; 3+ messages in thread
From: Namhyung Kim @ 2026-04-04  0:15 UTC (permalink / raw)
  To: Feng Yang, Yang Jihong, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Adrian Hunter, linux-kernel, linux-perf-users, Ian Rogers

On Tue, 09 Dec 2025 09:08:11 -0800, Ian Rogers wrote:
> Add basic kwork coverage tests for record, report, latency, timehist
> and top.
> 
> 
Applied to perf-tools-next, thanks!

Best regards,
Namhyung



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-04  0:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-09 17:08 [PATCH v1] perf tests kwork: Add basic kwork coverage tests Ian Rogers
2026-04-01  5:16 ` Ian Rogers
2026-04-04  0:15 ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®