summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/benchmark.py4
-rwxr-xr-xtools/benchmark_test.py11
-rw-r--r--tools/testdata/strace_summary2.out37
3 files changed, 52 insertions, 0 deletions
diff --git a/tools/benchmark.py b/tools/benchmark.py
index 507e7cc6d..2a1310a39 100755
--- a/tools/benchmark.py
+++ b/tools/benchmark.py
@@ -89,6 +89,10 @@ def strace_parse(summary_text):
summary = {}
# clear empty lines
lines = list(filter(lambda x: x and x != "\n", summary_text.split("\n")))
+ # Filter out non-relevant lines. See the error log at
+ # https://github.com/denoland/deno/pull/3715/checks?check_run_id=397365887
+ # This is checked in tools/testdata/strace_summary2.out
+ lines = [x for x in lines if x.find("detached ...") == -1]
if len(lines) < 4:
return {} # malformed summary
lines, total_line = lines[2:-2], lines[-1]
diff --git a/tools/benchmark_test.py b/tools/benchmark_test.py
index d0140c52c..2c1f384da 100755
--- a/tools/benchmark_test.py
+++ b/tools/benchmark_test.py
@@ -24,6 +24,17 @@ class TestBenchmark(DenoTestCase):
# summary line
assert summary["total"]["calls"] == 704
+ def test_strace_parse2(self):
+ with open(
+ os.path.join(sys.path[0], "testdata/strace_summary2.out"),
+ "r") as f:
+ summary = benchmark.strace_parse(f.read())
+ # first syscall line
+ assert summary["futex"]["calls"] == 449
+ assert summary["futex"]["errors"] == 94
+ # summary line
+ assert summary["total"]["calls"] == 821
+
def test_max_mem_parse(self):
with open(os.path.join(sys.path[0], "testdata/time.out"), "r") as f:
data = f.read()
diff --git a/tools/testdata/strace_summary2.out b/tools/testdata/strace_summary2.out
new file mode 100644
index 000000000..798a06665
--- /dev/null
+++ b/tools/testdata/strace_summary2.out
@@ -0,0 +1,37 @@
+17697 ????( <detached ...>
+% time seconds usecs/call calls errors syscall
+------ ----------- ----------- --------- --------- ----------------
+ 63.19 0.030363 68 449 94 futex
+ 34.70 0.016672 16672 1 epoll_wait
+ 1.58 0.000761 6 129 mprotect
+ 0.40 0.000193 3 58 madvise
+ 0.11 0.000055 3 17 brk
+ 0.01 0.000003 0 32 mmap
+ 0.00 0.000000 0 20 1 read
+ 0.00 0.000000 0 1 write
+ 0.00 0.000000 0 14 open
+ 0.00 0.000000 0 17 close
+ 0.00 0.000000 0 10 fstat
+ 0.00 0.000000 0 10 munmap
+ 0.00 0.000000 0 5 rt_sigaction
+ 0.00 0.000000 0 1 rt_sigprocmask
+ 0.00 0.000000 0 4 4 ioctl
+ 0.00 0.000000 0 8 8 access
+ 0.00 0.000000 0 6 sched_yield
+ 0.00 0.000000 0 3 clone
+ 0.00 0.000000 0 1 execve
+ 0.00 0.000000 0 3 fcntl
+ 0.00 0.000000 0 5 getcwd
+ 0.00 0.000000 0 2 getrlimit
+ 0.00 0.000000 0 9 sigaltstack
+ 0.00 0.000000 0 3 prctl
+ 0.00 0.000000 0 1 arch_prctl
+ 0.00 0.000000 0 3 sched_getaffinity
+ 0.00 0.000000 0 1 set_tid_address
+ 0.00 0.000000 0 1 epoll_ctl
+ 0.00 0.000000 0 4 set_robust_list
+ 0.00 0.000000 0 1 epoll_create1
+ 0.00 0.000000 0 1 pipe2
+ 0.00 0.000000 0 1 getrandom
+------ ----------- ----------- --------- --------- ----------------
+100.00 0.048047 821 107 total