Skip to content

Commit a0918a4

Browse files
committed
RJIT: Get rid of verbose logging
1 parent 7d7b67a commit a0918a4

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

rjit.c

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,6 @@ bool rjit_call_p = false;
7474
// A flag to communicate that rjit_call_p should be disabled while it's temporarily false.
7575
bool rjit_cancel_p = false;
7676

77-
// Print the arguments according to FORMAT to stderr only if RJIT
78-
// verbose option value is more or equal to LEVEL.
79-
PRINTF_ARGS(static void, 2, 3)
80-
verbose(int level, const char *format, ...)
81-
{
82-
if (rjit_opts.verbose >= level) {
83-
va_list args;
84-
size_t len = strlen(format);
85-
char *full_format = alloca(sizeof(char) * (len + 2));
86-
87-
// Creating `format + '\n'` to atomically print format and '\n'.
88-
memcpy(full_format, format, len);
89-
full_format[len] = '\n';
90-
full_format[len+1] = '\0';
91-
92-
va_start(args, format);
93-
vfprintf(stderr, full_format, args);
94-
va_end(args);
95-
}
96-
}
97-
9877
void
9978
rb_rjit_cancel_all(const char *reason)
10079
{
@@ -103,9 +82,6 @@ rb_rjit_cancel_all(const char *reason)
10382

10483
rjit_call_p = false;
10584
rjit_cancel_p = true;
106-
if (rjit_opts.warnings || rjit_opts.verbose) {
107-
fprintf(stderr, "JIT cancel: Disabled JIT-ed code because %s\n", reason);
108-
}
10985
}
11086

11187
void
@@ -509,7 +485,7 @@ rjit_init(const struct rjit_options *opts)
509485
// RJIT doesn't support miniruby, but it might reach here by RJIT_FORCE_ENABLE.
510486
rb_mRJIT = rb_const_get(rb_cRubyVM, rb_intern("RJIT"));
511487
if (!rb_const_defined(rb_mRJIT, rb_intern("Compiler"))) {
512-
verbose(1, "Disabling RJIT because RubyVM::RJIT::Compiler is not defined");
488+
rb_warn("Disabling RJIT because RubyVM::RJIT::Compiler is not defined");
513489
rjit_enabled = false;
514490
return;
515491
}
@@ -529,7 +505,7 @@ rjit_init(const struct rjit_options *opts)
529505
rjit_opts.call_threshold = DEFAULT_CALL_THRESHOLD;
530506
#ifndef HAVE_LIBCAPSTONE
531507
if (rjit_opts.dump_disasm)
532-
verbose(1, "libcapstone has not been linked. Ignoring --rjit-dump-disasm.");
508+
rb_warn("libcapstone has not been linked. Ignoring --rjit-dump-disasm.");
533509
#endif
534510
}
535511

0 commit comments

Comments
 (0)