Skip to content

Commit f05ba6e

Browse files
committed
Introduce the DTrace scripts used to measure the performance in
the project.
1 parent 8c31db7 commit f05ba6e

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
ebin
44
*.beam
55
*.o
6-
*.d
76
*.eqc
87
*.so
98
eqc_test/.eqc-info

bench/enacl_nif.d

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* Dirty NIF schedule overhead */
2+
pid$target:beam.smp:schedule_dirty_cpu_nif:return
3+
{
4+
s = timestamp;
5+
}
6+
7+
pid$target:libsodium.so.*:randombytes:entry {
8+
e = timestamp;
9+
}
10+
11+
pid$target:beam.smp:execute_dirty_nif:entry
12+
/s != 0/
13+
{
14+
@SchedTime = lquantize(timestamp - s, 0, 10000, 250);
15+
s = 0;
16+
}
17+
18+
pid$target:beam.smp:execute_dirty_nif:return
19+
{
20+
@ExecTime = lquantize(timestamp - e, 0, 10000, 250);
21+
e = 0;
22+
r = timestamp;
23+
}
24+
25+
pid$target:beam.smp:dirty_nif_finalizer:entry
26+
/r != 0/
27+
{
28+
@ReturnTime = lquantize(timestamp - r, 0, 10000, 250);
29+
r = 0;
30+
}
31+
32+
END
33+
{
34+
printa("Scheduling overhead (nanos):%@d\n", @SchedTime);
35+
printa("Return overhead (nanos):%@d\n", @ReturnTime);
36+
printa("Exec time (nanos):%@d\n", @ExecTime);
37+
}

bench/funcall_enacl.d

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
erlang*:::nif-entry
2+
{
3+
funcall_entry_ts[cpu, copyinstr(arg1)] = vtimestamp;
4+
}
5+
6+
erlang*:::nif-return
7+
{
8+
@time[cpu, copyinstr(arg1)] = lquantize((vtimestamp - funcall_entry_ts[cpu, copyinstr(arg1)] ), 0, 60000, 1000);
9+
}

0 commit comments

Comments
 (0)