Ruby
3.1.0dev(2021-09-10revisionb76ad15ed0da636161de0243c547ee1e6fc95681)
|
#include "eval_intern.h"
#include "internal.h"
#include "internal/hash.h"
#include "internal/symbol.h"
#include "iseq.h"
#include "mjit.h"
#include "ruby/debug.h"
#include "vm_core.h"
#include "ruby/ractor.h"
#include "builtin.h"
#include "trace_point.rbinc"
Go to the source code of this file.
Data Structures | |
struct | rb_event_hook_struct |
struct | rb_tp_struct |
struct | rb_postponed_job_struct |
struct | rb_workqueue_job |
Macros | |
#define | MAX_EVENT_NUM 32 |
#define | MATCH_ANY_FILTER_TH ((rb_thread_t *)1) |
#define | C(name, NAME) case RUBY_EVENT_##NAME: CONST_ID(id, #name); return id; |
#define | C(name, NAME) CONST_ID(id, #name); if (sym == ID2SYM(id)) return RUBY_EVENT_##NAME |
#define | MAX_POSTPONED_JOB 1000 |
#define | MAX_POSTPONED_JOB_SPECIAL_ADDITION 24 |
Typedefs | |
typedef struct rb_event_hook_struct | rb_event_hook_t |
typedef void(* | rb_event_hook_raw_arg_func_t) (VALUE data, const rb_trace_arg_t *arg) |
typedef struct rb_tp_struct | rb_tp_t |
typedef struct rb_postponed_job_struct | rb_postponed_job_t |
Enumerations | |
enum | postponed_job_register_result { PJRR_SUCCESS = 0, PJRR_FULL = 1, PJRR_INTERRUPTED = 2 } |
#define MATCH_ANY_FILTER_TH ((rb_thread_t *)1) |
Definition at line 226 of file vm_trace.c.
#define MAX_EVENT_NUM 32 |
Definition at line 53 of file vm_trace.c.
#define MAX_POSTPONED_JOB 1000 |
Definition at line 1558 of file vm_trace.c.
#define MAX_POSTPONED_JOB_SPECIAL_ADDITION 24 |
Definition at line 1559 of file vm_trace.c.
typedef void(* rb_event_hook_raw_arg_func_t) (VALUE data, const rb_trace_arg_t *arg) |
Definition at line 51 of file vm_trace.c.
typedef struct rb_event_hook_struct rb_event_hook_t |
typedef struct rb_postponed_job_struct rb_postponed_job_t |
typedef struct rb_tp_struct rb_tp_t |
Enumerator | |
---|---|
PJRR_SUCCESS | |
PJRR_FULL | |
PJRR_INTERRUPTED |
Definition at line 1575 of file vm_trace.c.
void Init_vm_postponed_job | ( | void | ) |
Definition at line 1567 of file vm_trace.c.
References ALLOC_N, GET_VM, MAX_POSTPONED_JOB, rb_vm_struct::postponed_job_buffer, and rb_vm_struct::postponed_job_index.
void Init_vm_trace | ( | void | ) |
Definition at line 1542 of file vm_trace.c.
References rb_define_global_function.
void rb_add_event_hook | ( | rb_event_hook_func_t | func, |
rb_event_flag_t | events, | ||
VALUE | data | ||
) |
Definition at line 168 of file vm_trace.c.
void rb_add_event_hook2 | ( | rb_event_hook_func_t | func, |
rb_event_flag_t | events, | ||
VALUE | data, | ||
rb_event_hook_flag_t | hook_flags | ||
) |
Definition at line 181 of file vm_trace.c.
void rb_clear_attr_ccs | ( | void | ) |
Definition at line 3431 of file iseq.c.
References rb_objspace_each_objects().
void rb_ec_clear_all_trace_func | ( | const rb_execution_context_t * | ec | ) |
Definition at line 290 of file vm_trace.c.
void rb_ec_clear_current_thread_trace_func | ( | const rb_execution_context_t * | ec | ) |
Definition at line 284 of file vm_trace.c.
Referenced by ruby_options().
void rb_exec_event_hooks | ( | rb_trace_arg_t * | trace_arg, |
rb_hook_list_t * | hooks, | ||
int | pop_p | ||
) |
Definition at line 372 of file vm_trace.c.
References rb_trace_arg_struct::ec, rb_trace_arg_struct::event, RUBY_INTERNAL_EVENT_MASK, rb_execution_context_struct::trace_arg, and UNLIKELY.
void rb_hook_list_connect_tracepoint | ( | VALUE | target, |
rb_hook_list_t * | list, | ||
VALUE | tpval, | ||
unsigned int | target_line | ||
) |
Definition at line 1269 of file vm_trace.c.
void rb_hook_list_free | ( | rb_hook_list_t * | hooks | ) |
Definition at line 69 of file vm_trace.c.
References rb_hook_list_struct::need_clean, and TRUE.
void rb_hook_list_mark | ( | rb_hook_list_t * | hooks | ) |
Definition at line 56 of file vm_trace.c.
References rb_event_hook_struct::data, rb_hook_list_struct::hooks, rb_event_hook_struct::next, and rb_gc_mark().
void rb_hook_list_remove_tracepoint | ( | rb_hook_list_t * | list, |
VALUE | tpval | ||
) |
Definition at line 1279 of file vm_trace.c.
References rb_event_hook_struct::data, rb_event_hook_struct::events, rb_hook_list_struct::events, rb_event_hook_struct::hook_flags, rb_hook_list_struct::hooks, rb_hook_list_struct::need_clean, rb_event_hook_struct::next, RUBY_EVENT_HOOK_FLAG_DELETED, and TRUE.
const rb_method_definition_t* rb_method_def | ( | VALUE | method | ) |
Definition at line 2816 of file proc.c.
References TypedData_Get_Struct.
void rb_postponed_job_flush | ( | rb_vm_t * | vm | ) |
Definition at line 1679 of file vm_trace.c.
References ATOMIC_CAS, rb_postponed_job_struct::data, EC_EXEC_TAG, EC_POP_TAG, EC_PUSH_TAG, rb_execution_context_struct::errinfo, free(), rb_postponed_job_struct::func, GET_EC, rb_execution_context_struct::interrupt_mask, rb_workqueue_job::jnode, rb_workqueue_job::job, rb_vm_struct::postponed_job_buffer, rb_vm_struct::postponed_job_index, POSTPONED_JOB_INTERRUPT_MASK, Qnil, rb_nativethread_lock_lock(), rb_nativethread_lock_unlock(), RUBY_VM_SET_POSTPONED_JOB_INTERRUPT, TAG_NONE, TRAP_INTERRUPT_MASK, rb_vm_struct::workqueue, and rb_vm_struct::workqueue_lock.
int rb_postponed_job_register | ( | unsigned int | flags, |
rb_postponed_job_func_t | func, | ||
void * | data | ||
) |
Definition at line 1611 of file vm_trace.c.
References GET_EC.
int rb_postponed_job_register_one | ( | unsigned int | flags, |
rb_postponed_job_func_t | func, | ||
void * | data | ||
) |
Definition at line 1630 of file vm_trace.c.
References GET_EC.
int rb_remove_event_hook | ( | rb_event_hook_func_t | func | ) |
Definition at line 272 of file vm_trace.c.
Referenced by rb_reset_coverages().
int rb_remove_event_hook_with_data | ( | rb_event_hook_func_t | func, |
VALUE | data | ||
) |
Definition at line 278 of file vm_trace.c.
Definition at line 425 of file vm_trace.c.
void rb_thread_add_event_hook | ( | VALUE | thval, |
rb_event_hook_func_t | func, | ||
rb_event_flag_t | events, | ||
VALUE | data | ||
) |
Definition at line 162 of file vm_trace.c.
void rb_thread_add_event_hook2 | ( | VALUE | thval, |
rb_event_hook_func_t | func, | ||
rb_event_flag_t | events, | ||
VALUE | data, | ||
rb_event_hook_flag_t | hook_flags | ||
) |
Definition at line 175 of file vm_trace.c.
int rb_thread_remove_event_hook | ( | VALUE | thval, |
rb_event_hook_func_t | func | ||
) |
Definition at line 260 of file vm_trace.c.
int rb_thread_remove_event_hook_with_data | ( | VALUE | thval, |
rb_event_hook_func_t | func, | ||
VALUE | data | ||
) |
Definition at line 266 of file vm_trace.c.
VALUE rb_tracearg_binding | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 928 of file vm_trace.c.
References rb_trace_arg_struct::cfp, rb_trace_arg_struct::ec, Qnil, rb_vm_get_binding_creatable_next_cfp(), and rb_vm_make_binding().
VALUE rb_tracearg_callee_id | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 914 of file vm_trace.c.
VALUE rb_tracearg_defined_class | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 921 of file vm_trace.c.
VALUE rb_tracearg_eval_script | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 978 of file vm_trace.c.
References rb_trace_arg_struct::data, rb_trace_arg_struct::event, Qundef, rb_bug(), rb_eRuntimeError, rb_raise(), and RUBY_EVENT_SCRIPT_COMPILED.
VALUE rb_tracearg_event | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 819 of file vm_trace.c.
References ID2SYM.
rb_event_flag_t rb_tracearg_event_flag | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 813 of file vm_trace.c.
References rb_trace_arg_struct::event.
struct rb_trace_arg_struct* rb_tracearg_from_tracepoint | ( | VALUE | tpval | ) |
Definition at line 807 of file vm_trace.c.
VALUE rb_tracearg_instruction_sequence | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 1002 of file vm_trace.c.
References rb_trace_arg_struct::data, rb_trace_arg_struct::event, Qundef, rb_bug(), rb_eRuntimeError, rb_raise(), and RUBY_EVENT_SCRIPT_COMPILED.
VALUE rb_tracearg_lineno | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 833 of file vm_trace.c.
VALUE rb_tracearg_method_id | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 907 of file vm_trace.c.
VALUE rb_tracearg_object | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 1029 of file vm_trace.c.
References rb_trace_arg_struct::data, rb_trace_arg_struct::event, Qundef, rb_bug(), rb_eRuntimeError, rb_raise(), RUBY_INTERNAL_EVENT_FREEOBJ, and RUBY_INTERNAL_EVENT_NEWOBJ.
VALUE rb_tracearg_parameters | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 867 of file vm_trace.c.
References rb_trace_arg_struct::cfp, rb_trace_arg_struct::ec, rb_trace_arg_struct::event, rb_vm_get_ruby_level_next_cfp(), RUBY_EVENT_B_CALL, RUBY_EVENT_B_RETURN, RUBY_EVENT_CALL, and RUBY_EVENT_RETURN.
VALUE rb_tracearg_path | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 839 of file vm_trace.c.
VALUE rb_tracearg_raised_exception | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 963 of file vm_trace.c.
References rb_trace_arg_struct::data, rb_trace_arg_struct::event, Qundef, rb_bug(), rb_eRuntimeError, rb_raise(), and RUBY_EVENT_RAISE.
VALUE rb_tracearg_return_value | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 948 of file vm_trace.c.
References rb_trace_arg_struct::data, rb_trace_arg_struct::event, Qundef, rb_bug(), rb_eRuntimeError, rb_raise(), RUBY_EVENT_B_RETURN, RUBY_EVENT_C_RETURN, and RUBY_EVENT_RETURN.
VALUE rb_tracearg_self | ( | rb_trace_arg_t * | trace_arg | ) |
Definition at line 942 of file vm_trace.c.
References rb_trace_arg_struct::self.
Definition at line 1244 of file vm_trace.c.
Definition at line 1136 of file vm_trace.c.
Definition at line 1358 of file vm_trace.c.
VALUE rb_tracepoint_new | ( | VALUE | target_thval, |
rb_event_flag_t | events, | ||
void(*)(VALUE, void *) | func, | ||
void * | data | ||
) |
Definition at line 1418 of file vm_trace.c.
int rb_workqueue_register | ( | unsigned | flags, |
rb_postponed_job_func_t | func, | ||
void * | data | ||
) |
Definition at line 1659 of file vm_trace.c.
References rb_postponed_job_struct::data, FALSE, rb_postponed_job_struct::func, GET_VM, rb_workqueue_job::jnode, rb_workqueue_job::job, malloc, rb_nativethread_lock_lock(), rb_nativethread_lock_unlock(), rb_vm_main_ractor_ec(), RUBY_VM_SET_POSTPONED_JOB_INTERRUPT, TRUE, rb_vm_struct::workqueue, and rb_vm_struct::workqueue_lock.