pahole: Show tagged enums as well when no class is specified
The pahole tool initial goal was to show struct holes, which can't happen with a first level of a tagged union (a union with a name), so those only were displayed when part of a higher level struct. Show the first level tagged enums as well, as this is useful when just wanting to see its members. E.g.: $ pahole ../build/v4.20-rc5/net/core/sock.o | grep ^union union fpregs_state { union irq_stack_union { union sigval { union __sifields { union thread_union { union kernfs_node_id { union flowi_uli { union ethtool_flow_union { union key_payload { union bpf_attr { union tcp_md5_addr { $ Suggested-by: Matthew Wilcox <willy@infradead.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
b18354f64c
commit
31664d60ad
14
dwarves.h
14
dwarves.h
|
@ -267,6 +267,20 @@ static inline __pure bool cu__is_c_plus_plus(const struct cu *cu)
|
|||
continue; \
|
||||
else
|
||||
|
||||
/**
|
||||
* cu__for_each_struct_or_union - iterate thru all the struct and union tags
|
||||
* @cu: struct cu instance to iterate
|
||||
* @pos: struct class iterator
|
||||
* @id: uint16_t tag id
|
||||
*/
|
||||
#define cu__for_each_struct_or_union(cu, id, pos) \
|
||||
for (id = 1; id < cu->types_table.nr_entries; ++id) \
|
||||
if (!(pos = tag__class(cu->types_table.entries[id])) || \
|
||||
!(tag__is_struct(class__tag(pos)) || \
|
||||
tag__is_union(class__tag(pos)))) \
|
||||
continue; \
|
||||
else
|
||||
|
||||
/**
|
||||
* cu__for_each_function - iterate thru all the function tags
|
||||
* @cu: struct cu instance to iterate
|
||||
|
|
Loading…
Reference in New Issue