Skip to content

Instantly share code, notes, and snippets.

View abbysmal's full-sized avatar
🌴
On vacation

Abi abbysmal

🌴
On vacation
View GitHub Profile

[RFC] Eventlog tracing system

Multicore OCaml includes an event tracing system that act as a GC profiling tool for the development effort on the multicore runtime.

Inspired by GHC's ThreadScope, the idea is provide a low-overhead framework to collect runtime events and statistics, and process them offline in order to profile and debug performance problems.

Multicore OCaml emit such event traces in a format compatible with the

.L111:
.loc 3 562 0
movq -16(%rbp), %rax
andb $252, %ah
movq %rax, %rdx
movq -8(%rbp), %rax
movq %rdx, (%rax)
.loc 3 563 0
nop
jmp .L102
# The main loop condition
.L108:
.loc 3 542 0
testq %r13, %r13
jg .L111
[...]
# the if condition checking to load next memory chunk on chunk boundary
.L103:
.loc 3 567 0
@@ -464,6 +464,7 @@
Removing basic block 19
Removing basic block 20
Removing basic block 21
+__attribute__((optimize (1, "tree-vrp", "no-strict-aliasing", "wrapv")))
sweep_slice (intnat work)
{
void (*<T7fc>) (value) final_fun;
@@ -494,7 +495,7 @@
while (work > 0){
if (caml_gc_sweep_hp < limit){
hp = caml_gc_sweep_hp;
hd = Hd_hp (hp);
work -= Whsize_hd (hd);
caml_gc_sweep_hp += Bhsize_hd (hd);
switch (Color_hd (hd)){
case Caml_white:
if (Tag_hd (hd) == Custom_tag){
This file has been truncated, but you can view the full file.
module I1 = struct type i2 = int;; let p3 = Extprot.Pretty_print.pp_int;; end;;
module I4 = struct type i5 = string;; let p6 = Extprot.Pretty_print.pp_string;; end;;
module L7 = struct type l8 = string;; let p9 = Extprot.Pretty_print.pp_string;; end;;
module S10 = struct type s11 = string;; let p12 = Extprot.Pretty_print.pp_string;; end;;
module S13 =
struct
type s14 = S10.s11 list;;
let p15 = Extprot.Pretty_print.pp_list S10.p12;;
end;;

Keybase proof

I hereby claim:

  • I am engil on github.
  • I am engil (https://keybase.io/engil) on keybase.
  • I have a public key whose fingerprint is 9892 1F6C 5126 BE3A AA6D 88FD 3AEA 7895 56B9 990B

To claim this, I am signing this object: