Skip to contentSkip to conversation

pahole failed to get some struct info

DISCUSSION Xianting Tian 2 participants 3 messages Oct 10, 2021 – Oct 12, 2021

lore
Share & tools
lore
#0 lore raw

Hi,

Sorry to disturb you, when I use below command to get info about 'struct hvc_struct', it failed.

$ pahole -C hvc_struct vmlinux
die__process_function: tag not supported (INVALID)!
die__process_unit: DW_TAG_dwarf_procedure (0x36) @ <0x4ebf4c> not handled!

But when I try some common struct, it is OK.

$pahole -C task_struct vmlinux

Could you help me how to fix the issue?  thanks a lot.

#1 lore raw

Em Sun, Oct 10, 2021 at 02:09:10PM +0800, Xianting Tian escreveu:

Quoted 9 lines

Hi,

Sorry to disturb you, when I use below command to get info about 'struct hvc_struct', it failed.

$ pahole -C hvc_struct vmlinux
die__process_function: tag not supported (INVALID)!
die__process_unit: DW_TAG_dwarf_procedure (0x36) @ <0x4ebf4c> not handled!
Quoted 5 lines

But when I try some common struct, it is OK.

$ pahole -C task_struct vmlinux

Could you help me how to fix the issue?  thanks a lot.

Using:

⬢[acme@toolbox v5.14.0-rc6+]$ pahole --version
v1.22

I see no problems, be it from DWARF or from BTF, in the various ways to ask for that struct:

⬢[acme@toolbox v5.14.0-rc6+]$ pahole -C hvc_struct vmlinux struct hvc_struct {
struct tty_port port; /* 0 352 */
/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
spinlock_t lock; /* 352 4 */
int index; /* 356 4 */
int do_wakeup; /* 360 4 */

/* XXX 4 bytes hole, try to pack */

char * outbuf; /* 368 8 */
int outbuf_size; /* 376 4 */
int n_outbuf; /* 380 4 */
/* --- cacheline 6 boundary (384 bytes) --- */
uint32_t vtermno; /* 384 4 */

/* XXX 4 bytes hole, try to pack */

const struct hv_ops * ops; /* 392 8 */
int irq_requested; /* 400 4 */
int data; /* 404 4 */
struct winsize ws; /* 408 8 */
struct work_struct tty_resize; /* 416 32 */
/* --- cacheline 7 boundary (448 bytes) --- */
struct list_head next; /* 448 16 */
long unsigned int flags; /* 464 8 */

/* size: 472, cachelines: 8, members: 15 */
/* sum members: 464, holes: 2, sum holes: 8 */
/* last cacheline: 24 bytes */
};
⬢[acme@toolbox v5.14.0-rc6+]$ pahole hvc_struct
struct hvc_struct {
struct tty_port port; /* 0 352 */
/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
spinlock_t lock; /* 352 4 */
int index; /* 356 4 */
int do_wakeup; /* 360 4 */

/* XXX 4 bytes hole, try to pack */

char * outbuf; /* 368 8 */
int outbuf_size; /* 376 4 */
int n_outbuf; /* 380 4 */
/* --- cacheline 6 boundary (384 bytes) --- */
uint32_t vtermno; /* 384 4 */

/* XXX 4 bytes hole, try to pack */

const struct hv_ops * ops; /* 392 8 */
int irq_requested; /* 400 4 */
int data; /* 404 4 */
struct winsize ws; /* 408 8 */
struct work_struct tty_resize; /* 416 32 */
/* --- cacheline 7 boundary (448 bytes) --- */
struct list_head next; /* 448 16 */
long unsigned int flags; /* 464 8 */

/* size: 472, cachelines: 8, members: 15 */ /* sum members: 464, holes: 2, sum holes: 8 */ /* last cacheline: 24 bytes */
};
⬢[acme@toolbox v5.14.0-rc6+]$

⬢[acme@toolbox v5.14.0-rc6+]$ pahole -F dwarf -C hvc_struct vmlinux struct hvc_struct {
struct tty_port port; /* 0 352 */
/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
spinlock_t lock; /* 352 4 */
int index; /* 356 4 */
int do_wakeup; /* 360 4 */

/* XXX 4 bytes hole, try to pack */

char * outbuf; /* 368 8 */
int outbuf_size; /* 376 4 */
int n_outbuf; /* 380 4 */
/* --- cacheline 6 boundary (384 bytes) --- */
uint32_t vtermno; /* 384 4 */

/* XXX 4 bytes hole, try to pack */

const struct hv_ops * ops; /* 392 8 */
int irq_requested; /* 400 4 */
int data; /* 404 4 */
struct winsize ws; /* 408 8 */
struct work_struct tty_resize; /* 416 32 */
/* --- cacheline 7 boundary (448 bytes) --- */
struct list_head next; /* 448 16 */
long unsigned int flags; /* 464 8 */

/* size: 472, cachelines: 8, members: 15 */
/* sum members: 464, holes: 2, sum holes: 8 */
/* last cacheline: 24 bytes */
};
⬢[acme@toolbox v5.14.0-rc6+]$ pahole -F btf -C hvc_struct vmlinux struct hvc_struct {
struct tty_port port; /* 0 352 */
/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
spinlock_t lock; /* 352 4 */
int index; /* 356 4 */
int do_wakeup; /* 360 4 */

/* XXX 4 bytes hole, try to pack */

char * outbuf; /* 368 8 */
int outbuf_size; /* 376 4 */
int n_outbuf; /* 380 4 */
/* --- cacheline 6 boundary (384 bytes) --- */
uint32_t vtermno; /* 384 4 */

/* XXX 4 bytes hole, try to pack */

const struct hv_ops * ops; /* 392 8 */
int irq_requested; /* 400 4 */
int data; /* 404 4 */
struct winsize ws; /* 408 8 */
struct work_struct tty_resize; /* 416 32 */
/* --- cacheline 7 boundary (448 bytes) --- */
struct list_head next; /* 448 16 */
long unsigned int flags; /* 464 8 */

/* size: 472, cachelines: 8, members: 15 */ /* sum members: 464, holes: 2, sum holes: 8 */ /* last cacheline: 24 bytes */
};

