From e96142d11a43699bf25c57dd45cc5139d4562914 Mon Sep 17 00:00:00 2001 From: CentOS Buildsys Date: Jan 24 2014 19:35:09 +0000 Subject: import crash-trace-command-2.0-8.el7.src.rpm --- diff --git a/SOURCES/ARM64.patch b/SOURCES/ARM64.patch new file mode 100644 index 0000000..ff7abd0 --- /dev/null +++ b/SOURCES/ARM64.patch @@ -0,0 +1,13 @@ +--- crash-trace-command-2.0/Makefile.orig ++++ crash-trace-command-2.0/Makefile +@@ -22,6 +22,10 @@ ifeq ($(shell arch), s390) + TARGET=S390 + TARGET_CFLAGS= + endif ++ifeq ($(shell arch), aarch64) ++ TARGET=ARM64 ++ TARGET_CFLAGS= ++endif + + INCDIR=/usr/include/crash + diff --git a/SOURCES/linux_3.10_support.patch b/SOURCES/linux_3.10_support.patch new file mode 100644 index 0000000..d520492 --- /dev/null +++ b/SOURCES/linux_3.10_support.patch @@ -0,0 +1,152 @@ +--- crash-trace-command-2.0/trace.c.orig ++++ crash-trace-command-2.0/trace.c +@@ -26,9 +26,21 @@ static int nr_cpu_ids; + */ + static int lockless_ring_buffer; + static int per_cpu_buffer_sizes; ++/* ++ * global and encapsulated current_trace are both supported ++ */ ++static int encapsulated_current_trace; ++/* ++ * trace_buffer is supported ++ */ ++static int trace_buffer_available; + + #define koffset(struct, member) struct##_##member##_offset + ++static int koffset(trace_array, current_trace); ++static int koffset(trace_array, trace_buffer); ++static int koffset(trace_array, max_buffer); ++static int koffset(trace_buffer, buffer); + static int koffset(trace_array, buffer); + static int koffset(tracer, name); + +@@ -85,6 +97,8 @@ struct ring_buffer_per_cpu { + }; + + static ulong global_trace; ++static ulong global_trace_buffer; ++static ulong global_max_buffer; + static ulong global_ring_buffer; + static unsigned global_pages; + static struct ring_buffer_per_cpu *global_buffers; +@@ -144,8 +158,16 @@ static int init_offsets(void) + } \ + } while (0) + ++ if (encapsulated_current_trace) ++ init_offset(trace_array, current_trace); + +- init_offset(trace_array, buffer); ++ if (trace_buffer_available) { ++ init_offset(trace_array, trace_buffer); ++ init_offset(trace_array, max_buffer); ++ init_offset(trace_buffer, buffer); ++ } else { ++ init_offset(trace_array, buffer); ++ } + init_offset(tracer, name); + + if (MEMBER_EXISTS("ring_buffer_per_cpu", "nr_pages")) { +@@ -400,8 +422,13 @@ out_fail: + + static int ftrace_int_global_trace(void) + { +- read_value(global_ring_buffer, global_trace, trace_array, buffer); +- read_value(global_pages, global_ring_buffer, ring_buffer, pages); ++ if (trace_buffer_available) { ++ global_trace_buffer = global_trace + koffset(trace_array, trace_buffer); ++ read_value(global_ring_buffer, global_trace_buffer, trace_buffer, buffer); ++ } else { ++ read_value(global_ring_buffer, global_trace, trace_array, buffer); ++ read_value(global_pages, global_ring_buffer, ring_buffer, pages); ++ } + + global_buffers = calloc(sizeof(*global_buffers), nr_cpu_ids); + if (global_buffers == NULL) +@@ -420,12 +447,17 @@ out_fail: + + static int ftrace_int_max_tr_trace(void) + { +- read_value(max_tr_ring_buffer, max_tr_trace, trace_array, buffer); ++ if (trace_buffer_available) { ++ global_max_buffer = global_trace + koffset(trace_array, max_buffer); ++ read_value(max_tr_ring_buffer, global_max_buffer, trace_buffer, buffer); ++ } else { ++ read_value(max_tr_ring_buffer, max_tr_trace, trace_array, buffer); + +- if (!max_tr_ring_buffer) +- return 0; ++ if (!max_tr_ring_buffer) ++ return 0; + +- read_value(max_tr_pages, max_tr_ring_buffer, ring_buffer, pages); ++ read_value(max_tr_pages, max_tr_ring_buffer, ring_buffer, pages); ++ } + + max_tr_buffers = calloc(sizeof(*max_tr_buffers), nr_cpu_ids); + if (max_tr_buffers == NULL) +@@ -449,7 +481,12 @@ static int ftrace_init_current_tracer(vo + char tmp[128]; + + /* Get current tracer name */ +- read_value(addr, current_trace, POINTER_SYM, POINTER); ++ if (encapsulated_current_trace) { ++ read_value(addr, global_trace, trace_array, current_trace); ++ } else { ++ read_value(addr, current_trace, POINTER_SYM, POINTER); ++ } ++ + read_value(addr, addr, tracer, name); + read_string(addr, tmp, 128); + +@@ -471,19 +508,33 @@ static int ftrace_init(void) + struct syment *sym_current_trace; + + sym_global_trace = symbol_search("global_trace"); +- sym_max_tr_trace = symbol_search("max_tr"); + sym_ftrace_events = symbol_search("ftrace_events"); +- sym_current_trace = symbol_search("current_trace"); + +- if (sym_global_trace == NULL || sym_max_tr_trace == NULL +- || sym_ftrace_events == NULL +- || sym_current_trace == NULL) ++ if (sym_global_trace == NULL || sym_ftrace_events == NULL) + return -1; + + global_trace = sym_global_trace->value; +- max_tr_trace = sym_max_tr_trace->value; + ftrace_events = sym_ftrace_events->value; +- current_trace = sym_current_trace->value; ++ ++ if (MEMBER_EXISTS("trace_array", "current_trace")) { ++ encapsulated_current_trace = 1; ++ } else { ++ sym_current_trace = symbol_search("current_trace"); ++ if (sym_current_trace == NULL) ++ return -1; ++ ++ current_trace = sym_current_trace->value; ++ } ++ ++ if (MEMBER_EXISTS("trace_array", "trace_buffer")) { ++ trace_buffer_available = 1; ++ } else { ++ sym_max_tr_trace = symbol_search("max_tr"); ++ if (sym_max_tr_trace == NULL) ++ return -1; ++ ++ max_tr_trace = sym_max_tr_trace->value; ++ } + + if (!try_get_symbol_data("nr_cpu_ids", sizeof(int), &nr_cpu_ids)) + nr_cpu_ids = 1; +@@ -1453,6 +1504,7 @@ static void ftrace_show(int argc, char * + if ((file = popen(trace_cmd, "r"))) { + ret = fread(buf, 1, sizeof(buf), file); + buf[ret] = 0; ++ pclose(file); + } + if (!strstr(buf, "trace-cmd version")) { + if (env_trace_cmd) diff --git a/SPECS/crash-trace-command.spec b/SPECS/crash-trace-command.spec index 5b2ee5f..bc5d68e 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: 4%{?dist} +Release: 8%{?dist} License: GPLv2 Group: Development/Debuggers Source: %{name}-%{version}.tar.gz @@ -12,7 +12,7 @@ URL: http://people.redhat.com/anderson/extensions/%{name}-%{version}.tar.gz # Vendor: Fujitsu Limited # Packager: Qiao Nuohan ExclusiveOS: Linux -ExclusiveArch: x86_64 %{ix86} ppc64 ia64 s390 s390x +ExclusiveArch: x86_64 %{ix86} ppc64 ia64 s390 s390x aarch64 Buildroot: %{_tmppath}/%{name}-root BuildRequires: crash-devel zlib-devel lzo-devel snappy-devel Requires: trace-cmd @@ -20,6 +20,8 @@ Patch0: trace_compiler_warnings.patch Patch1: replace_obsolete_init_and_fini.patch Patch2: sigsegv_on_calloc_failure.patch Patch3: initialize_trace_dat.patch +Patch4: ARM64.patch +Patch5: linux_3.10_support.patch %description Command for reading ftrace data from a dumpfile. @@ -30,6 +32,8 @@ Command for reading ftrace data from a dumpfile. %patch1 -p1 -b replace_obsolete_init_and_fini.patch %patch2 -p1 -b sigsegv_on_calloc_failure.patch %patch3 -p1 -b initialize_trace_dat.patch +%patch4 -p1 -b ARM64.patch +%patch5 -p1 -b linux_3.10_support.patch %build make @@ -47,6 +51,20 @@ rm -rf %{buildroot} %doc COPYING %changelog +* Fri Jan 24 2014 Daniel Mach - 2.0-8 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 2.0-7 +- Mass rebuild 2013-12-27 + +* Thu Dec 5 2013 Dave Anderson - 2.0-6 +- Add Linux 3.10 support. + Resolves: rhbz#863833 + +* Tue Nov 12 2013 Dave Anderson - 2.0-5 +- Add ARM64 support. + Resolves: rhbz#1028580 + * Tue Aug 20 2013 Dave Anderson - 2.0-4 - crash utility has added LZO and snappy compression in addition to zlib