diff options
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r-- | tools/perf/util/header.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 72c124dc5781..108b0db7bbef 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -969,37 +969,6 @@ bool perf_header__sample_id_all(const struct perf_header *header) | |||
969 | return value; | 969 | return value; |
970 | } | 970 | } |
971 | 971 | ||
972 | struct perf_event_attr * | ||
973 | perf_header__find_attr(u64 id, struct perf_header *header) | ||
974 | { | ||
975 | int i; | ||
976 | |||
977 | /* | ||
978 | * We set id to -1 if the data file doesn't contain sample | ||
979 | * ids. This can happen when the data file contains one type | ||
980 | * of event and in that case, the header can still store the | ||
981 | * event attribute information. Check for this and avoid | ||
982 | * walking through the entire list of ids which may be large. | ||
983 | */ | ||
984 | if (id == -1ULL) { | ||
985 | if (header->attrs > 0) | ||
986 | return &header->attr[0]->attr; | ||
987 | return NULL; | ||
988 | } | ||
989 | |||
990 | for (i = 0; i < header->attrs; i++) { | ||
991 | struct perf_header_attr *attr = header->attr[i]; | ||
992 | int j; | ||
993 | |||
994 | for (j = 0; j < attr->ids; j++) { | ||
995 | if (attr->id[j] == id) | ||
996 | return &attr->attr; | ||
997 | } | ||
998 | } | ||
999 | |||
1000 | return NULL; | ||
1001 | } | ||
1002 | |||
1003 | int perf_event__synthesize_attr(struct perf_event_attr *attr, u16 ids, u64 *id, | 972 | int perf_event__synthesize_attr(struct perf_event_attr *attr, u16 ids, u64 *id, |
1004 | perf_event__handler_t process, | 973 | perf_event__handler_t process, |
1005 | struct perf_session *session) | 974 | struct perf_session *session) |