diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-12-16 05:22:25 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-12-16 05:22:27 -0500 |
commit | 006b20fe4c69189b0d854e5eabf269e50ca86cdd (patch) | |
tree | 948b08825a36114c85ddc2bfcd965c261e32810f /tools/perf/util/header.c | |
parent | 5f29805a4f4627e766f862ff9f10c14f5f314359 (diff) | |
parent | d949750fed168b6553ca11ed19e4affd19d7a4d7 (diff) |
Merge branch 'perf/urgent' into perf/core
Merge reason: We want to apply a dependent patch.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r-- | tools/perf/util/header.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 76e949a59ea4..16a16021eaa6 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -971,11 +971,16 @@ perf_header__find_attr(u64 id, struct perf_header *header) | |||
971 | 971 | ||
972 | /* | 972 | /* |
973 | * We set id to -1 if the data file doesn't contain sample | 973 | * We set id to -1 if the data file doesn't contain sample |
974 | * ids. Check for this and avoid walking through the entire | 974 | * ids. This can happen when the data file contains one type |
975 | * list of ids which may be large. | 975 | * of event and in that case, the header can still store the |
976 | * event attribute information. Check for this and avoid | ||
977 | * walking through the entire list of ids which may be large. | ||
976 | */ | 978 | */ |
977 | if (id == -1ULL) | 979 | if (id == -1ULL) { |
980 | if (header->attrs > 0) | ||
981 | return &header->attr[0]->attr; | ||
978 | return NULL; | 982 | return NULL; |
983 | } | ||
979 | 984 | ||
980 | for (i = 0; i < header->attrs; i++) { | 985 | for (i = 0; i < header->attrs; i++) { |
981 | struct perf_header_attr *attr = header->attr[i]; | 986 | struct perf_header_attr *attr = header->attr[i]; |