On 2022/09/20 0:10, Tao Liu wrote: > This patch will remove all kernel structures, and leave them to be blank > for debug purpose. There seems to be a lot of code changes, but most are > rewriting struct member resolving into crash way. > > Signed-off-by: Tao Liu <ltao@xxxxxxxxxx> > --- > defs.h | 20 +++++- > maple_tree.c | 183 ++++++++++++++++++++++++++++++++------------------- > maple_tree.h | 92 ++++++-------------------- > memory.c | 4 ++ > 4 files changed, 159 insertions(+), 140 deletions(-) > > diff --git a/defs.h b/defs.h > index d4be477..8ea710f 100644 > --- a/defs.h > +++ b/defs.h > @@ -1332,7 +1332,6 @@ struct offset_table { /* stash of commonly-used offsets */ > long percpu_struct_halt_ra; > long percpu_struct_halt_pv; > long mm_struct_mmap; > - long mm_struct_mm_mt; > long mm_struct_pgd; > long mm_struct_rss; > long mm_struct_anon_rss; > @@ -2182,6 +2181,23 @@ struct offset_table { /* stash of commonly-used offsets */ > long blk_mq_tags_nr_reserved_tags; > long blk_mq_tags_rqs; > long request_queue_hctx_table; > + > + long mm_struct_mm_mt; > + long maple_tree_ma_root; > + long maple_tree_ma_flags; > + long maple_node_parent; > + long maple_node_ma64; > + long maple_node_mr64; > + long maple_node_slot; > + long maple_arange_64_parent; > + long maple_arange_64_pivot; > + long maple_arange_64_slot; > + long maple_arange_64_meta; > + long maple_range_64_parent; > + long maple_range_64_pivot; > + long maple_range_64_slot; > + long maple_range_64_meta; > + long maple_metadata_end; > }; > > struct size_table { /* stash of commonly-used sizes */ > @@ -2352,6 +2368,8 @@ struct size_table { /* stash of commonly-used sizes */ > long sbitmap_queue; > long sbq_wait_state; > long blk_mq_tags; > + long maple_tree_struct; > + long maple_node_struct; > }; > > struct array_table { > diff --git a/maple_tree.c b/maple_tree.c > index 21a2226..ff07d58 100644 > --- a/maple_tree.c > +++ b/maple_tree.c > @@ -78,10 +78,11 @@ static inline enum maple_type mte_node_type(const struct maple_enode *entry) > > static inline void *mas_root(struct ma_state *mas) > { > - struct maple_tree tree; > - readmem(mas->tree, KVADDR, &tree, sizeof(tree), > + char tree[SIZE(maple_tree_struct)]; Please don't use variable-length array, which can be fragile. Thanks, Kazu -- Crash-utility mailing list Crash-utility@xxxxxxxxxx https://listman.redhat.com/mailman/listinfo/crash-utility Contribution Guidelines: https://github.com/crash-utility/crash/wiki