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>
1 file changed