diff --git a/[refs] b/[refs] index d1a5d61a9780..ca565e44ab0e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 11d232ec285b07860670277c8ab3f6076f7bce1e +refs/heads/master: 02bf60aad7d5912dfcdbe0154f1bd67ea7a8301e diff --git a/trunk/tools/perf/util/event.c b/trunk/tools/perf/util/event.c index 1757b0ffeaa9..2477270c1d3f 100644 --- a/trunk/tools/perf/util/event.c +++ b/trunk/tools/perf/util/event.c @@ -713,6 +713,7 @@ int event__parse_sample(event_t *event, u64 type, struct sample_data *data) array++; } + data->id = -1ULL; if (type & PERF_SAMPLE_ID) { data->id = *array; array++; diff --git a/trunk/tools/perf/util/header.c b/trunk/tools/perf/util/header.c index 2b9f898efea6..8847bec64c54 100644 --- a/trunk/tools/perf/util/header.c +++ b/trunk/tools/perf/util/header.c @@ -922,6 +922,14 @@ perf_header__find_attr(u64 id, struct perf_header *header) { int i; + /* + * We set id to -1 if the data file doesn't contain sample + * ids. Check for this and avoid walking through the entire + * list of ids which may be large. + */ + if (id == -1ULL) + return NULL; + for (i = 0; i < header->attrs; i++) { struct perf_header_attr *attr = header->attr[i]; int j;