summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-09-23 09:42:11 +0200
committerIngo Molnar <mingo@kernel.org>2015-09-23 09:42:11 +0200
commitb5727270ecd807f75a8d5d1450cec39495fc794a (patch)
treeb40753b713a39f41179bd0b48668f363814664fd /tools/lib
parent96f3eda67fcf2598e9d2794398e0e7ab35138ea6 (diff)
parentd0d0313c2ae4bc220c4ed96ce340860a4e74a2e9 (diff)
downloadop-kernel-dev-b5727270ecd807f75a8d5d1450cec39495fc794a.zip
op-kernel-dev-b5727270ecd807f75a8d5d1450cec39495fc794a.tar.gz
Merge branch 'perf/urgent' into perf/core to pick up fixes before pulling new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/traceevent/event-parse.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 1244797..9aa107a0 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -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);
OpenPOWER on IntegriCloud