diff options
Diffstat (limited to 'tools/perf/tests/shell/lib')
| -rw-r--r-- | tools/perf/tests/shell/lib/perf_json_output_lint.py | 9 | ||||
| -rw-r--r-- | tools/perf/tests/shell/lib/stat_output.sh | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/tools/perf/tests/shell/lib/perf_json_output_lint.py b/tools/perf/tests/shell/lib/perf_json_output_lint.py index c6750ef06c0f..dafbde56cc76 100644 --- a/tools/perf/tests/shell/lib/perf_json_output_lint.py +++ b/tools/perf/tests/shell/lib/perf_json_output_lint.py @@ -43,6 +43,9 @@ def isint(num): def is_counter_value(num): return isfloat(num) or num == '<not counted>' or num == '<not supported>' +def is_metric_value(num): + return isfloat(num) or num == 'none' + def check_json_output(expected_items): checks = { 'counters': lambda x: isfloat(x), @@ -57,7 +60,7 @@ def check_json_output(expected_items): 'event-runtime': lambda x: isfloat(x), 'interval': lambda x: isfloat(x), 'metric-unit': lambda x: True, - 'metric-value': lambda x: isfloat(x), + 'metric-value': lambda x: is_metric_value(x), 'metric-threshold': lambda x: x in ['unknown', 'good', 'less good', 'nearly bad', 'bad'], 'metricgroup': lambda x: True, 'node': lambda x: True, @@ -65,8 +68,6 @@ def check_json_output(expected_items): 'socket': lambda x: True, 'thread': lambda x: True, 'unit': lambda x: True, - 'insn per cycle': lambda x: isfloat(x), - 'GHz': lambda x: True, # FIXME: it seems unintended for --metric-only } input = '[\n' + ','.join(Lines) + '\n]' for item in json.loads(input): @@ -88,6 +89,8 @@ def check_json_output(expected_items): f' in \'{item}\'') for key, value in item.items(): if key not in checks: + if args.metric_only: + continue raise RuntimeError(f'Unexpected key: key={key} value={value}') if not checks[key](value): raise RuntimeError(f'Check failed for: key={key} value={value}') diff --git a/tools/perf/tests/shell/lib/stat_output.sh b/tools/perf/tests/shell/lib/stat_output.sh index c2ec7881ec1d..3c36e80fe422 100644 --- a/tools/perf/tests/shell/lib/stat_output.sh +++ b/tools/perf/tests/shell/lib/stat_output.sh @@ -156,7 +156,7 @@ check_metric_only() echo "[Skip] CPU-measurement counter facility not installed" return fi - perf stat --metric-only $2 -e instructions,cycles true + perf stat --metric-only $2 -M page_faults_per_second true commachecker --metric-only echo "[Success]" } |
