From c56e60b86ab64a521410779805a1b07507df734b Mon Sep 17 00:00:00 2001 From: Daniel Hodges Date: Fri, 4 Oct 2024 11:36:36 -0700 Subject: [PATCH] scx_layered: Add better debug output of iter algo Signed-off-by: Daniel Hodges --- scheds/rust/scx_layered/src/bpf/main.bpf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scheds/rust/scx_layered/src/bpf/main.bpf.c b/scheds/rust/scx_layered/src/bpf/main.bpf.c index 54359f0..5641311 100644 --- a/scheds/rust/scx_layered/src/bpf/main.bpf.c +++ b/scheds/rust/scx_layered/src/bpf/main.bpf.c @@ -1927,9 +1927,17 @@ void BPF_STRUCT_OPS(layered_dump, struct scx_dump_ctx *dctx) static void print_iter_order() { int i; + struct cpu_ctx *cctx; + if (!(cctx = lookup_cpu_ctx(-1))) { + scx_bpf_error("failed to get cpu ctx"); + return; + } + + trace("ITER algo: %d", dsq_iter_algo); bpf_for(i, 0, nr_layers) { - trace("ITER order i: %d %d\n", i, *MEMBER_VPTR(layer_iteration_order, [i])); + trace("ITER order i: %d %d\n", i, + iter_layer_dsq_ctx(i, cctx->layer_idx)); } }