From 9ade27c5cac33623f49923833b05425e2ed48b75 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Tue, 30 Jul 2019 17:48:31 -0400 Subject: [PATCH] bt2 benchmark: parsers must be defined first Signed-off-by: Jonathan Rajotte --- scripts/babeltrace-benchmark/time.py | 51 ++++++++++++++-------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/scripts/babeltrace-benchmark/time.py b/scripts/babeltrace-benchmark/time.py index e1506a8..7bf5171 100644 --- a/scripts/babeltrace-benchmark/time.py +++ b/scripts/babeltrace-benchmark/time.py @@ -21,31 +21,6 @@ import tempfile import json from collections import defaultdict -_METRIC = { - "User time (seconds)": float, - "System time (seconds)": float, - "Percent of CPU this job got": percent_parser, - "Elapsed (wall clock) time (h:mm:ss or m:ss)": wall_clock_parser, - "Average shared text size (kbytes)": int, - "Average unshared data size (kbytes)": int, - "Average stack size (kbytes)": int, - "Average total size (kbytes)": int, - "Maximum resident set size (kbytes)": int, - "Average resident set size (kbytes)": int, - "Major (requiring I/O) page faults": int, - "Minor (reclaiming a frame) page faults": int, - "Voluntary context switches": int, - "Involuntary context switches": int, - "Swaps": int, - "File system inputs": int, - "File system outputs": int, - "Socket messages sent": int, - "Socket messages received": int, - "Signals delivered": int, - "Page size (bytes)": int, -} - - def wall_clock_parser(value): """ Parse /usr/bin/time wall clock value. @@ -82,6 +57,32 @@ def percent_parser(value): return 0 +_METRIC = { + "User time (seconds)": float, + "System time (seconds)": float, + "Percent of CPU this job got": percent_parser, + "Elapsed (wall clock) time (h:mm:ss or m:ss)": wall_clock_parser, + "Average shared text size (kbytes)": int, + "Average unshared data size (kbytes)": int, + "Average stack size (kbytes)": int, + "Average total size (kbytes)": int, + "Maximum resident set size (kbytes)": int, + "Average resident set size (kbytes)": int, + "Major (requiring I/O) page faults": int, + "Minor (reclaiming a frame) page faults": int, + "Voluntary context switches": int, + "Involuntary context switches": int, + "Swaps": int, + "File system inputs": int, + "File system outputs": int, + "Socket messages sent": int, + "Socket messages received": int, + "Signals delivered": int, + "Page size (bytes)": int, +} + + + def parse(path, results): """ Parser and accumulator for /usr/bin/time results. -- 2.34.1