Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223032
b: refs/heads/master
c: 60e6773
h: refs/heads/master
v: v3
  • Loading branch information
Franck Bui-Huu authored and Arnaldo Carvalho de Melo committed Nov 30, 2010
1 parent efef491 commit d5fed6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d214afbd81405d4da2c5745fe867e6b313fd4178
refs/heads/master: 60e677373be9c0bf7c9a22937601d5a40e51c042
11 changes: 8 additions & 3 deletions trunk/tools/perf/util/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,11 +946,16 @@ perf_header__find_attr(u64 id, struct perf_header *header)

/*
* 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.
* ids. This can happen when the data file contains one type
* of event and in that case, the header can still store the
* event attribute information. Check for this and avoid
* walking through the entire list of ids which may be large.
*/
if (id == -1ULL)
if (id == -1ULL) {
if (header->attrs > 0)
return &header->attr[0]->attr;
return NULL;
}

for (i = 0; i < header->attrs; i++) {
struct perf_header_attr *attr = header->attr[i];
Expand Down

0 comments on commit d5fed6f

Please sign in to comment.