diff options
Diffstat (limited to 'tools/perf/util/evlist.c')
-rw-r--r-- | tools/perf/util/evlist.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 45da8d186b4..98cb1f30aa2 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -398,3 +398,34 @@ int perf_evlist__set_filters(struct perf_evlist *evlist) | |||
398 | 398 | ||
399 | return 0; | 399 | return 0; |
400 | } | 400 | } |
401 | |||
402 | u64 perf_evlist__sample_type(struct perf_evlist *evlist) | ||
403 | { | ||
404 | struct perf_evsel *pos; | ||
405 | u64 type = 0; | ||
406 | |||
407 | list_for_each_entry(pos, &evlist->entries, node) { | ||
408 | if (!type) | ||
409 | type = pos->attr.sample_type; | ||
410 | else if (type != pos->attr.sample_type) | ||
411 | die("non matching sample_type"); | ||
412 | } | ||
413 | |||
414 | return type; | ||
415 | } | ||
416 | |||
417 | bool perf_evlist__sample_id_all(const struct perf_evlist *evlist) | ||
418 | { | ||
419 | bool value = false, first = true; | ||
420 | struct perf_evsel *pos; | ||
421 | |||
422 | list_for_each_entry(pos, &evlist->entries, node) { | ||
423 | if (first) { | ||
424 | value = pos->attr.sample_id_all; | ||
425 | first = false; | ||
426 | } else if (value != pos->attr.sample_id_all) | ||
427 | die("non matching sample_id_all"); | ||
428 | } | ||
429 | |||
430 | return value; | ||
431 | } | ||