28a4c3fd40
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
213 lines
7.4 KiB
Diff
213 lines
7.4 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index e2c0ee107940..88a364febaf2 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -143,6 +143,8 @@ install(TARGETS dwarves LIBRARY DESTINATION ${LIB_INSTALL_DIR})
|
|
install(TARGETS dwarves dwarves_emit dwarves_reorganize LIBRARY DESTINATION ${LIB_INSTALL_DIR})
|
|
install(FILES dwarves.h dwarves_emit.h dwarves_reorganize.h
|
|
dutil.h gobuffer.h list.h rbtree.h strings.h
|
|
+ btf_encoder.h config.h ctf_encoder.h ctf.h
|
|
+ elfcreator.h elf_symtab.h hash.h libbtf.h libctf.h
|
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/dwarves/)
|
|
install(FILES man-pages/pahole.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1/)
|
|
install(PROGRAMS ostra/ostra-cg DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
|
diff --git a/ostra/ostra-cg b/ostra/ostra-cg
|
|
index 0f4009a24558..52c902e24869 100755
|
|
--- a/ostra/ostra-cg
|
|
+++ b/ostra/ostra-cg
|
|
@@ -1,4 +1,4 @@
|
|
-#!/usr/bin/python
|
|
+#!/usr/bin/python3
|
|
# ostra-cg - generate callgraphs from encoded trace
|
|
#
|
|
# Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
@@ -386,7 +386,7 @@ def method_stats(class_def, callgraph):
|
|
|
|
if __name__ == '__main__':
|
|
if len(sys.argv) not in [ 3, 4 ]:
|
|
- print "usage: ostra-cg <traced_class> <encoded_trace> [object]"
|
|
+ print("usage: ostra-cg <traced_class> <encoded_trace> [object]")
|
|
sys.exit(1)
|
|
|
|
gen_html = True
|
|
@@ -402,9 +402,9 @@ if __name__ == '__main__':
|
|
class_def = ostra.class_definition(class_def_file = "%s.fields" % traced_class,
|
|
class_methods_file = "%s.functions" % traced_class)
|
|
new_callgraph_file(traced_class)
|
|
- class_def.parse_file(encoded_trace, verbose = verbose,
|
|
- process_record = process_record,
|
|
- my_object = my_object)
|
|
+ class_def.parse_file(encoded_trace, verbose = verbose,
|
|
+ process_record = process_record,
|
|
+ my_object = my_object)
|
|
if gen_html:
|
|
print_where_fields_changed()
|
|
close_callgraph_file()
|
|
diff --git a/ostra/python/ostra.py b/ostra/python/ostra.py
|
|
index dd240ae1a180..86fe07947a5d 100755
|
|
--- a/ostra/python/ostra.py
|
|
+++ b/ostra/python/ostra.py
|
|
@@ -1,4 +1,4 @@
|
|
-#!/usr/bin/python
|
|
+#!/usr/bin/python3
|
|
#
|
|
# Copyright (C) 2005, 2006, 2007 Arnaldo Carvalho de Melo
|
|
#
|
|
@@ -206,7 +206,7 @@ class class_definition:
|
|
break
|
|
if verbose:
|
|
nr_lines += 1
|
|
- print "\r%d" % nr_lines,
|
|
+ print("\r%d" % nr_lines,)
|
|
|
|
self.parse_record(line)
|
|
|
|
@@ -245,8 +245,8 @@ class class_definition:
|
|
continue
|
|
|
|
if verbose:
|
|
- print "plot_methods: plotting %s method (%d samples)" % \
|
|
- (current_method.name, nr_samples)
|
|
+ print("plot_methods: plotting %s method (%d samples)" % \
|
|
+ (current_method.name, nr_samples))
|
|
|
|
entries = [float("%d.0" % entry) for entry in range(nr_samples)]
|
|
samples = current_method.times
|
|
@@ -323,11 +323,11 @@ def plot_field(name, directory, tstamps, samples, nr_samples, plot_fmt = None,
|
|
if current_plot_fmt == "filter_dev":
|
|
std = std_deviation(samples) * 2
|
|
if verbose:
|
|
- print "filter_dev(%s) std=%d" % (name, std)
|
|
+ print("filter_dev(%s) std=%d" % (name, std))
|
|
for i in range(nr_samples):
|
|
if samples[i] > std:
|
|
if verbose:
|
|
- print "%s: filtering out %d" % (name, samples[i])
|
|
+ print("%s: filtering out %d" % (name, samples[i]))
|
|
samples[i] = 0
|
|
field_mean = mean(samples)
|
|
yaxis_plot_fmt = FuncFormatter(pylab_formatter)
|
|
@@ -376,7 +376,7 @@ def plot(class_def, callgraph, verbose = False):
|
|
continue
|
|
|
|
if verbose:
|
|
- print "ostra-plot: plotting %s field (%d samples)" % (current_field.name, nr_samples)
|
|
+ print("ostra-plot: plotting %s field (%d samples)" % (current_field.name, nr_samples))
|
|
|
|
tstamps = [float("%d.%06d" % (entry.tstamp.seconds, entry.tstamp.microseconds)) \
|
|
for entry in current_field.changes]
|
|
@@ -392,6 +392,6 @@ if __name__ == '__main__':
|
|
import sys
|
|
c = class_definition(sys.argv[1], sys.argv[2])
|
|
for field in c.fields.values():
|
|
- print "%s: %s" % (field, field.table)
|
|
+ print("%s: %s" % (field, field.table))
|
|
for method in c.methods.values():
|
|
- print "%d: %s" % (method.function_id, method.name)
|
|
+ print("%d: %s" % (method.function_id, method.name))
|
|
diff --git a/rpm/SPECS/dwarves.spec b/rpm/SPECS/dwarves.spec
|
|
index 5d8f60879afa..be2c29f3792c 100644
|
|
--- a/rpm/SPECS/dwarves.spec
|
|
+++ b/rpm/SPECS/dwarves.spec
|
|
@@ -5,14 +5,13 @@ Name: dwarves
|
|
Version: 1.13
|
|
Release: 1%{?dist}
|
|
License: GPLv2
|
|
-Summary: Debugging Information Manipulation Tools
|
|
-Group: Development/Tools
|
|
+Summary: Debugging Information Manipulation Tools (pahole & friends)
|
|
URL: http://acmel.wordpress.com
|
|
-Source: http://fedorapeople.org/~acme/dwarves/%{name}-%{version}.tar.bz2
|
|
+Source: http://fedorapeople.org/~acme/dwarves/%{name}-%{version}.tar.xz
|
|
+BuildRequires: gcc
|
|
BuildRequires: cmake
|
|
BuildRequires: zlib-devel
|
|
BuildRequires: elfutils-devel >= 0.130
|
|
-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
|
|
|
%description
|
|
dwarves is a set of tools that use the debugging information inserted in
|
|
@@ -37,14 +36,12 @@ functions, inlines, decisions made by the compiler about inlining, etc.
|
|
|
|
%package -n %{libname}%{libver}
|
|
Summary: Debugging information processing library
|
|
-Group: Development/Libraries
|
|
|
|
%description -n %{libname}%{libver}
|
|
Debugging information processing library.
|
|
|
|
%package -n %{libname}%{libver}-devel
|
|
Summary: Debugging information library development files
|
|
-Group: Development/Libraries
|
|
Requires: %{libname}%{libver} = %{version}-%{release}
|
|
|
|
%description -n %{libname}%{libver}-devel
|
|
@@ -61,19 +58,12 @@ make VERBOSE=1 %{?_smp_mflags}
|
|
rm -Rf %{buildroot}
|
|
make install DESTDIR=%{buildroot}
|
|
|
|
-%post -n %{libname}%{libver} -p /sbin/ldconfig
|
|
-
|
|
-%postun -n %{libname}%{libver} -p /sbin/ldconfig
|
|
-
|
|
-%clean
|
|
-rm -rf %{buildroot}
|
|
+%ldconfig_scriptlets -n %{libname}%{libver}
|
|
|
|
%files
|
|
-%defattr(0644,root,root,0755)
|
|
%doc README.ctracer
|
|
%doc README.btf
|
|
%doc NEWS
|
|
-%defattr(0755,root,root,0755)
|
|
%{_bindir}/btfdiff
|
|
%{_bindir}/codiff
|
|
%{_bindir}/ctracer
|
|
@@ -99,19 +89,26 @@ rm -rf %{buildroot}
|
|
%attr(0755,root,root) %{_datadir}/dwarves/runtime/python/ostra.py*
|
|
|
|
%files -n %{libname}%{libver}
|
|
-%defattr(0644,root,root,0755)
|
|
%{_libdir}/%{libname}.so.*
|
|
%{_libdir}/%{libname}_emit.so.*
|
|
%{_libdir}/%{libname}_reorganize.so.*
|
|
|
|
%files -n %{libname}%{libver}-devel
|
|
-%defattr(0644,root,root,0755)
|
|
%doc MANIFEST README
|
|
+%{_includedir}/dwarves/btf_encoder.h
|
|
+%{_includedir}/dwarves/config.h
|
|
+%{_includedir}/dwarves/ctf_encoder.h
|
|
+%{_includedir}/dwarves/ctf.h
|
|
+%{_includedir}/dwarves/dutil.h
|
|
%{_includedir}/dwarves/dwarves.h
|
|
%{_includedir}/dwarves/dwarves_emit.h
|
|
%{_includedir}/dwarves/dwarves_reorganize.h
|
|
-%{_includedir}/dwarves/dutil.h
|
|
+%{_includedir}/dwarves/elfcreator.h
|
|
+%{_includedir}/dwarves/elf_symtab.h
|
|
%{_includedir}/dwarves/gobuffer.h
|
|
+%{_includedir}/dwarves/hash.h
|
|
+%{_includedir}/dwarves/libbtf.h
|
|
+%{_includedir}/dwarves/libctf.h
|
|
%{_includedir}/dwarves/list.h
|
|
%{_includedir}/dwarves/rbtree.h
|
|
%{_includedir}/dwarves/strings.h
|
|
@@ -120,6 +117,16 @@ rm -rf %{buildroot}
|
|
%{_libdir}/%{libname}_reorganize.so
|
|
|
|
%changelog
|
|
+* Tue Apr 23 2019 Arnaldo Carvalho de Melo <acme@redhat.com> - 1.13-1
|
|
+- New release: 1.13
|
|
+- Infer __packed__ attributes, i.e. __attribute__((__packed__))
|
|
+- Support DW_AT_alignment, i.e. __attribute__((__aligned__(N)))
|
|
+- Decode BTF type format and pretty print it
|
|
+- BTF encoding fixes
|
|
+- Use libbpf's BTF deduplication
|
|
+- Support unions as arguments to -C/--class
|
|
+- New 'pfunct --compile' generates compilable output with type definitions
|
|
+
|
|
* Thu Aug 16 2018 Arnaldo Carvalho de Melo <acme@kernel.org> - 1.12-1
|
|
- New release:
|
|
- union member cacheline boundaries for all inner structs
|