pahole: Consider unions when looking for classes containing some class
I.e.:
$ pahole --contains tpacket_req
tpacket_req_u
$
Wasn't working, but should be considered with --contains/-i:
$ pahole -C tpacket_req_u
union tpacket_req_u {
struct tpacket_req req; /* 0 16 */
struct tpacket_req3 req3; /* 0 28 */
};
$
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
diff --git a/pahole.c b/pahole.c
index 67be72f..fb2e29d 100644
--- a/pahole.c
+++ b/pahole.c
@@ -721,7 +721,7 @@
struct class *pos;
uint32_t id;
- cu__for_each_struct(cu, id, pos) {
+ cu__for_each_struct_or_union(cu, id, pos) {
if (pos->type.namespace.name == 0)
continue;