⬢[acme@toolbox v5.14.0-rc6+]$ pahole --help | grep decl
-D, --decl_exclude=PREFIX exclude classes declared in files with PREFIX
-I, --show_decl_info Show the file and line number where the tags were
⬢[acme@toolbox v5.14.0-rc6+]$ pahole -IF dwarf -C hvc_struct vmlinux /* Used at: /var/home/acme/git/perf/drivers/tty/hvc/hvc_console.c */ /* <65c08c8> /var/home/acme/git/perf/drivers/tty/hvc/hvc_console.h:35 */ struct hvc_struct {
struct tty_port port; /* 0 352 */
/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
spinlock_t lock; /* 352 4 */
int index; /* 356 4 */
int do_wakeup; /* 360 4 */

/* XXX 4 bytes hole, try to pack */

char * outbuf; /* 368 8 */
int outbuf_size; /* 376 4 */
int n_outbuf; /* 380 4 */
/* --- cacheline 6 boundary (384 bytes) --- */
uint32_t vtermno; /* 384 4 */

/* XXX 4 bytes hole, try to pack */

const struct hv_ops * ops; /* 392 8 */
int irq_requested; /* 400 4 */
int data; /* 404 4 */
struct winsize ws; /* 408 8 */
struct work_struct tty_resize; /* 416 32 */
/* --- cacheline 7 boundary (448 bytes) --- */
struct list_head next; /* 448 16 */
long unsigned int flags; /* 464 8 */

/* size: 472, cachelines: 8, members: 15 */ /* sum members: 464, holes: 2, sum holes: 8 */ /* last cacheline: 24 bytes */
};
⬢[acme@toolbox v5.14.0-rc6+]$

#2 lore raw

thanks a lot for the response,

I will try the new version, my current version seems too old.

$ pahole  --version
v1.9
Quoted 186 lines · Arnaldo Carvalho de Melo

Em Sun, Oct 10, 2021 at 02:09:10PM +0800, Xianting Tian escreveu:

Quoted 7 lines

Hi,
Sorry to disturb you, when I use below command to get info about 'struct hvc_struct', it failed.

$ pahole -C hvc_struct vmlinux
die__process_function: tag not supported (INVALID)!
die__process_unit: DW_TAG_dwarf_procedure (0x36) @ <0x4ebf4c> not handled!
Quoted 5 lines

But when I try some common struct, it is OK.

$ pahole -C task_struct vmlinux

Could you help me how to fix the issue?  thanks a lot.

Using:

⬢[acme@toolbox v5.14.0-rc6+]$ pahole --version
v1.22

I see no problems, be it from DWARF or from BTF, in the various ways to ask for that struct:

⬢[acme@toolbox v5.14.0-rc6+]$ pahole -C hvc_struct vmlinux struct hvc_struct {
struct tty_port port; /* 0 352 */
/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
spinlock_t lock; /* 352 4 */
int index; /* 356 4 */
int do_wakeup; /* 360 4 */

/* XXX 4 bytes hole, try to pack */

char * outbuf; /* 368 8 */
int outbuf_size; /* 376 4 */
int n_outbuf; /* 380 4 */
/* --- cacheline 6 boundary (384 bytes) --- */
uint32_t vtermno; /* 384 4 */

/* XXX 4 bytes hole, try to pack */

const struct hv_ops * ops; /* 392 8 */
int irq_requested; /* 400 4 */
int data; /* 404 4 */
struct winsize ws; /* 408 8 */
struct work_struct tty_resize; /* 416 32 */
/* --- cacheline 7 boundary (448 bytes) --- */
struct list_head next; /* 448 16 */
long unsigned int flags; /* 464 8 */

/* size: 472, cachelines: 8, members: 15 */
/* sum members: 464, holes: 2, sum holes: 8 */
/* last cacheline: 24 bytes */
};
⬢[acme@toolbox v5.14.0-rc6+]$ pahole hvc_struct
struct hvc_struct {
struct tty_port port; /* 0 352 */
/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
spinlock_t lock; /* 352 4 */
int index; /* 356 4 */
int do_wakeup; /* 360 4 */

/* XXX 4 bytes hole, try to pack */

char * outbuf; /* 368 8 */
int outbuf_size; /* 376 4 */
int n_outbuf; /* 380 4 */
/* --- cacheline 6 boundary (384 bytes) --- */
uint32_t vtermno; /* 384 4 */

/* XXX 4 bytes hole, try to pack */

const struct hv_ops * ops; /* 392 8 */
int irq_requested; /* 400 4 */
int data; /* 404 4 */
struct winsize ws; /* 408 8 */
struct work_struct tty_resize; /* 416 32 */
/* --- cacheline 7 boundary (448 bytes) --- */
struct list_head next; /* 448 16 */
long unsigned int flags; /* 464 8 */

/* size: 472, cachelines: 8, members: 15 */ /* sum members: 464, holes: 2, sum holes: 8 */ /* last cacheline: 24 bytes */
};
⬢[acme@toolbox v5.14.0-rc6+]$

