forked from mmtk/mmtk-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvisualize_ruby.py
executable file
·30 lines (27 loc) · 1.23 KB
/
visualize_ruby.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python3
def enrich_meta_extra(log_processor, name, tid, ts, gc, wp, args):
if wp is not None:
match name:
case "pin_ppp_children":
num_ppps, num_no_longer_ppps, num_pinned_children = [int(x) for x in args]
num_still_ppps = num_ppps - num_no_longer_ppps
wp["args"] |= {
"num_ppps": num_ppps,
"num_no_longer_ppps": num_no_longer_ppps,
"num_still_ppps": num_still_ppps,
"num_pinned_children": num_pinned_children,
}
case "remove_dead_ppps":
num_ppps, num_no_longer_ppps, num_dead_ppps = [int(x) for x in args]
num_retained_ppps = num_ppps - num_no_longer_ppps - num_dead_ppps
wp["args"] |= {
"num_ppps": num_ppps,
"num_no_longer_ppps": num_no_longer_ppps,
"num_dead_ppps": num_dead_ppps,
"num_retained_ppps": num_retained_ppps,
}
case "unpin_ppp_children":
num_children = int(args[0])
wp["args"] |= {
"num_ppp_children": num_children,
}