pahole: Describe expected use of 'default' in the man page
[dwarves.git] / changes-v1.19
blob986165404afdcef32f9aa7415f3421e8af6b49f7
1 v1.19:
3 - Support split BTF, where a main BTF file, vmlinux, can be used to find types
4   and then a kernel module, for instance, can have just what is unique to it.
6   For instance, looking for a type in the main vmlinux BTF info:
8     $ pahole wmi_notify_handler
9     pahole: type 'wmi_notify_handler' not found
10     $
12   If we look at the 'wmi' module BTF info that is in:
14     $ ls -la /sys/kernel/btf/wmi
15     -r--r--r--. 1 root root 2866 Nov 18 13:35 /sys/kernel/btf/wmi
16     $
18     $ pahole /sys/kernel/btf/wmi -C wmi_notify_handler
19     typedef void (*wmi_notify_handler)(u32, void *);
20     $
22   '--btf_base=/sys/kernel/btf/vmlinux' was automatically added in this last
23   example, an option that was also introduced in this version where types used in
24   the wmi.ko module but present in vmlinux can be found so that there is no
25   duplicity of types.
27 - Update libbpf to get the split BTF support and use some of its functions to
28   load BTF and speed up DWARF loading and BTF encoding.
30 - Support cross-compiled ELF binaries with different endianness
32 - Support showing typedefs for anonymous types, like structs, unions and enums,
33   see the "Align enumerators" entry below for an example, another:
35     $ pahole rwlock_t
36     typedef struct {
37             arch_rwlock_t              raw_lock;             /*     0     8 */
39             /* size: 8, cachelines: 1, members: 1 */
40             /* last cacheline: 8 bytes */
41     } rwlock_t;
42     $
44 - Align enumerators:
46     $ pahole ZSTD_strategy
47     typedef enum {
48             ZSTD_fast    = 0,
49             ZSTD_dfast   = 1,
50             ZSTD_greedy  = 2,
51             ZSTD_lazy    = 3,
52             ZSTD_lazy2   = 4,
53             ZSTD_btlazy2 = 5,
54             ZSTD_btopt   = 6,
55             ZSTD_btopt2  = 7,
56             } ZSTD_strategy;
57     $
59 - Workaround bugs in the generation of DWARF records for functions in some gcc
60   versions that were causing breakage in the encoding of BTF:
62    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97060 "Missing DW_AT_declaration=1 in dwarf data"
64 - Ignore zero-sized ELF symbols instead of erroring out.
66 - Handle union forward declaration properly in the BTF loader.
68 - Introduce --numeric_version for use in scripts and Makefiles:
70     $ pahole --version
71     v1.19
72     $ pahole --numeric_version
73     119
74     $
76   To avoid things like this in the kernel's scripts/link-vmlinux.sh:
78     pahole_ver=$(${PAHOLE} --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/')
80 - Try sole pfunct argument as a function name, just like pahole with type names:
82     $ pfunct tcp_v4_rcv
83     int tcp_v4_rcv(struct sk_buff * skb);
84     $
86 - Speed up pfunct using some of the load techniques used in pahole.
88 - Discard CUs after BTF encoding as they're not used anymore, greatly reducing
89   memory usage and speeding up vmlinux BTF encoding.
91 - Revamp how per-CPU variables are encoded in BTF.
93 - Include BTF info for static functions.
95 - Use BTF's string APIs for strings management, greatly improving performance
96   over the tsearch().
98 - Increase size of DWARF lookup hash table, shaving off about 1 second out of
99   about 20 seconds total for Linux BTF dedup.
101 - Stop BTF encoding when errors are found in some DWARF CU.
103 - Implement --packed, to show just packed structures, for instance, here are
104   the top 5 packed data structures in the Linux kernel:
106   $ pahole --sizes --packed | sort -k2 -nr | head -5
107   e820_table    64004   0
108   boot_params   4096    0
109   efi_variable  2084    0
110   snd_soc_tplg_pcm      912     0
111   ntb_info_regs 800     0
112   $
114   And here is one of them:
116   $ pahole efi_variable
117   struct efi_variable {
118         efi_char16_t               VariableName[512];    /*     0  1024 */
119         /* --- cacheline 16 boundary (1024 bytes) --- */
120         efi_guid_t                 VendorGuid;           /*  1024    16 */
121         long unsigned int          DataSize;             /*  1040     8 */
122         __u8                       Data[1024];           /*  1048  1024 */
123         /* --- cacheline 32 boundary (2048 bytes) was 24 bytes ago --- */
124         efi_status_t               Status;               /*  2072     8 */
125         __u32                      Attributes;           /*  2080     4 */
127         /* size: 2084, cachelines: 33, members: 6 */
128         /* last cacheline: 36 bytes */
129   } __attribute__((__packed__));
130   $
132 - Fix bug in distros such as OpenSUSE:15.2 where DW_AT_alignment isn't defined.
134 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>