From 854baee2c936006d7f38ebb27ee577c00afc6249 Mon Sep 17 00:00:00 2001 From: Adam Hess Date: Thu, 13 Apr 2023 07:07:07 -0700 Subject: YJIT: Add a sampling option to exit tracing (#7693) Add a sampling option to trace exits Running YJIT with trace exits enabled can make very large metrics files. This allows us to configure a sample rate to make tracing exits possible on larger tests. This also updates the documented YJIT options. Co-authored-by: Alan Wu Co-authored-by: John Hawthorn Co-authored-by: Maxime Chevalier-Boisvert --- ruby.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'ruby.c') diff --git a/ruby.c b/ruby.c index 17a9ba68ac..b3a1c23712 100644 --- a/ruby.c +++ b/ruby.c @@ -334,11 +334,13 @@ usage(const char *name, int help, int highlight, int columns) }; #if USE_YJIT static const struct ruby_opt_message yjit_options[] = { - M("--yjit-stats", "", "Enable collecting YJIT statistics"), - M("--yjit-exec-mem-size=num", "", "Size of executable memory block in MiB (default: 64)"), - M("--yjit-call-threshold=num", "", "Number of calls to trigger JIT (default: 30)"), - M("--yjit-max-versions=num", "", "Maximum number of versions per basic block (default: 4)"), - M("--yjit-greedy-versioning", "", "Greedy versioning mode (default: disabled)"), + M("--yjit-stats", "", "Enable collecting YJIT statistics"), + M("--yjit-trace-exits", "", "Record Ruby source location when exiting from generated code"), + M("--yjit-trace-exits-sample-rate", "", "Trace exit locations only every Nth occurrence"), + M("--yjit-exec-mem-size=num", "", "Size of executable memory block in MiB (default: 64)"), + M("--yjit-call-threshold=num", "", "Number of calls to trigger JIT (default: 30)"), + M("--yjit-max-versions=num", "", "Maximum number of versions per basic block (default: 4)"), + M("--yjit-greedy-versioning", "", "Greedy versioning mode (default: disabled)"), }; #endif #if USE_RJIT -- cgit v1.2.3