All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Xianting Tian <xianting.tian@linux.alibaba.com>
Cc: dwarves@vger.kernel.org
Subject: Re: pahole failed to get some struct info
Date: Mon, 11 Oct 2021 15:55:20 -0300	[thread overview]
Message-ID: <YWSImJiz3VjD/ArG@kernel.org> (raw)
In-Reply-To: <9a88283d-443c-3789-b120-b2c6c56ebe55@linux.alibaba.com>

Em Sun, Oct 10, 2021 at 02:09:10PM +0800, Xianting Tian escreveu:
> 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.

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+]$

  reply	other threads:[~2021-10-11 18:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-10  6:09 pahole failed to get some struct info Xianting Tian
2021-10-11 18:55 ` Arnaldo Carvalho de Melo [this message]
2021-10-12  1:31   ` Xianting Tian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YWSImJiz3VjD/ArG@kernel.org \
    --to=acme@kernel.org \
    --cc=dwarves@vger.kernel.org \
    --cc=xianting.tian@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.