Commit Graph

14 Commits

Author SHA1 Message Date
Arnaldo Carvalho de Melo 9a4d719304 fprintf: Allow suppressing the inferred __attribute__((__packed__))
We use things like DW_AT_alignment, so not all of those attributes are
inferred by formats like BTF that lack that info, allow suppressing the
output and make btfdiff ask for both DWARF and BTF output to have this
suppressed.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-04-15 15:01:53 -03:00
Arnaldo Carvalho de Melo ec935ee422 fprintf: Allow suppressing the output of force paddings at the end of structs
Things like 'struct timex' in the linux kernel led to this output:

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-04-15 14:45:29 -03:00
Arnaldo Carvalho de Melo 6cd6a6bd87 dwarves_fprintf: Allow suppressing the __attribute__((__aligned__(N))
So that we can use it in things like btfdiff.

Cc: Alexei Starovoitov <ast@fb.com>
Cc: Andrii Nakryiko <andriin@fb.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Wielaard <mark@klomp.org>
Cc: Yonghong Song <yhs@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-04-03 18:10:16 -03:00
Arnaldo Carvalho de Melo 5f057919a0 man-pages: Add entry for --hex
Flavio needed this and found it only after some head scratching, add it.

Someone could help here by looking at other missing entries in the man
page, getting it in synch with 'pahole --help' ;-)

Reported-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-09-05 10:13:06 -03:00
Arnaldo Carvalho de Melo 5a57eb0741 man-pages: Update URL to the dwarves paper
The ghostprotocols.net domain is busted for a while, point to the
more permanent OLS proceedings pdf hosted at kernel.org.

Reported-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-02-01 10:42:59 -03:00
Arnaldo Carvalho de Melo 519d1d3d96 pahole: Allow list of class names to be passed to -C/--class_name
CSV, and also supports file://class_list.txt as one of the entries
in the list, so:

[acme@doppio pahole]$ pahole -C str_node,strings build/libdwarves.so.1.0.0
struct strings {
	void *              tree;                 /*     0     8 */
	struct gobuffer     gb;                   /*     8    24 */

	/* size: 32, cachelines: 1, members: 2 */
	/* last cacheline: 32 bytes */
};
struct str_node {
	struct rb_node      rb_node;              /*     0    24 */
	const char  *       s;                    /*    24     8 */

	/* size: 32, cachelines: 1, members: 2 */
	/* last cacheline: 32 bytes */
};
[acme@doppio pahole]$

And also:

[acme@doppio pahole]$ pahole -C file://classes.txt,tag build/libdwarves.so.1.0.0
struct strings {
	void *              tree;                 /*     0     8 */
	struct gobuffer     gb;                   /*     8    24 */

	/* size: 32, cachelines: 1, members: 2 */
	/* last cacheline: 32 bytes */
};
struct tag {
	struct list_head    node;                 /*     0    16 */
	uint16_t            type;                 /*    16     2 */
	uint16_t            tag;                  /*    18     2 */
	uint16_t            visited:1;            /*    20:15  2 */
	uint16_t            top_level:1;          /*    20:14  2 */

	/* XXX 14 bits hole, try to pack */

	uint16_t            recursivity_level;    /*    22     2 */
	void *              priv;                 /*    24     8 */

	/* size: 32, cachelines: 1, members: 7 */
	/* bit holes: 1, sum bit holes: 14 bits */
	/* last cacheline: 32 bytes */
};
struct str_node {
	struct rb_node      rb_node;              /*     0    24 */
	const char  *       s;                    /*    24     8 */

	/* size: 32, cachelines: 1, members: 2 */
	/* last cacheline: 32 bytes */
};
[acme@doppio pahole]$

Suggested-by: Zack Weinberg <zweinberg@mozilla.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-06-18 14:58:51 -03:00
Arnaldo Carvalho de Melo fc0827327b pahole: Remove a not needed "the" article in the man page.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-23 16:53:54 -03:00
Arnaldo Carvalho de Melo ac7778099a pahole: Introduce --fixup_silly_bitfields
$ pahole -C acpi_device_perf_flags ac.o
struct acpi_device_perf_flags {
	u8          reserved:8;           /*     0: 0  1 */

	/* size: 1, cachelines: 1, members: 1 */
	/* last cacheline: 1 bytes */
};
$ pahole --fixup_silly_bitfields -C acpi_device_perf_flags ac.o
struct acpi_device_perf_flags {
	u8          reserved;             /*     0     1 */

	/* size: 1, cachelines: 1, members: 1 */
	/* last cacheline: 1 bytes */
};
$

Used in ctfdwdiff as in CTF land we can't express such sillyness.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-20 13:54:04 -03:00
Arnaldo Carvalho de Melo 57127d45fc pahole: Introduce --flat_array
CTF doesn't have support for multiple array dimensions, so it flattens
the arrays.

This caused a large number of false positives in ctfdwdiff, so introduce
this conf_fprintf option, use it in pahole and ctfdwdiff.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-20 10:29:50 -03:00
Arnaldo Carvalho de Melo 45255ec6b6 pahole: Add --format_path/-F to specify a list of formats to try
For a file with just DWARF info:

$ pahole -F ctf build/pahole
$

But if we ask that it also try dwarf:

$ pahole -F ctf,dwarf build/pahole | head -2
struct _IO_FILE {
	int          _flags;    /*     0     4 */
$

Useful when testing the new CTF support in these tools, as we'll be able to,
from the DWARF info in objects, generate the CTF equivalent and add to the same
object, then run pahole -A -F ctf, pahole -A -F dwarf and compare the outputs.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-19 12:19:37 -03:00
Arnaldo Carvalho de Melo bcb2e11dcf man-pages: Fixup typo
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-03 15:32:47 -03:00
Arnaldo Carvalho de Melo f9d24098fc man-pages: Add URL for dwarves paper and info about where it is useful
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-02-13 11:52:58 -02:00
Arnaldo Carvalho de Melo 2a5d435053 man-pages: Add comments about CONFIG_DEBUG_INFO to pahole.1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-02-13 11:35:24 -02:00
Arnaldo Carvalho de Melo 7b6c135e7c pahole: finally the beginnings of a man page
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-02-11 12:19:46 -02:00