Skip to content

Commit

Permalink
Merge pull request #1586 from ltratt/ykd_log
Browse files Browse the repository at this point in the history
Rename `YK_LOG` to `YKD_LOG`.
  • Loading branch information
vext01 authored Feb 6, 2025
2 parents bb0bce8 + 375fecc commit b21dd1d
Show file tree
Hide file tree
Showing 120 changed files with 137 additions and 138 deletions.
31 changes: 15 additions & 16 deletions docs/src/dev/runtime_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,6 @@ Variables prefixed with `YK_` allow the user to control aspects of yk's executio

The following environment variables are available:

* `YK_LOG=[<path>:]<level>` specifies where, and how much, general information
yk will log during execution.

If `<path>:` (i.e. a path followed by ":") is specified then output is sent
to that path. The special value `-` (i.e. a single dash) can be used for
`<path>` to indicate stderr. If not specified, logs to stderr.

`<level>` specifies the level of logging, each adding to the previous: level
0 turns off all yk logging; level 1 shows major errors only; and level 2
warnings. Levels above 3 are used for internal yk debugging, and their
precise output, and indeed the maximum level may change without warning.
Currently: level 3 logs transitions of a `Location` transition; and level 4
JIT events such as starting/stopping tracing. Note that some information, at
all levels, may or may not be displayed based on compile-time options.
Defaults to 1.

* `YK_HOT_THRESHOLD`: an integer from 0..4294967295 (both inclusive) that
determines how many executions of a hot loop are needed before it is traced.
Defaults to 50.
Expand All @@ -40,5 +24,20 @@ performance down.

The following environment variables are available (some only in certain configurations of yk):

* `YKD_LOG=[<path>:]<level>` specifies where, and how much, general information
yk will log during execution.

If `<path>:` (i.e. a path followed by ":") is specified then output is sent
to that path. The special value `-` (i.e. a single dash) can be used for
`<path>` to indicate stderr. If not specified, logs to stderr.

