Skip to content

Commit 35f6c58

Browse files
committed
WIP: Num of WB-unprotected objs in eBPF timeline
Show the number of WB-unprotected objects before and after processin the WB-unprotected object list in the eBPF timeline.
1 parent ff09d4b commit 35f6c58

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

mmtk/src/weak_proc.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,9 @@ impl GCWork<Ruby> for UpdateWbUnprotectedObjectsList {
440440
);
441441

442442
let old_objects = std::mem::take(&mut *objects);
443+
let old_size = old_objects.len();
443444

444-
debug!("Updating {} WB-unprotected objects", old_objects.len());
445+
debug!("Updating {old_size} WB-unprotected objects");
445446

446447
for object in old_objects {
447448
if object.is_reachable() {
@@ -458,7 +459,10 @@ impl GCWork<Ruby> for UpdateWbUnprotectedObjectsList {
458459
}
459460
}
460461

461-
debug!("Retained {} live WB-unprotected objects.", objects.len());
462+
let new_size = objects.len();
463+
debug!("Retained {new_size} live WB-unprotected objects.");
464+
465+
probe!(mmtk_ruby, update_wb_unprotected_objects_list, old_size, new_size);
462466
}
463467
}
464468

tools/tracing/timeline/capture_ruby.bt

+6
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,9 @@ usdt:$MMTK:mmtk_ruby:process_obj_free_candidates {
6363
printf("process_obj_free_candidates,meta,%d,%lu,%lu,%lu\n", tid, nsecs, arg0, arg1);
6464
}
6565
}
66+
67+
usdt:$MMTK:mmtk_ruby:update_wb_unprotected_objects_list {
68+
if (@enable_print) {
69+
printf("update_wb_unprotected_objects_list,meta,%d,%lu,%lu,%lu\n", tid, nsecs, arg0, arg1);
70+
}
71+
}

tools/tracing/timeline/visualize_ruby.py

+10
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,13 @@ def enrich_meta_extra(log_processor, name, tid, ts, gc, wp, args):
125125
"diff": new_candidates - old_candidates,
126126
},
127127
}
128+
129+
case "update_wb_unprotected_objects_list":
130+
before, after = [int(x) for x in args[0:2]]
131+
wp["args"] |= {
132+
"wb_unprotected_objects": {
133+
"before": before,
134+
"after": after,
135+
"diff": after - before,
136+
},
137+
}

0 commit comments

Comments
 (0)