Skip to content

Commit 2c66343

Browse files
captain5050namhyung
authored andcommitted
perf test: Avoid list test blocking on writing to stdout
Python's json.tool will output the input json to stdout. Redirect to /dev/null to avoid blocking on stdout writes. Tested-by: James Clark <[email protected]> Signed-off-by: Ian Rogers <[email protected]> Cc: Colin Ian King <[email protected]> Cc: Howard Chu <[email protected]> Cc: Weilin Wang <[email protected]> Cc: Ilya Leoshkevich <[email protected]> Cc: Thomas Richter <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Dapeng Mi <[email protected]> Cc: Athira Jajeev <[email protected]> Cc: Michael Petlan <[email protected]> Cc: Veronika Molnarova <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent d50318f commit 2c66343

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/perf/tests/shell/list.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ trap trap_cleanup EXIT TERM INT
2424

2525
test_list_json() {
2626
echo "Json output test"
27+
# Generate perf list json output into list_output file.
2728
perf list -j -o "${list_output}"
28-
$PYTHON -m json.tool "${list_output}"
29+
# Validate the json using python, redirect the json copy to /dev/null as
30+
# otherwise the test may block writing to stdout.
31+
$PYTHON -m json.tool "${list_output}" /dev/null
2932
echo "Json output test [Success]"
3033
}
3134

0 commit comments

Comments
 (0)