Skip to content

Commit 1c1af2c

Browse files
committed
dwarves: Prep v1.16
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 69df734 commit 1c1af2c

File tree

4 files changed

+183
-3
lines changed

4 files changed

+183
-3
lines changed

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ endif (NOT CMAKE_BUILD_TYPE)
3030
set(CMAKE_C_FLAGS_DEBUG "-Wall -Werror -ggdb -O2")
3131
set(CMAKE_C_FLAGS_RELEASE "-Wall -O2")
3232

33-
add_definitions(-D_GNU_SOURCE -DDWARVES_VERSION="v1.15")
33+
add_definitions(-D_GNU_SOURCE -DDWARVES_VERSION="v1.16")
3434
find_package(DWARF REQUIRED)
3535
find_package(ZLIB REQUIRED)
3636

Diff for: NEWS

+53
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,56 @@
1+
v1.16:
2+
3+
Mon Dec 16 2019
4+
5+
69df73444c69 (HEAD -> master, acme.korg/master) dwarves: Add -O2 to CFLAGS
6+
6d11dd157f75 elfcreator: Address initialization warning emitted by 'gcc -O6'
7+
1bc63a4cffa7 fprintf: Fixup truncation possibility pointed out by gcc -O2
8+
5c590fc29d06 ptr_table: Zero out new id ranges
9+
644466dce77f fprintf: Remove extraneous sizeof operator
10+
a59459bb80e7 fprintf: Account inline type __aligned__ member types for spacing
11+
56547f133a5b fprintf: Fix alignment of class members that are structs/enums/unions
12+
be37b64aef38 dwarves: Ignore static members for alignment
13+
cca018e495a8 SPEC: Add dwarves dependency on libdwarves1
14+
ccf3eebfcd9c btf_loader: Add support for BTF_KIND_FUNC
15+
f95fd85f7b53 pfunct: type->type == 0 is void, fix --compile for that
16+
3e8f09e304ba (origin/master, origin/HEAD) pdwtags: Print DW_TAG_subroutine_type as well
17+
3c5f2a224aa1 btf_encoder: Preserve and encode exported functions as BTF_KIND_FUNC
18+
910e060b5c4b btf_loader: Skip BTF_KIND_DATASEC entries
19+
96235a74a34d btf_loader: Replace if/else series with a proper switch {}
20+
a4ba2234ff58 btf_loader: Support BTF_KIND_VAR
21+
5965ce015eab dwarves: Fix ptr_table__add_with_id() handling of pt->nr_entries
22+
173911ac38ea btf_loader: Show the unknown kind numbers
23+
0d8e11e8568e pglobal: Allow passing the format path specifier, to use with BTF
24+
ba27df9f2f94 CMakeLists: Use lib/bpf/include/uapi when building libdwarves
25+
95517e1d995e libbpf: Get latest libbpf
26+
ca294eebfc47 MANIFEST: Add missing files
27+
d5e01d10e515 fprintf: Set tconf.type_spacing earlier
28+
c6a9a0eb6ac7 fprintf: Fix up decrementing recursivity level in type__fprintf()
29+
93c3cdf89715 cmake: Add -Wall to CFLAGS
30+
7360f0528ff3 elfcreator: Remove unused 'machine' variable
31+
0f52b11f911c prefcnt: Avoid ambiguous else with for_each macro
32+
608813d0affa pglobal: Avoid ambiguous else
33+
77d06c2d305d reorganize: Enclose bitfield routines under ifdef
34+
2221ae30bce9 reorganize: Ditch unused variable
35+
c419c513eae5 libbtf: Enlarge the 'cmd' buffer to not possibly truncate the pathname
36+
092fffe56701 btf_loader: Enum values are s32, cast before calling btf_elf__get32()
37+
7bfb1aa80f9a libctf: Enlarge the 'cmd' buffer to not possibly truncate the pathname
38+
f67c281f9841 fprintf: Correct the type for the 'cacheline' variable, it should be uint32_t
39+
7b36fab5a8df fprintf: Add guard against unlikely overlapping copy
40+
e737976c09d9 fprintf: Do not scrub type when looking up its type
41+
e95dacb704bf fprintf: Remove unused printf arg when printing enumerations
42+
71c4f83f2828 emit: Remove unused 'is_pointer' variable
43+
fe87354c31bb dwarves: Ditch unused asprintf() function
44+
60c73a769882 dwarves: We need to consistently check if 'conf was specified
45+
5fdfd09a6bbe dwarves: Fix check in type__find_first_biggest_size_base_type_member()
46+
24ced5be8a75 dwarf_loader: Fix array overrun access
47+
33e2d7aa35a7 ctf_loader: Plug leak when bailing out due to unknown tag
48+
aefa9303818b codiff: Remove unused filenames variable
49+
de5e72bc15fb btf_loader: Plug leak when bailing out due to unknown tag
50+
511a79129494 dwarves: Remove unused variable
51+
b1412a88bb61 fprintf: Fixup handling classes with no members
52+
[acme@quaco pahole]$
53+
154
v1.15
255

356
Thu Jun 27 2019

