From fce9a2131896534bd8c43831f9413c467d734b3c Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 30 2018 05:09:19 +0000 Subject: import crash-trace-command-2.0-14.el7 --- diff --git a/SOURCES/ftrace_event_call_rh_data.patch b/SOURCES/ftrace_event_call_rh_data.patch new file mode 100644 index 0000000..4c38597 --- /dev/null +++ b/SOURCES/ftrace_event_call_rh_data.patch @@ -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; + } diff --git a/SPECS/crash-trace-command.spec b/SPECS/crash-trace-command.spec index 65a28bc..d8cd934 100644 --- a/SPECS/crash-trace-command.spec +++ b/SPECS/crash-trace-command.spec @@ -4,7 +4,7 @@ Summary: Trace extension module for the crash utility Name: crash-trace-command Version: 2.0 -Release: 13%{?dist} +Release: 14%{?dist} License: GPLv2 Group: Development/Debuggers Source: %{name}-%{version}.tar.gz @@ -29,6 +29,7 @@ Patch7: linux_4.2_support.patch Patch8: TRACE_EVENT_FL_TRACEPOINT_flag.patch Patch9: big_endian_nr_pages.patch Patch10: ppc64_ring_buffer_read.patch +Patch11: ftrace_event_call_rh_data.patch %description Command for reading ftrace data from a dumpfile. @@ -46,6 +47,7 @@ Command for reading ftrace data from a dumpfile. %patch8 -p1 -b TRACE_EVENT_FL_TRACEPOINT_flag.patch %patch9 -p1 -b big_endian_nr_pages.patch %patch10 -p1 -b ppc64_ring_buffer_read.patch +%patch11 -p1 -b ftrace_event_call_rh_data.patch %build make @@ -63,6 +65,10 @@ rm -rf %{buildroot} %doc COPYING %changelog +* Mon Aug 20 2018 Dave Anderson - 2.0-14 +- Fix for ftrace_event_call data structure change + Resolves: rhbz#1596549 + * Wed Dec 6 2017 Dave Anderson - 2.0.13 - Build requires crash-devel-7.2.0-2 and usage requires crash-7.2.0-2 because of load_module structure change.