perf/urgent fixes:
User visible: - Fix libtraceevent string handling in heterogeneous arch environments (Kapileshwar Singh) - Avoid infinite loop at buildid processing with no samples in 'perf record' (Mark Rutland) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJWAW1aAAoJENZQFvNTUqpAK4IP/2t5BL9kJNyVvS9XzM9GV6k8 3xRGeq5fE/D3iICp7fUHq5LOtCzaKdO6vlWrxHQgf7ERxISsa2q/PYf06jLsi8Hr Tz7ltcPSuHFXL053e6RvM3jDaC8FC1rlTyTRVg/oW3nkHUjaHFi59ZBuJlL5QeVB 9JJo9j2bcN/20+SuUpnWT8s9MsiCKH8PV6BWuAEA8JQbQydU6QAvuY3VzYXH6w4x 0+z1W0v+rvhwcWnJlfhJ6rES9y+v93uSgd7i5GbnwlbdN3iORwUsZvPQxe5TfxDC 2/QqTU0VI1IAbXswMESstBqFV+ktFpVB9VObsy2UARdOF2BYC+1ji33xui9ZKUR6 9jQYpnQStLYH395QA/D62cAYXtzgOG+z67w5S2UlKRlaYLil2FjWaYqZIddRwJBJ 8dPffm6LuCPxugfqkktNwCyhsJvJ55/l/HW3Fe7SLHbS7mxCQDz07lXQuFb3uPLh Bej04lfelKYc08JP1v3UqxsItfniofnsSSiIwbgc2zrDhs4tAZlZfycZuEeD/fLt H6zFapTEiRLez7wQex5NdbuAoF06mAqSaQe6Tjs63UIadrHmtZcwiD+T4oSiB96g HS8a3KsXfhqjhKp0a+4xHUe+DwYY7mWoj8tt1WsgPBOebP6z7epzGUXrB6vSCyiy 6jCVaMPOJRopcGe4OtDj =9uDt -----END PGP SIGNATURE----- Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent Pull perf/urgent fixes from Arnaldo Carvalho de Melo: - Fix libtraceevent string handling in heterogeneous arch environments. (Kapileshwar Singh) - Avoid infinite loop at buildid processing with no samples in 'perf record'. (Mark Rutland) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
commit
d0d0313c2a
|
@ -3795,7 +3795,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;
|
||||
|
@ -3828,13 +3828,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);
|
||||
|
|
|
@ -1580,7 +1580,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...");
|
||||
|
|
Loading…
Reference in New Issue