Diff for: changes-v1.16

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
v1.16 changes:
2+
3+
BTF encoder:
4+
5+
Andrii Nakryiko <[email protected]>:
6+
7+
- Preserve and encode exported functions as BTF_KIND_FUNC.
8+
9+
Add encoding of DWARF's DW_TAG_subprogram_type into BTF's BTF_KIND_FUNC
10+
(plus corresponding BTF_KIND_FUNC_PROTO). Only exported functions are converted
11+
for now. This allows to capture all the exported kernel functions, same subset
12+
that's exposed through /proc/kallsyms.
13+
14+
BTF loader:
15+
16+
Arnaldo Carvalho de Melo <[email protected]>
17+
18+
- Add support for BTF_KIND_FUNC
19+
20+
Some changes to the fprintf routines were needed, as BTF has as the
21+
function type just a BTF_KIND_FUNC_PROTO, while DWARF has as the type for a
22+
function its return value type. With a function->btf flag this was overcome and
23+
all the other goodies in pfunct are present.
24+
25+
Pretty printer:
26+
27+
Arnaldo Carvalho de Melo:
28+
29+
- Account inline type __aligned__ member types for spacing:
30+
31+
union {
32+
refcount_t rcu_users; /* 2568 4 */
33+
struct callback_head rcu __attribute__((__aligned__(8))); /* 2568 16 */
34+
- } __attribute__((__aligned__(8))); /* 2568 16 */
35+
+ } __attribute__((__aligned__(8))); /* 2568 16 */
36+
struct pipe_inode_info * splice_pipe; /* 2584 8 */
37+
38+
- Fix alignment of class members that are structs/enums/unions
39+
40+
E.g. look at that 'completion' member in this struct:
41+
42+
struct cpu_stop_done {
43+
atomic_t nr_todo; /* 0 4 */
44+
int ret; /* 4 4 */
45+
- struct completion completion; /* 8 32 */
46+
+ struct completion completion; /* 8 32 */
47+
48+
/* size: 40, cachelines: 1, members: 3 */
49+
/* last cacheline: 40 bytes */
50+
51+
- Fixup handling classes with no members, solving a NULL deref.
52+
53+
Gareth Lloyd <[email protected]>:
54+
55+
- Avoid infinite loop trying to determine type with static data member of its own type.
56+
57+
RPM spec file.
58+
59+
Jiri Olsa <[email protected]>
60+
61+
Add dwarves dependency on libdwarves1.
62+
63+
pfunct:
64+
65+
Arnaldo Carvalho de Melo <[email protected]>
66+
67+
- type->type == 0 is void, fix --compile for that
68+
69+
We were using the fall back for that, i.e. 'return 0;' was being emitted
70+
for a function returning void, noticed with using BTF as the format.
71+
72+
pdwtags:
73+
74+
- Print DW_TAG_subroutine_type as well
75+
76+
So that we can see at least via pdwtags those tags, be it from DWARF of BTF.
77+
78+
core:
79+
80+
Arnaldo Carvalho de Melo <[email protected]>
81+
82+
Fix ptr_table__add_with_id() handling of pt->nr_entries, covering how
83+
BTF variables IDs are encoded.
84+
85+
86+
pglobal:
87+
88+
Arnaldo Carvalho de Melo <[email protected]>:
89+
90+
- Allow passing the format path specifier, to use with BTF
91+
92+
I.e. now we can, just like with pahole, use:
93+
94+
pglobal -F btf --variable foo.o
95+
96+
To get the global variables.
97+
98+
Tree wide:
99+
100+
Arnaldo Carvalho de Melo <[email protected]>:
101+
102+
- Fixup issues pointed out by various coverity reports.
103+
104+
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>

Diff for: rpm/SPECS/dwarves.spec

+25-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
%define libver 1
33

44
Name: dwarves
5-
Version: 1.15
6-
Release: 2%{?dist}
5+
Version: 1.16
6+
Release: 1%{?dist}
77
License: GPLv2
88
Summary: Debugging Information Manipulation Tools (pahole & friends)
99
URL: http://acmel.wordpress.com
@@ -35,6 +35,15 @@ code generate on the resulting binaries.
3535
Another tool is pfunct, that can be used to find all sorts of information about
3636
functions, inlines, decisions made by the compiler about inlining, etc.
3737

38+
One example of pfunct usage is in the fullcircle tool, a shell that drivers
39+
pfunct to generate compileable code out of a .o file and then build it using
40+
gcc, with the same compiler flags, and then use codiff to make sure the
41+
original .o file and the new one generated from debug info produces the same
42+
debug info.
43+
44+
The btfdiff utility compares the output of pahole from BTF and DWARF to make
45+
sure they produce the same results.
46+
3847
%package -n %{libname}%{libver}
3948
Summary: Debugging information processing library
4049

@@ -118,6 +127,20 @@ make install DESTDIR=%{buildroot}
118127
%{_libdir}/%{libname}_reorganize.so
119128

120129
%changelog
130+
* Mon 16 Dec 2019 Arnaldo Carvalho de Melo <[email protected]> - 1.16-1
131+
- New release: 1.16
132+
- BTF encoder: Preserve and encode exported functions as BTF_KIND_FUNC.
133+
- BTF loader: Add support for BTF_KIND_FUNC
134+
- Pretty printer: Account inline type __aligned__ member types for spacing
135+
- Pretty printer: Fix alignment of class members that are structs/enums/unions
136+
- Pretty printer: Avoid infinite loop trying to determine type with static data member of its own type.
137+
- RPM spec file: Add dwarves dependency on libdwarves1.
138+
- pfunct: type->type == 0 is void, fix --compile for that
139+
- pdwtags: Print DW_TAG_subroutine_type as well
140+
- core: Fix ptr_table__add_with_id() handling of pt->nr_entries
141+
- pglobal: Allow passing the format path specifier, to use with BTF
142+
- Tree wide: Fixup issues pointed out by various coverity reports.
143+
121144
* Tue Nov 05 2019 Jiri Olsa <[email protected]> - 1.15-2
122145
- Add libdwarves version dependency to dwarves package
123146

0 commit comments

Comments
 (0)