Commit dd12805ed1db7 ("XArray: Remove radix tree compatibility") on linux-next changes the definition of 'radix_tree_root' back to be a struct. The content however differs from the original 'struct radix_tree_root'. Thus attempts to debug current linux-next kernels fail with 'radix trees do not exist or have changed their format'. Because the new 'struct radix_tree_root' and 'struct xarray' have nearly the same layout the functionality for XArrays can be reused. Signed-off-by: Philipp Rudo <prudo@xxxxxxxxxxxxx> --- bpf.c | 7 ++++++- ipcs.c | 5 ++++- task.c | 15 +++++++++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/bpf.c b/bpf.c index 6eacb9a..056e286 100644 --- a/bpf.c +++ b/bpf.c @@ -221,7 +221,12 @@ bpf_init(struct bpf_info *bpf) bpf->idr_type = IDR_ORIG; do_old_idr(IDR_ORIG_INIT, 0, NULL); } else if (STREQ(MEMBER_TYPE_NAME("idr", "idr_rt"), "radix_tree_root")) - bpf->idr_type = IDR_RADIX; + if (MEMBER_EXISTS("radix_tree_root", "rnode")) + bpf->idr_type = IDR_RADIX; + else if (MEMBER_EXISTS("radix_tree_root", "xa_head")) + bpf->idr_type = IDR_XARRAY; + else + error(FATAL, "cannot determine IDR list type\n"); else if (STREQ(MEMBER_TYPE_NAME("idr", "idr_rt"), "xarray")) bpf->idr_type = IDR_XARRAY; else diff --git a/ipcs.c b/ipcs.c index 2553bac..3c26620 100644 --- a/ipcs.c +++ b/ipcs.c @@ -206,7 +206,10 @@ ipcs_init(void) if (STREQ(MEMBER_TYPE_NAME("idr", "idr_rt"), "xarray")) ipcs_table.init_flags |= IDR_XARRAY; else - ipcs_table.init_flags |= IDR_RADIX; + if (MEMBER_EXISTS("radix_tree_root", "rnode")) + ipcs_table.init_flags |= IDR_RADIX; + else if (MEMBER_EXISTS("radix_tree_root", "xa_head")) + ipcs_table.init_flags |= IDR_XARRAY; } else ipcs_table.init_flags |= IDR_ORIG; diff --git a/task.c b/task.c index cd118e5..36a90d6 100644 --- a/task.c +++ b/task.c @@ -507,10 +507,17 @@ task_init(void) OFFSET(pid_namespace_idr) + OFFSET(idr_idr_rt); tt->flags |= PID_XARRAY; } else if STREQ(MEMBER_TYPE_NAME("idr", "idr_rt"), "radix_tree_root") { - tt->refresh_task_table = refresh_radix_tree_task_table; - tt->pid_radix_tree = symbol_value("init_pid_ns") + - OFFSET(pid_namespace_idr) + OFFSET(idr_idr_rt); - tt->flags |= PID_RADIX_TREE; + if (MEMBER_EXISTS("radix_tree_root", "rnode")) { + tt->refresh_task_table = refresh_radix_tree_task_table; + tt->pid_radix_tree = symbol_value("init_pid_ns") + + OFFSET(pid_namespace_idr) + OFFSET(idr_idr_rt); + tt->flags |= PID_RADIX_TREE; + } else if (MEMBER_EXISTS("radix_tree_root", "xa_head")) { + tt->refresh_task_table = refresh_xarray_task_table; + tt->pid_xarray = symbol_value("init_pid_ns") + + OFFSET(pid_namespace_idr) + OFFSET(idr_idr_rt); + tt->flags |= PID_XARRAY; + } } else error(FATAL, "unknown pid_namespace.idr type: %s\n", MEMBER_TYPE_NAME("idr", "idr_rt")); -- 2.16.4 -- Crash-utility mailing list Crash-utility@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/crash-utility