]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'perf/urgent' into perf/core to pick up fixes before pulling new changes
authorIngo Molnar <mingo@kernel.org>
Wed, 23 Sep 2015 07:42:11 +0000 (09:42 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 23 Sep 2015 07:42:11 +0000 (09:42 +0200)
Signed-off-by: Ingo Molnar <mingo@kernel.org>
tools/lib/traceevent/event-parse.c
tools/perf/util/session.c

index 12447978a92114f042fecf95dbe21feac487814a..9aa107a0ce8cba0c1344b7312017fed9e0f4c87c 100644 (file)
@@ -3847,7 +3847,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
        struct format_field *field;
        struct printk_map *printk;
        long long val, fval;
-       unsigned long addr;
+       unsigned long long addr;
        char *str;
        unsigned char *hex;
        int print;
@@ -3880,13 +3880,30 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
                 */
                if (!(field->flags & FIELD_IS_ARRAY) &&
                    field->size == pevent->long_size) {
-                       addr = *(unsigned long *)(data + field->offset);
+
+                       /* Handle heterogeneous recording and processing
+                        * architectures
+                        *
+                        * CASE I:
+                        * Traces recorded on 32-bit devices (32-bit
+                        * addressing) and processed on 64-bit devices:
+                        * In this case, only 32 bits should be read.
+                        *
+                        * CASE II:
+                        * Traces recorded on 64 bit devices and processed
+                        * on 32-bit devices:
+                        * In this case, 64 bits must be read.
+                        */
+                       addr = (pevent->long_size == 8) ?
+                               *(unsigned long long *)(data + field->offset) :
+                               (unsigned long long)*(unsigned int *)(data + field->offset);
+
                        /* Check if it matches a print format */
                        printk = find_printk(pevent, addr);
                        if (printk)
                                trace_seq_puts(s, printk->printk);
                        else
-                               trace_seq_printf(s, "%lx", addr);
+                               trace_seq_printf(s, "%llx", addr);
                        break;
                }
                str = malloc(len + 1);
index d1a43a322f966967fc20fd30ede9e7c1030afd19..f5e000030a5eabeb52aa35791ed402f9775972fc 100644 (file)
@@ -1565,7 +1565,10 @@ static int __perf_session__process_events(struct perf_session *session,
        file_offset = page_offset;
        head = data_offset - page_offset;
 
-       if (data_size && (data_offset + data_size < file_size))
+       if (data_size == 0)
+               goto out;
+
+       if (data_offset + data_size < file_size)
                file_size = data_offset + data_size;
 
        ui_progress__init(&prog, file_size, "Processing events...");