⬢[acme@toolbox v5.14.0-rc6+]$ pahole -F dwarf -C hvc_struct vmlinux struct hvc_struct {
struct tty_port port; /* 0 352 */
/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
spinlock_t lock; /* 352 4 */
int index; /* 356 4 */
int do_wakeup; /* 360 4 */

/* XXX 4 bytes hole, try to pack */

char * outbuf; /* 368 8 */
int outbuf_size; /* 376 4 */
int n_outbuf; /* 380 4 */
/* --- cacheline 6 boundary (384 bytes) --- */
uint32_t vtermno; /* 384 4 */

/* XXX 4 bytes hole, try to pack */

const struct hv_ops * ops; /* 392 8 */
int irq_requested; /* 400 4 */
int data; /* 404 4 */
struct winsize ws; /* 408 8 */
struct work_struct tty_resize; /* 416 32 */
/* --- cacheline 7 boundary (448 bytes) --- */
struct list_head next; /* 448 16 */
long unsigned int flags; /* 464 8 */

/* size: 472, cachelines: 8, members: 15 */
/* sum members: 464, holes: 2, sum holes: 8 */
/* last cacheline: 24 bytes */
};
⬢[acme@toolbox v5.14.0-rc6+]$ pahole -F btf -C hvc_struct vmlinux struct hvc_struct {
struct tty_port port; /* 0 352 */
/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
spinlock_t lock; /* 352 4 */
int index; /* 356 4 */
int do_wakeup; /* 360 4 */

/* XXX 4 bytes hole, try to pack */

char * outbuf; /* 368 8 */
int outbuf_size; /* 376 4 */
int n_outbuf; /* 380 4 */
/* --- cacheline 6 boundary (384 bytes) --- */
uint32_t vtermno; /* 384 4 */

/* XXX 4 bytes hole, try to pack */

const struct hv_ops * ops; /* 392 8 */
int irq_requested; /* 400 4 */
int data; /* 404 4 */
struct winsize ws; /* 408 8 */
struct work_struct tty_resize; /* 416 32 */
/* --- cacheline 7 boundary (448 bytes) --- */
struct list_head next; /* 448 16 */
long unsigned int flags; /* 464 8 */

/* size: 472, cachelines: 8, members: 15 */ /* sum members: 464, holes: 2, sum holes: 8 */ /* last cacheline: 24 bytes */
};

⬢[acme@toolbox v5.14.0-rc6+]$ pahole --help | grep decl
-D, --decl_exclude=PREFIX exclude classes declared in files with PREFIX
-I, --show_decl_info Show the file and line number where the tags were
⬢[acme@toolbox v5.14.0-rc6+]$ pahole -IF dwarf -C hvc_struct vmlinux /* Used at: /var/home/acme/git/perf/drivers/tty/hvc/hvc_console.c */ /* <65c08c8> /var/home/acme/git/perf/drivers/tty/hvc/hvc_console.h:35 */ struct hvc_struct {
struct tty_port port; /* 0 352 */
/* --- cacheline 5 boundary (320 bytes) was 32 bytes ago --- */
spinlock_t lock; /* 352 4 */
int index; /* 356 4 */
int do_wakeup; /* 360 4 */

/* XXX 4 bytes hole, try to pack */

char * outbuf; /* 368 8 */
int outbuf_size; /* 376 4 */
int n_outbuf; /* 380 4 */
/* --- cacheline 6 boundary (384 bytes) --- */
uint32_t vtermno; /* 384 4 */

/* XXX 4 bytes hole, try to pack */

const struct hv_ops * ops; /* 392 8 */
int irq_requested; /* 400 4 */
int data; /* 404 4 */
struct winsize ws; /* 408 8 */
struct work_struct tty_resize; /* 416 32 */
/* --- cacheline 7 boundary (448 bytes) --- */
struct list_head next; /* 448 16 */
long unsigned int flags; /* 464 8 */

/* size: 472, cachelines: 8, members: 15 */ /* sum members: 464, holes: 2, sum holes: 8 */ /* last cacheline: 24 bytes */
};
⬢[acme@toolbox v5.14.0-rc6+]$