Compare commits

..

No commits in common. "cd4c85c1c8cdaa3acc7e1c5ba98fc90b6627bb82" and "a9ca898dd61085ee9e2e493f572a6a3064007d92" have entirely different histories.

7 changed files with 66 additions and 91 deletions

View File

@ -1,47 +0,0 @@
From b9607b8bf5fe3180ae4cd44cddaf054e5595e699 Mon Sep 17 00:00:00 2001
From: Yonghong Song <yonghong.song@linux.dev>
Date: Wed, 24 Apr 2024 15:35:38 -0700
Subject: [PATCH dwarves] btf_encoder: Fix dwarf int type with greater-than-16 byte issue
Nick Desaulniers and Xin Liu separately reported that int type might
have greater-than-16 byte size ([1] and [2]). More specifically, the
reported int type sizes are 1024 and 64 bytes.
The libbpf and bpf program does not really support any int type greater
than 16 bytes. Therefore, with current pahole, btf encoding will fail
with greater-than-16 byte int types.
Since for now bpf does not support '> 16' bytes int type, the simplest
way is to sanitize such types, similar to existing conditions like
'!byte_sz' and 'byte_sz & (byte_sz - 1)'. This way, pahole won't
call libbpf with an unsupported int type size. The patch [3] was
proposed before. Now I resubmitted this patch as there are another
failure due to the same issue.
[1] https://github.com/libbpf/libbpf/pull/680
[2]https://lore.kernel.org/bpf/20240422144538.351722-1-liuxin350@huawei.com/
[3] https://lore.kernel.org/bpf/20230426055030.3743074-1-yhs@fb.com/
Cc: Xin Liu <liuxin350@huawei.com>
Cc: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
---
btf_encoder.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/btf_encoder.c b/btf_encoder.c
index 65f6e71..1aa0ad0 100644
--- a/btf_encoder.c
+++ b/btf_encoder.c
@@ -394,7 +394,7 @@ static int32_t btf_encoder__add_base_type(struct btf_encoder *encoder, const str
* these non-regular int types to avoid libbpf/kernel complaints.
*/
byte_sz = BITS_ROUNDUP_BYTES(bt->bit_size);
- if (!byte_sz || (byte_sz & (byte_sz - 1))) {
+ if (!byte_sz || (byte_sz & (byte_sz - 1)) || byte_sz > 16) {
name = "__SANITIZED_FAKE_INT__";
byte_sz = 4;
}
--
2.33.0

View File

@ -0,0 +1,59 @@
From 66d12e4790b7c5e508b75e805589849fee782a49 Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Tue, 2 Feb 2021 09:38:46 -0300
Subject: [PATCH] dtagnames: Stop using the deprecated mallinfo() function
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bulding on fedora rawhide gets us:
/home/acme/git/pahole/dtagnames.c:17:16: error: mallinfo is deprecated [-Werror=deprecated-declarations]
17 | struct mallinfo m = mallinfo();
| ^~~~~~~~
In file included from /home/acme/git/pahole/dtagnames.c:10:
/usr/include/malloc.h:118:24: note: declared here
118 | extern struct mallinfo mallinfo (void) __THROW __MALLOC_DEPRECATED;
| ^~~~~~~~
cc1: all warnings being treated as errors
glibc-2.32.9000-26.fc34.x86_64
So stop using it, was just for debugging/assessing memory usage.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
dtagnames.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/dtagnames.c b/dtagnames.c
index 0ffcbf7..6a24c37 100644
--- a/dtagnames.c
+++ b/dtagnames.c
@@ -7,18 +7,10 @@
#include <stdio.h>
#include <stdlib.h>
-#include <malloc.h>
#include "dwarves.h"
#include "dutil.h"
-static void print_malloc_stats(void)
-{
- struct mallinfo m = mallinfo();
-
- fprintf(stderr, "size: %u\n", m.uordblks);
-}
-
static int class__tag_name(struct tag *tag, struct cu *cu __unused,
void *cookie __unused)
{
@@ -54,7 +46,6 @@ int main(int argc __unused, char *argv[])
}
cus__dump_class_tag_names(cus);
- print_malloc_stats();
rc = EXIT_SUCCESS;
out:
cus__delete(cus);

Binary file not shown.

View File

@ -1,22 +1,22 @@
%define libname libdwarves
%define libver 1
%define libbpfver 1.2.0
%define libbpfver 0.1.0
Name: dwarves
Version: 1.25
Release: 3
Version: 1.17
Release: 2
License: GPLv2
Summary: Debugging Information Manipulation Tools
URL: http://acmel.wordpress.com
Source: http://fedorapeople.org/~acme/dwarves/%{name}-%{version}.tar.xz
Source1: https://github.com/libbpf/libbpf/archive/refs/tags/v%{libbpfver}.tar.gz
Source: http://github.com/acmel/dwarves/archive/v%{version}.tar.gz
Source1: http://github.com/libbpf/libbpf/archive/v%{libbpfver}.tar.gz
Requires: %{libname}%{libver} = %{version}-%{release}
BuildRequires: gcc
BuildRequires: cmake
BuildRequires: zlib-devel
BuildRequires: elfutils-devel >= 0.170
Patch0: backport-btf_encoder-Fix-dwarf-int-type-with-greater-than-16-.patch
Patch6000: dtagnames-stop-using-the-deprecated-mallinfo-function.patch
%description
dwarves is a set of tools that use the debugging information inserted in
@ -41,10 +41,6 @@ Debugging information processing library development files.
tar -zxvf %{SOURCE1} --strip-components 1 -C %{_builddir}/%{name}-%{version}/lib/bpf/
%build
# Remove _FORTIFY_SOURCE from CFLAGS or else will get below error:
# error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
export CFLAGS=$(echo %optflags | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g')
%cmake .
make VERBOSE=1 %{?_smp_mflags}
@ -57,7 +53,7 @@ make install DESTDIR=%{buildroot}
%files
%doc README.ctracer
%doc README.btf
%doc changes-v%{version}
%doc changes-v1.17
%doc NEWS
%{_bindir}/*
%dir %{_datadir}/dwarves/
@ -84,39 +80,6 @@ make install DESTDIR=%{buildroot}
%{_libdir}/%{libname}_reorganize.so
%changelog
* Fri Aug 16 2024 wangqiang <wangqiang1@kylinos.cn> - 1.25-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Fix packaging wrong change doc
* Mon Jul 29 2024 - liuxin <liuxin350@huawei.com> - 1.25-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: fix dwarf int type with greater than 16 bytes issue
* Sat Aug 19 2023 Chenxi Mao <chenxi.mao@suse.com> - 1.25-1
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: Upgrade dwarves version to 1.25 to fix build error
if kernel version upgrade to 6.4
* Mon Mar 21 2022 Kai Liu <kai.liu@suse.com> - 1.22-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: Fix spew of warnings if build kernel with LLVM and
CONFIG_DEBUG_INFO_BTF after commit 32ef9e5054ec
("Makefile.debug: re-enable debug info for .S files")
* Mon Mar 21 2022 - Kai Liu <kai.liu@suse.com> - 1.22-1
- Upgrade to v1.22. Also upgrade bundled libbpf to commit 393a058,
the same as upstream submodule version.
Introduce a patch from upstream commit 73383b3a3 to avoid using
deprecated libbpf APIs.
* Mon May 24 2021 xiaqirong <xiaqirong1@huawei.com> - 1.17-2
- Type:bugfix
- ID:NA

BIN
v0.1.0.tar.gz Normal file

Binary file not shown.

BIN
v1.17.tar.gz Normal file

Binary file not shown.

Binary file not shown.