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