diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-09-23 03:42:11 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-09-23 03:42:11 -0400 |
commit | b5727270ecd807f75a8d5d1450cec39495fc794a (patch) | |
tree | b40753b713a39f41179bd0b48668f363814664fd | |
parent | 96f3eda67fcf2598e9d2794398e0e7ab35138ea6 (diff) | |
parent | d0d0313c2ae4bc220c4ed96ce340860a4e74a2e9 (diff) |
Merge branch 'perf/urgent' into perf/core to pick up fixes before pulling new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | tools/lib/traceevent/event-parse.c | 23 | ||||
-rw-r--r-- | tools/perf/util/session.c | 5 |
2 files changed, 24 insertions, 4 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 12447978a921..9aa107a0ce8c 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, | |||
3847 | struct format_field *field; | 3847 | struct format_field *field; |
3848 | struct printk_map *printk; | 3848 | struct printk_map *printk; |
3849 | long long val, fval; | 3849 | long long val, fval; |
3850 | unsigned long addr; | 3850 | unsigned long long addr; |
3851 | char *str; | 3851 | char *str; |
3852 | unsigned char *hex; | 3852 | unsigned char *hex; |
3853 | int print; | 3853 | int print; |
@@ -3880,13 +3880,30 @@ static void print_str_arg(struct trace_seq *s, void *data, int size, | |||
3880 | */ | 3880 | */ |
3881 | if (!(field->flags & FIELD_IS_ARRAY) && | 3881 | if (!(field->flags & FIELD_IS_ARRAY) && |
3882 | field->size == pevent->long_size) { | 3882 | field->size == pevent->long_size) { |
3883 | addr = *(unsigned long *)(data + field->offset); | 3883 | |
3884 | /* Handle heterogeneous recording and processing | ||
3885 | * architectures | ||
3886 | * | ||
3887 | * CASE I: | ||
3888 | * Traces recorded on 32-bit devices (32-bit | ||
3889 | * addressing) and processed on 64-bit devices: | ||
3890 | * In this case, only 32 bits should be read. | ||
3891 | * | ||
3892 | * CASE II: | ||
3893 | * Traces recorded on 64 bit devices and processed | ||
3894 | * on 32-bit devices: | ||
3895 | * In this case, 64 bits must be read. | ||
3896 | */ | ||
3897 | addr = (pevent->long_size == 8) ? | ||
3898 | *(unsigned long long *)(data + field->offset) : | ||
3899 | (unsigned long long)*(unsigned int *)(data + field->offset); | ||
3900 | |||
3884 | /* Check if it matches a print format */ | 3901 | /* Check if it matches a print format */ |
3885 | printk = find_printk(pevent, addr); | 3902 | printk = find_printk(pevent, addr); |
3886 | if (printk) | 3903 | if (printk) |
3887 | trace_seq_puts(s, printk->printk); | 3904 | trace_seq_puts(s, printk->printk); |
3888 | else | 3905 | else |
3889 | trace_seq_printf(s, "%lx", addr); | 3906 | trace_seq_printf(s, "%llx", addr); |
3890 | break; | 3907 | break; |
3891 | } | 3908 | } |
3892 | str = malloc(len + 1); | 3909 | str = malloc(len + 1); |
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index d1a43a322f96..f5e000030a5e 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -1565,7 +1565,10 @@ static int __perf_session__process_events(struct perf_session *session, | |||
1565 | file_offset = page_offset; | 1565 | file_offset = page_offset; |
1566 | head = data_offset - page_offset; | 1566 | head = data_offset - page_offset; |
1567 | 1567 | ||
1568 | if (data_size && (data_offset + data_size < file_size)) | 1568 | if (data_size == 0) |
1569 | goto out; | ||
1570 | |||
1571 | if (data_offset + data_size < file_size) | ||
1569 | file_size = data_offset + data_size; | 1572 | file_size = data_offset + data_size; |
1570 | 1573 | ||
1571 | ui_progress__init(&prog, file_size, "Processing events..."); | 1574 | ui_progress__init(&prog, file_size, "Processing events..."); |