diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-08-26 14:58:13 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:39 -0400 |
commit | 54db64f7a59f1f14b280a80491336a128f792b42 (patch) | |
tree | 10c897bde6a2d600a869e3982f2716f6062f1d21 /vm_trace.c | |
parent | 4b815abb373801b94d2471997f1467421620c1e5 (diff) | |
download | ruby-54db64f7a59f1f14b280a80491336a128f792b42.tar.gz |
filter out internal events. add comments. reorder
Diffstat (limited to 'vm_trace.c')
-rw-r--r-- | vm_trace.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/vm_trace.c b/vm_trace.c index d9f0cce563..c410b709b5 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -98,11 +98,16 @@ update_global_event_hook(rb_event_flag_t vm_events) rb_clear_attr_ccs(); } - yjit_tracing_invalidate_all(); - ruby_vm_event_flags = vm_events; ruby_vm_event_enabled_global_flags |= vm_events; rb_objspace_set_event_hook(vm_events); + + if (vm_events & RUBY_EVENT_TRACEPOINT_ALL) { + // Invalidate all code if listening for any TracePoint event. + // Internal events fire inside C routines so don't need special handling. + // Do this last so other ractors see updated vm events when they wake up. + yjit_tracing_invalidate_all(); + } } /* add/remove hooks */ |