diff options
Diffstat (limited to 'tools/perf/util/header.c')
-rw-r--r-- | tools/perf/util/header.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index fe652f3b0aa7..073f0e1c7123 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -946,6 +946,24 @@ u64 perf_header__sample_type(struct perf_header *header) | |||
946 | return type; | 946 | return type; |
947 | } | 947 | } |
948 | 948 | ||
949 | bool perf_header__sample_id_all(const struct perf_header *header) | ||
950 | { | ||
951 | bool value = false, first = true; | ||
952 | int i; | ||
953 | |||
954 | for (i = 0; i < header->attrs; i++) { | ||
955 | struct perf_header_attr *attr = header->attr[i]; | ||
956 | |||
957 | if (first) { | ||
958 | value = attr->attr.sample_id_all; | ||
959 | first = false; | ||
960 | } else if (value != attr->attr.sample_id_all) | ||
961 | die("non matching sample_id_all"); | ||
962 | } | ||
963 | |||
964 | return value; | ||
965 | } | ||
966 | |||
949 | struct perf_event_attr * | 967 | struct perf_event_attr * |
950 | perf_header__find_attr(u64 id, struct perf_header *header) | 968 | perf_header__find_attr(u64 id, struct perf_header *header) |
951 | { | 969 | { |