import crash-trace-command-2.0-17.el8

This commit is contained in:
CentOS Sources 2020-11-03 06:57:00 -05:00 committed by Andrew Lukoshko
parent 93e7d95add
commit 3db73d93b5
2 changed files with 56 additions and 3 deletions

View File

@ -0,0 +1,43 @@
Fix the extension trace.so for RHEL7.6, which moved
ftrace_event_call.data into an anonymous union, and the
previous offset has changed, so the trace.so extension
module fails to load, indicating "no commands registered:
shared object unloaded".
--- crash-trace-command-2.0/trace.c.orig
+++ crash-trace-command-2.0/trace.c
@@ -853,8 +853,18 @@ static int syscall_get_enter_fields(ulon
inited = 1;
data_offset = MAX(MEMBER_OFFSET("ftrace_event_call", "data"),
MEMBER_OFFSET("trace_event_call", "data"));
- if (data_offset < 0)
- return -1;
+ if (data_offset < 0) {
+ /*
+ * rhel-7.6 moved the .data member into an anonymous union.
+ */
+ if (MEMBER_EXISTS("ftrace_event_call", "rh_data") &&
+ MEMBER_EXISTS("ftrace_event_data", "data")) {
+ data_offset = MEMBER_OFFSET("ftrace_event_call", "rh_data") +
+ MEMBER_OFFSET("ftrace_event_data", "data");
+ inited = 2;
+ } else
+ return -1;
+ }
enter_fields_offset = MEMBER_OFFSET("syscall_metadata", "enter_fields");
if (enter_fields_offset < 0)
@@ -868,6 +878,12 @@ work:
"read ftrace_event_call data", RETURN_ON_ERROR))
return -1;
+ if (inited == 2) {
+ if (!readmem(metadata, KVADDR, &metadata, sizeof(metadata),
+ "read ftrace_event_call data (indirect rh_data)", RETURN_ON_ERROR))
+ return -1;
+ }
+
*fields = metadata + enter_fields_offset;
return 0;
}

View File

@ -4,11 +4,11 @@
Summary: Trace extension module for the crash utility Summary: Trace extension module for the crash utility
Name: crash-trace-command Name: crash-trace-command
Version: 2.0 Version: 2.0
Release: 15%{?dist} Release: 17%{?dist}
License: GPLv2 License: GPLv2
Group: Development/Debuggers Group: Development/Debuggers
Source: %{name}-%{version}.tar.gz Source: https://github.com/crash-utility/crash-extensions/blob/master/%{name}-%{version}.tar.gz
URL: http://people.redhat.com/anderson/extensions/%{name}-%{version}.tar.gz URL: https://crash-utility.github.io/extensions.html
# Vendor: Fujitsu Limited # Vendor: Fujitsu Limited
# Packager: Qiao Nuohan <qiaonuohan@cn.fujitsu.com> # Packager: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
ExclusiveOS: Linux ExclusiveOS: Linux
@ -30,6 +30,7 @@ Patch8: TRACE_EVENT_FL_TRACEPOINT_flag.patch
Patch9: big_endian_nr_pages.patch Patch9: big_endian_nr_pages.patch
Patch10: ppc64_ring_buffer_read.patch Patch10: ppc64_ring_buffer_read.patch
Patch11: rhel8_build.patch Patch11: rhel8_build.patch
Patch12: ftrace_event_call_rh_data.patch
%description %description
Command for reading ftrace data from a dumpfile. Command for reading ftrace data from a dumpfile.
@ -48,6 +49,7 @@ Command for reading ftrace data from a dumpfile.
%patch9 -p1 -b big_endian_nr_pages.patch %patch9 -p1 -b big_endian_nr_pages.patch
%patch10 -p1 -b ppc64_ring_buffer_read.patch %patch10 -p1 -b ppc64_ring_buffer_read.patch
%patch11 -p1 -b rhel8_build.patch %patch11 -p1 -b rhel8_build.patch
%patch12 -p1 -b ftrace_event_call_rh_data.patch
%build %build
make make
@ -65,6 +67,14 @@ rm -rf %{buildroot}
%doc COPYING %doc COPYING
%changelog %changelog
* Mon Jul 27 2020 Bhupesh Sharma <bhsharma@redhat.com> - 2.0-17
- Chnage Source/URL to point to the latest github location
Resolves: rhbz#1851746
* Tue Apr 28 2019 Dave Anderson <anderson@redhat.com> - 2.0-16
- Fix for RHEL7 ftrace_event_call data structure change
Resolves: rhbz#1827734
* Wed Sep 19 2018 Dave Anderson <anderson@redhat.com> - 2.0-15 * Wed Sep 19 2018 Dave Anderson <anderson@redhat.com> - 2.0-15
- annocheck: link with -Wl,-z,now - annocheck: link with -Wl,-z,now
Resolves: rhbz#1630558 Resolves: rhbz#1630558