aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2024-02-27 13:40:10 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2024-02-27 15:57:09 -0300
commit922085e3cff7e976cbb97b2e15c7f866956728ae (patch)
tree14d02fe0560fe01ded4b7f98c22633a74d49b05d
parentba8f6eb0b6b67c6e387f2cfbdeebe84466d11ed5 (diff)
downloadpahole-922085e3cff7e976cbb97b2e15c7f866956728ae.tar.gz
pahole: Prep 1.26v1.26
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--MANIFEST1
-rw-r--r--NEWS42
-rw-r--r--changes-v1.26228
-rw-r--r--rpm/SPECS/dwarves.spec36
4 files changed, 303 insertions, 4 deletions
diff --git a/MANIFEST b/MANIFEST
index 69b4ac8d..d13d7a59 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -54,6 +54,7 @@ changes-v1.22
changes-v1.23
changes-v1.24
changes-v1.25
+changes-v1.26
buildcmd.sh
COPYING
NEWS
diff --git a/NEWS b/NEWS
index bc2dc193..f3d2fc03 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,45 @@
+v1.26
+
+Tue Feb 27 2024
+
+ba8f6eb0b6b67c6e NEWS: Add missing list of changes for v1.25
+90201c2bde4b0ca8 prefcnt: cus__load_files() requires a non NULL conf_load
+f86ed770b5396cd5 dtagnames: cus__load_files() requires a non NULL conf_load
+b2e0f084eca03613 syscse: cus__load_files() requires a non NULL conf_load
+461f61ebaf8f3108 dwarf_loader: Print the line number in addition to the function when not finding the abstract origin
+6e665da56c78d436 pahole: Wait to find a DWARF CU with both the class and the type_enum
+be638365781ed0c8 pahole: Improve error message when not resolving symbolic names in filters
+e18ef2fed1b1a2c5 pahole: Implement --contains_enumerator=ENUMERATOR_NAME
+7146ad04b72b08a5 pahole: Do not use -1 to mean that a enumerator wasn't found in an enumeration
+97dce38eae062cf9 core: Introduce cu__for_each_enumeration()
+786ed0aa2ff5fe67 btfdiff: Do type expansion to cover "private" types and enumerations
+9661c589cae83c6b btf_loader: Fix loading of 32-bit signed enums
+a25293a66b737263 btfdiff: Parallelize loading BTF and DWARF
+e52cf114039af8f3 fprintf: When expanding types do it for union typedefs as well
+d05d4f528d08da06 fprintf: Factor out the fprintf of a union declaration, for reuse
+f97c080d4aac4f8f fprintf: When expanding types do it for struct typedefs as well
+eb4f49bca27fcca2 fprintf: Add missing space after expanding a structure for a struct member
+0064b74c5ef0f358 fprintf: When expanding types do it for enums as well
+1fd08c0f0021e7fb fprintf: Print number of bit paddings in class member types
+4fa81a30b9ca3b78 fprintf: Print number of bit holes in class member types
+85bdd96404efca19 fprintf: Print number of holes in class member types
+08fc8e3285733ec8 fprintf: Introduce method to print info about type of last member
+bd8d0536b4352b5d fprintf: Introduce struct to account holes in class member types
+fdd815151054d840 pahole: Make sure the features string is NUL terminated
+884c43ea82a154ce CMakeList.txt: Bump version to the upcoming 1.26 release, not out of the door yet
+c129fa7579483bba pahole: Add --btf_features_strict to reject unknown BTF features
+74a238a4368223c9 pahole: Add --supported_btf_features
+7bc9b9975545ab53 pahole: Add --btf_features support
+79e9df515e4d3e89 dwarves: Move ARRAY_SIZE() to dwarves.h
+f5c6c1365e7bb3dc btf_encoder, pahole: Move BTF encoding options into 'struct conf_load'
+37e3bf08e0314efa pahole: Don't keep structs in multiple RB trees
+d65499a8605c224b README: Remove old comments about ancient distros and add 'git submodule' instruction
+0a1944b19569c4f9 spec: Migrate license to a SPDX standardized one
+31bc0d7410572f6e dwarf_loader: DW_TAG_subroutine_type may have a DW_AT_byte_size
+bfa033b07f50a202 pdwtags: Print DW_TAG_constant tags
+afca84ff989d9729 fprintf: Add DW_TAG_constant pretty printer (constant__fprintf)
+cb7eb753694be3e8 dwarf_loader: Add support for DW_TAG_constant
+
v1.25
Thu Apr 13 2023
diff --git a/changes-v1.26 b/changes-v1.26
new file mode 100644
index 00000000..92fd134c
--- /dev/null
+++ b/changes-v1.26
@@ -0,0 +1,228 @@
+pahole:
+
+- When expanding types using 'pahole -E' do it for union and struct typedefs and for enums too.
+
+ E.g: that 'state' field in 'struct module':
+
+ $ pahole module | head
+ struct module {
+ enum module_state state; /* 0 4 */
+
+ /* XXX 4 bytes hole, try to pack */
+
+ struct list_head list; /* 8 16 */
+ char name[56]; /* 24 56 */
+ /* --- cacheline 1 boundary (64 bytes) was 16 bytes ago --- */
+ struct module_kobject mkobj; /* 80 96 */
+ /* --- cacheline 2 boundary (128 bytes) was 48 bytes ago --- */
+ $
+
+ now gets expanded:
+
+ $ pahole -E module | head
+ struct module {
+ enum module_state {
+ MODULE_STATE_LIVE = 0,
+ MODULE_STATE_COMING = 1,
+ MODULE_STATE_GOING = 2,
+ MODULE_STATE_UNFORMED = 3,
+ } state; /* 0 4 */
+
+ /* XXX 4 bytes hole, try to pack */
+
+ $
+
+- Print number of holes, bit holes and bit paddings in class member types.
+
+ Doing this recursively to show how much waste a complex data structure has
+ is something that still needs to be done, there were the low hanging fruits
+ on the path to having that feature.
+
+ For instance, for 'struct task_struct' in the Linux kernel we get this
+ extra info:
+
+ --- task_struct.before.c 2024-02-09 11:38:39.249638750 -0300
+ +++ task_struct.after.c 2024-02-09 16:19:34.221134835 -0300
+ @@ -29,6 +29,12 @@
+
+ /* --- cacheline 2 boundary (128 bytes) --- */
+ struct sched_entity se; /* 128 256 */
+ +
+ + /* XXX last struct has 3 holes */
+ +
+ /* --- cacheline 6 boundary (384 bytes) --- */
+ struct sched_rt_entity rt; /* 384 48 */
+ struct sched_dl_entity dl; /* 432 224 */
+ +
+ + /* XXX last struct has 1 bit hole */
+ +
+ /* --- cacheline 10 boundary (640 bytes) was 16 bytes ago --- */
+ const struct sched_class * sched_class; /* 656 8 */
+ struct rb_node core_node; /* 664 24 */
+ @@ -100,6 +103,9 @@
+ /* --- cacheline 35 boundary (2240 bytes) was 16 bytes ago --- */
+ struct list_head tasks; /* 2256 16 */
+ struct plist_node pushable_tasks; /* 2272 40 */
+ +
+ + /* XXX last struct has 1 hole */
+ +
+ /* --- cacheline 36 boundary (2304 bytes) was 8 bytes ago --- */
+ struct rb_node pushable_dl_tasks; /* 2312 24 */
+ struct mm_struct * mm; /* 2336 8 */
+ @@ -172,6 +178,9 @@
+ /* XXX last struct has 4 bytes of padding */
+
+ struct vtime vtime; /* 2744 48 */
+ +
+ + /* XXX last struct has 1 hole */
+ +
+ /* --- cacheline 43 boundary (2752 bytes) was 40 bytes ago --- */
+ atomic_t tick_dep_mask; /* 2792 4 */
+
+ @@ -396,9 +405,12 @@
+ /* --- cacheline 145 boundary (9280 bytes) --- */
+ struct thread_struct thread __attribute__((__aligned__(64))); /* 9280 4416 */
+
+ + /* XXX last struct has 1 hole, 1 bit hole */
+ +
+ /* size: 13696, cachelines: 214, members: 262 */
+ /* sum members: 13518, holes: 21, sum holes: 162 */
+ /* sum bitfield members: 82 bits, bit holes: 2, sum bit holes: 46 bits */
+ /* member types with holes: 4, total: 6, bit holes: 2, total: 2 */
+ /* paddings: 6, sum paddings: 49 */
+ /* forced alignments: 2, forced holes: 2, sum forced holes: 88 */
+ };
+
+- Introduce --contains_enumerator=ENUMERATOR_NAME:
+
+ E.g.:
+
+ $ pahole --contains_enumerator S_VERSION
+ enum file_time_flags {
+ S_ATIME = 1,
+ S_MTIME = 2,
+ S_CTIME = 4,
+ S_VERSION = 8,
+ }
+ $
+
+ The shorter form --contains_enum is also accepted.
+
+- Fix pretty printing when using DWARF, where sometimes the class (-C) and a specified "type_enum",
+ may not be present on the same CU, so wait till both are found.
+
+ Now this example that reads the 'struct perf_event_header' and 'enum perf_event_type'
+ from the DWARF info in ~/bin/perf to pretty print records in the perf.data file works
+ just like when using type info from BTF in ~/bin/perf:
+
+ $ pahole -F dwarf -V ~/bin/perf \
+ --header=perf_file_header \
+ --seek_bytes '$header.data.offset' \
+ --size_bytes='$header.data.size' \
+ -C 'perf_event_header(sizeof,type,type_enum=perf_event_type,filter=type==PERF_RECORD_MMAP2)' \
+ --prettify perf.data --count 1
+ pahole: sizeof_operator for 'perf_event_header' is 'size'
+ pahole: type member for 'perf_event_header' is 'type'
+ pahole: type enum for 'perf_event_header' is 'perf_event_type'
+ pahole: filter for 'perf_event_header' is 'type==PERF_RECORD_MMAP2'
+ pahole: seek bytes evaluated from --seek_bytes=$header.data.offset is 0x3f0
+ pahole: size bytes evaluated from --size_bytes=$header.data.size is 0xd10
+ // type=perf_event_header, offset=0xc20, sizeof=8, real_sizeof=112
+ {
+ .header = {
+ .type = PERF_RECORD_MMAP2,
+ .misc = 2,
+ .size = 112,
+ },
+ .pid = 1533617,
+ .tid = 1533617,
+ .start = 94667542700032,
+ .len = 90112,
+ .pgoff = 16384,{
+ .maj = 0,
+ .min = 33,
+ .ino = 35914923,
+ .ino_generation = 26870,
+ },{
+ .build_id_size = 0,
+ .__reserved_1 = 0,
+ .__reserved_2 = 0,
+ .build_id = { 33, 0, 0, 0, -85, 4, 36, 2, 0, 0, 0, 0, -10, 104, 0, 0, 0, 0, 0, 0 },
+ },
+ .prot = 5,
+ .flags = 2,
+ .filename = "/usr/bin/ls",
+ },
+ $
+
+DWARF loader:
+
+- Add support for DW_TAG_constant, first seen in Go DWARF.
+
+- Fix loading DW_TAG_subroutine_type generated by the Go compiler, where it may
+ have a DW_AT_byte_size. Go DWARF. And pretty print it as if
+ it was from C, this helped in writing BPF programs to attach to Go binaries, using
+ uprobes.
+
+BTF loader:
+
+- Fix loading of 32-bit signed enums.
+
+BTF encoder:
+
+- Add 'pahole --btf_features' to allow consumers to specify an opt-in set of
+ features they want to use in BTF encoding.
+
+ Supported features are a comma-separated combination of
+
+ encode_force Ignore invalid symbols when encoding BTF.
+ var Encode variables using BTF_KIND_VAR in BTF.
+ float Encode floating-point types in BTF.
+ decl_tag Encode declaration tags using BTF_KIND_DECL_TAG.
+ type_tag Encode type tags using BTF_KIND_TYPE_TAG.
+ enum64 Encode enum64 values with BTF_KIND_ENUM64.
+ optimized_func Encode representations of optimized functions
+ with suffixes like ".isra.0" etc
+ consistent_func Avoid encoding inconsistent static functions.
+ These occur when a parameter is optimized out
+ in some CUs and not others, or when the same
+ function name has inconsistent BTF descriptions
+ in different CUs.
+
+ Specifying "--btf_features=all" is the equivalent to setting all of the
+ above. If pahole does not know about a feature specified in
+ --btf_features it silently ignores it.
+
+ The --btf_features can either be specified via a single comma-separated
+ list
+ --btf_features=enum64,float
+
+ ...or via multiple --btf_features values
+
+ --btf_features=enum64 --btf_features=float
+
+ These properties allow us to use the --btf_features option in the kernel
+ scripts/pahole_flags.sh script to specify the desired set of BTF
+ features.
+
+ If a feature named in --btf_features is not present in the version of
+ pahole used, BTF encoding will not complain. This is desired because it
+ means we no longer have to tie new features to a specific pahole
+ version.
+
+ Use --btf_features_strict to change that behaviour and bail out if one of
+ the requested features isn't present.
+
+ To see the supported features, use:
+
+ $ pahole --supported_btf_features
+ encode_force,var,float,decl_tag,type_tag,enum64,optimized_func,consistent_func
+ $
+
+btfdiff:
+
+- Parallelize loading BTF and DWARF, speeding up a bit.
+
+- Do type expansion to cover "private" types and enumerations.
+
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
diff --git a/rpm/SPECS/dwarves.spec b/rpm/SPECS/dwarves.spec
index 2080b272..6f19ca59 100644
--- a/rpm/SPECS/dwarves.spec
+++ b/rpm/SPECS/dwarves.spec
@@ -2,8 +2,8 @@
%define libver 1
Name: dwarves
-Version: 1.25
-Release: 2%{?dist}
+Version: 1.26
+Release: 1%{?dist}
License: GPL-2.0-only
Summary: Debugging Information Manipulation Tools (pahole & friends)
URL: http://acmel.wordpress.com
@@ -79,7 +79,7 @@ rm -Rf %{buildroot}
%files
%doc README.ctracer
%doc README.btf
-%doc changes-v1.25
+%doc changes-v1.26
%doc NEWS
%{_bindir}/btfdiff
%{_bindir}/codiff
@@ -131,9 +131,31 @@ rm -Rf %{buildroot}
%{_libdir}/%{libname}_reorganize.so
%changelog
-* Wed Jun 14 2023 Viktor Malik <vmalik@redhat.com> - 1.25-2
+* Tue Feb 27 2024 Arnaldo Carvalho de Melo <acme@redhat.com> - 1.26-1
+- New release: v1.26
+- When expanding types using 'pahole -E' do it for union and struct typedefs and for enums too.
+- Print number of holes, bit holes and bit paddings in class member types.
+- Introduce --contains_enumerator=ENUMERATOR_NAME:
+- Fix pretty printing using DWARF, waiting for a CU with both class (-C) and a specified "type_enum".
+- Add support for DW_TAG_constant in the DWARF loader, first seen in Go DWARF.
+- Fix loading DW_TAG_subroutine_type generated by the Go compiler.
+- Fix loading of 32-bit signed enums from BTF.
+- Add 'pahole --btf_features' to allow consumers to specify an opt-in set of features they want to use in BTF encoding.
+- Parallelize loading BTF and DWARF, speeding up a bit btfdiff.
+- Do type expansion to cover "private" types and enumerations in btfdiff.
+
+* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.25-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
+
+* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.25-4
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
+
+* Wed Oct 11 2023 Viktor Malik <vmalik@redhat.com> - 1.25-3
- Migrate license to SPDX
+* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.25-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
+
* Sat Apr 8 2023 Arnaldo Carvalho de Melo <acme@redhat.com> - 1.25-1
- New release: v1.25
- Support for DW_TAG_unspecified_type more generally.
@@ -146,6 +168,12 @@ rm -Rf %{buildroot}
- Support --compile from DWARF in addition to from BTF.
- Exclude RUST CUs in 'btfdiff', as those are not yet being BTF encoded.
+* Fri Feb 17 2023 Arnaldo Carvalho de Melo <acme@redhat.com> - 1.24-3
+- Backport the DW_TAG_unspecified_type support while 1.25 gets ready wrt optimized functions support
+
+* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.24-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
+
* Wed Aug 17 2022 Arnaldo Carvalho de Melo <acme@redhat.com> - 1.24-1
- New release: v1.24
- Add support to BTF_KIND_ENUM64.