diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-09-23 14:06:31 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-09-23 14:06:31 -0300 |
commit | f5857bd34b220a64eb343a84e21f3c8e11cd9ec7 (patch) | |
tree | 9cddf655a90960185be063d34bdb5af171690ea8 | |
parent | 2bb968b567011f8a3e47706dc11c2a6ec442352c (diff) | |
download | pahole-f5857bd34b220a64eb343a84e21f3c8e11cd9ec7.tar.gz |
pahole: Honour --compile when -C is used
I.e. generate types recursively from some specified types, now this
works:
⬢[acme@toolbox pahole]$ pahole --compile spinlock
typedef struct {
int counter; /* 0 4 */
/* size: 4, cachelines: 1, members: 1 */
/* last cacheline: 4 bytes */
} atomic_t;
typedef unsigned char __u8;
typedef __u8 u8;
typedef short unsigned int __u16;
typedef __u16 u16;
struct qspinlock {
union {
atomic_t val; /* 0 4 */
struct {
u8 locked; /* 0 1 */
u8 pending; /* 1 1 */
}; /* 0 2 */
struct {
u16 locked_pending; /* 0 2 */
u16 tail; /* 2 2 */
}; /* 0 4 */
}; /* 0 4 */
/* size: 4, cachelines: 1, members: 1 */
/* last cacheline: 4 bytes */
};
typedef struct qspinlock arch_spinlock_t;
struct raw_spinlock {
arch_spinlock_t raw_lock; /* 0 4 */
/* size: 4, cachelines: 1, members: 1 */
/* last cacheline: 4 bytes */
};
struct spinlock {
union {
struct raw_spinlock rlock; /* 0 4 */
}; /* 0 4 */
/* size: 4, cachelines: 1, members: 1 */
/* last cacheline: 4 bytes */
};
⬢[acme@toolbox pahole]$
------
When not using --compile this ends up calling tag__fprintf() as
formatter is set to class_formatter() that calls tag__fprintf() if
compilable isn't set.
Cc: Adrian Moreno <amorenoz@redhat.com>
Cc: Arnaldo Melo <acme@redhat.com>
Cc: Eelco Chaudron <echaudro@redhat.com>
Cc: Flavio Leitner <fbl@redhat.com>,
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | pahole.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3217,7 +3217,7 @@ out_btf: * We don't need to print it for every compile unit * but the previous options need */ - tag__fprintf(class, cu, &conf, stdout); + formatter(tag__class(class), cu, class_id); putchar('\n'); } } |