`<level>` specifies the level of logging, each adding to the previous: level
0 turns off all yk logging; level 1 shows major errors only; and level 2
warnings. Levels above 3 are used for internal yk debugging, and their
precise output, and indeed the maximum level may change without warning.
Currently: level 3 logs transitions of a `Location` transition; and level 4
JIT events such as starting/stopping tracing. Note that some information, at
all levels, may or may not be displayed based on compile-time options.
Defaults to 1.
* [`YKD_LOG_IR`](understanding_traces.html#ykd_log_ir) [with the `ykd` feature]
* [`YKD_LOG_STATS`](profiling.html#jit-statistics)
2 changes: 1 addition & 1 deletion tests/c/arg_mapping_callee.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 3:5
Expand Down
2 changes: 1 addition & 1 deletion tests/c/arithmetic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Run-time:
// env-var: YKD_LOG_IR=jit-pre-opt,jit-post-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// add 5
Expand Down
2 changes: 1 addition & 1 deletion tests/c/ashr_exact.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Run-time:
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// ashr 4
Expand Down
2 changes: 1 addition & 1 deletion tests/c/bf.O0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// env-var: YKB_EXTRA_CC_FLAGS=-O0
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// ...
// yk-jit-event: enter-jit-code
Expand Down
2 changes: 1 addition & 1 deletion tests/c/bf.O1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// env-var: YKB_EXTRA_CC_FLAGS=-O1
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// ...
// yk-jit-event: enter-jit-code
Expand Down
2 changes: 1 addition & 1 deletion tests/c/bf.O2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// env-var: YKB_EXTRA_CC_FLAGS=-O2
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// ...
// yk-jit-event: enter-jit-code
Expand Down
2 changes: 1 addition & 1 deletion tests/c/bf.O3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// env-var: YKB_EXTRA_CC_FLAGS=-O3
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// ...
// yk-jit-event: enter-jit-code
Expand Down
2 changes: 1 addition & 1 deletion tests/c/call_args.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 3: 5
Expand Down
2 changes: 1 addition & 1 deletion tests/c/call_ext_in_obj.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 4
Expand Down
2 changes: 1 addition & 1 deletion tests/c/calls_double.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// ...
// yk-jit-event: enter-jit-code
Expand Down
2 changes: 1 addition & 1 deletion tests/c/choice.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Compiler:
// Run-time:
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// stderr:
Expand Down
2 changes: 1 addition & 1 deletion tests/c/conditionals.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Run-time:
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// env-var: YKD_SERIALISE_COMPILATION=1
// stderr:
// ...
Expand Down
2 changes: 1 addition & 1 deletion tests/c/const_global.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// i=4
Expand Down
2 changes: 1 addition & 1 deletion tests/c/constexpr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ignore-if: true
// Run-time:
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// env-var: YKD_SERIALISE_COMPILATION=1
// stderr:
// ...
Expand Down
2 changes: 1 addition & 1 deletion tests/c/double.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 4 -> 4.000000
Expand Down
2 changes: 1 addition & 1 deletion tests/c/doubleinline.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 4
Expand Down
2 changes: 1 addition & 1 deletion tests/c/dyn_ptradd_mixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// i=4, y=7
Expand Down
2 changes: 1 addition & 1 deletion tests/c/dyn_ptradd_multidim.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// i=0, elem=000
Expand Down
2 changes: 1 addition & 1 deletion tests/c/dyn_ptradd_simple.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// i=4, elem=14
Expand Down
2 changes: 1 addition & 1 deletion tests/c/early_return1.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// early return
Expand Down
2 changes: 1 addition & 1 deletion tests/c/early_return2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// b3
Expand Down
2 changes: 1 addition & 1 deletion tests/c/exit_and_reenter_interploop.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// enter
// yk-jit-event: start-tracing
Expand Down
2 changes: 1 addition & 1 deletion tests/c/fcmp_double.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt,jit-asm
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 1.100000 == 2.200000: 0
Expand Down
2 changes: 1 addition & 1 deletion tests/c/fcmp_float.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt,jit-asm
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 1.100000 == 2.200000: 0
Expand Down
2 changes: 1 addition & 1 deletion tests/c/fib.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 4:21
Expand Down
2 changes: 1 addition & 1 deletion tests/c/float.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 4 -> 4.000000
Expand Down
2 changes: 1 addition & 1 deletion tests/c/float_binop.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 4 -> 4.333300 4.840000
Expand Down
2 changes: 1 addition & 1 deletion tests/c/float_consts.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 4 -> 3.350000, 4.500000
Expand Down
2 changes: 1 addition & 1 deletion tests/c/float_div.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 4 -> 8.000000 20.000000
Expand Down
2 changes: 1 addition & 1 deletion tests/c/float_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 4 -> 1.333200 3.360000
Expand Down
2 changes: 1 addition & 1 deletion tests/c/float_store.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-post-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 4 -> 3.252033
Expand Down
2 changes: 1 addition & 1 deletion tests/c/fp_in_out.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// 5.100000
Expand Down
2 changes: 1 addition & 1 deletion tests/c/fp_to_si.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// i=4
Expand Down
2 changes: 1 addition & 1 deletion tests/c/funcptrarg_hasir.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ignore-if: true
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// ...
// FIXME: match the indirect call
Expand Down
2 changes: 1 addition & 1 deletion tests/c/funcptrarg_noir.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// z=3
Expand Down
2 changes: 1 addition & 1 deletion tests/c/funcptrarg_pretrace.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// ...
// --- Begin jit-pre-opt ---
Expand Down
2 changes: 1 addition & 1 deletion tests/c/icmp_ptr.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Run-time:
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// ...
// yk-jit-event: enter-jit-code
Expand Down
2 changes: 1 addition & 1 deletion tests/c/indirect_branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ignore-if: true
// Run-time:
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// FIXME: match some IR/output
// ...
Expand Down
2 changes: 1 addition & 1 deletion tests/c/indirect_call.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Run-time:
// env-var: YKD_LOG_IR=jit-pre-opt
// env-var: YKD_SERIALISE_COMPILATION=1
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// stderr:
// yk-jit-event: start-tracing
// foo 7
Expand Down
2 changes: 1 addition & 1 deletion tests/c/indirect_external_function_call.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ignore-if: true
// Run-time:
// env-var: YKD_LOG_IR=aot,jit-pre-opt
// env-var: YK_LOG=4
// env-var: YKD_LOG=4
// env-var: YKD_SERIALISE_COMPILATION=1
// stdout:
// 205
Expand Down
Loading

0 comments on commit b21dd1d

Please sign in to comment.